diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_content_list.json b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..441076c8894b20d9905a4ddb28b56c1741093230
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e53f16250136bc50ff697f3d31b99763eabbcd9eb3495a81b37228c08628a5cd
+size 94705
diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_model.json b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e8f74059cb381fdd91e6ee68f82216fa42b05c0d
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6edfb848da4a1ef9d45973b1f49f0e4dbf96f9e9a9858addea68f24d9942fe90
+size 116058
diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_origin.pdf b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..792c36a2f156c284694ec2d24f7b4b2d204ffd80
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/9cd055f7-5cc2-4afe-afa0-1386f338f66b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:958acc46c07fdd3802d3b0cfcd32810fef79613c58244f6ea836aa2bc53b7d55
+size 7620535
diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/full.md b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..13df3b6bf2fedf5785b9ebc8103a2dcd83c45075
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/full.md
@@ -0,0 +1,372 @@
+# Complementing Brightness Constancy with Deep Networks for Optical Flow Prediction
+
+Vincent Le Guen $^{1,2,3}$ , Clément Rambour $^{2}$ , and Nicolas Thome $^{2,4}$
+
+$^{1}$ EDF R&D, Chatou, France
+ $^{2}$ Conservatoire National des Arts et Métiers, CEDRIC, Paris, France
+ $^{3}$ SINCLAIR AI Lab, Palaiseau, France
+ $^{4}$ Sorbonne Université, CNRS, ISIR, F-75005 Paris, France
+
+Abstract. State-of-the-art methods for optical flow estimation rely on deep learning, which require complex sequential training schemes to reach optimal performances on real-world data. In this work, we introduce the COMBO deep network that explicitly exploits the brightness constancy (BC) model used in traditional methods. Since BC is an approximate physical model violated in several situations, we propose to train a physically-constrained network complemented with a data-driven network. We introduce a unique and meaningful flow decomposition between the physical prior and the data-driven complement, including an uncertainty quantification of the BC model. We derive a joint training scheme for learning the different components of the decomposition ensuring an optimal cooperation, in a supervised but also in a semi-supervised context. Experiments show that COMBO can improve performances over state-of-the-art supervised networks, e.g. RAFT, reaching state-of-the-art results on several benchmarks. We highlight how COMBO can leverage the BC model and adapt to its limitations. Finally, we show that our semi-supervised method can significantly simplify the training procedure.
+
+# 1 Introduction
+
+Optical flow estimation is a classical problem in computer vision, consisting in computing the per-pixel motion between video frames. This is a core visual task useful in many applications, such as video compression [1], medical imaging [4] or object tracking [11]. Yet, this remains a particularly challenging task for real-world scenes, especially in presence of fast-moving objects, occlusions, changes of illumination or textureless surfaces.
+
+Traditional model-based estimation methods [35, 17] assume that the intensity of pixels is conserved during motion $\mathbf{w}$ : $I_{t-1}(\mathbf{x}) = I_t(\mathbf{x} + \mathbf{w})$ , which is known as the brightness constancy (BC) model. Linearizing this constraint for small motion leads to the famous optical flow partial differential equation (PDE) solved by variational methods since the seminal work of Horn and Schunk [17]:
+
+$$
+\frac {\partial I}{\partial t} (t, \mathbf {x}) + \mathbf {w} (t, \mathbf {x}) \cdot \nabla I (t, \mathbf {x}) = 0 \tag {1}
+$$
+
+
+images t-1, t
+
+
+ground truth flow $\mathbf{w}^{\prime }$
+
+
+COMBO prediction $\hat{w}$
+
+
+Brightness Constancy (BC) flow $\widehat{\pmb{w}}_p$
+
+
+Augmentation flow $\hat{\pmb{W}}_a$
+Fig. 1: Proposed COMBO model for flow estimation between two images $I_{1}$ and $I_{2}$ . We explicitly leverage the brightness constancy (BC) assumption in Eq. (1) for estimating the physical flow prediction $\hat{\mathbf{w}}_p$ . Since BC is an approximate model violated in several usual situations, COMBO learns an uncertainty map $\hat{\alpha}$ specifying areas where $\hat{\mathbf{w}}_p$ is relevant, and an augmentation data-driven flow $\hat{\mathbf{w}}_a$ to compensate for the BC violations (in this example, related to fog and occlusions). The final COMBO prediction combining $(\hat{\mathbf{w}}_a, \hat{\mathbf{w}}_p, \hat{\alpha})$ is both physically-regularized and accurate.
+
+
+COMBO uncertainty $\alpha$
+
+However this physical model for optical flow is only a rather coarse approximation of the reality. The BC assumption is violated in many situations: in presence of occlusions, global or local illumination changes, specular reflexions, or complex natural situations such as fog. The correspondence problem is also ambiguous for textureless surfaces. To solve this ill-posed inverse problem, this is necessary to inject prior knowledge about the flow, such as spatial smoothness, sparsity or small total variation.
+
+In contrast to these traditional model-based approaches, deep neural networks have become state-of-the-art for learning optical flow in a pure data-driven fashion [13, 20, 44, 51, 18, 61, 53]. However, since flow labelling on real images is expensive, supervised deep learning methods mostly use complex curriculum training schemes on synthetic datasets to progressively adapt to the complexity of real-world scenes.
+
+More recently, unsupervised deep learning approaches are closer in spirit to traditional approaches [22, 45, 39, 30, 24, 49]. Without ground-truth labels, they rely on a photometric reconstruction loss based on the BC assumption, and additional regularization losses like spatial smoothness. They also use of specific modules, e.g. occlusion detection, to identify images areas where the BC in Eq. (1) is violated.
+
+In this work, we introduce a hybrid model-based machine learning (MB/ML) model dedicated to optical flow estimation, which COMplements Brightness constancy with deep networks for accurate Optical flow prediction (COMBO). As illustrated in Figure 1, COMBO decomposes the estimation process into a physical flow based on the simplified Brightness Constancy (BC) hypothesis and a data-driven augmentation for compensating for the limitations of the physical
+
+model. COMBO also simultaneously learns an uncertainty model of the brightness constancy, useful for fusing the two flow branches into an accurate flow estimation. Importantly, the two branches are learned jointly and a principled optimization ensures an optimal cooperation between them.
+
+Our contributions are the following:
+
+- We propose a principled way to regularize supervised flow models with an explicit exploitation of the BC assumption. We introduce with COMBO a meaningful and unique flow decomposition into a physical part optimizing the BC and an augmentation part compensating for its limitations.
+- We propose to jointly learn the physical, augmented flows and a uncertainty measure of the BC validity, generalizing occlusion detection approaches or robust photometric losses. It also enables to exploit the model in semi-supervised contexts for non-annotated pixels where we know that the BC assumption is satisfied.
+- To learn the COMBO model, we define and compute a fine-grained supervision by decomposing the ground-truth flow into a BC flow, a residual flow and an uncertainty map.
+- Experiments (section 4) show that when included into a state-of-the-art supervised network, i.e. RAFT, COMBO can improve performances consistently over datasets and training curriculum steps. COMBO also reaches state-of-the-art performances on several benchmarks, and we show that the semi-supervised scheme can be leveraged to grandly simplify the training curriculum. We also provide detailed ablations and qualitative analyses attesting the benefits of our principled decomposition framework.
+
+# 2 Related work
+
+Traditional optical flow Since the seminal works of Lucas-Kanade [35] and Horn-Schunck [17], optical flow estimation is traditionally casted as an optimization problem over the space of motion fields between a pair of images [40, 58, 8]. As mentioned in introduction, the cost function is usually based on the conservation assumption of an image descriptor during motion, i.e. the brightness constancy (BC). Since the number of optical flow variables is twice the number of observations, the search problem is underconstrained. Existing methods typically add spatial smoothness constraints on the flow to regularize the problem, enabling to propagate information from non-ambiguous to ambiguous pixels, e.g. occluded. Since, progress has been made for handling the limitations of the brightness constancy with more robust matching loss, such as the gradient constancy [7], the structural similarity (SSIM), the Charbonnier loss [9], the census loss [39] or involving descriptors learned by deep neural networks [3, 59]. However, these traditional methods are limited for handling large motion and often suffer from a high computational cost.
+
+Deep supervised methods Deep neural networks have proven effective for directly learning the optical flow end-to-end from a labelled dataset [13, 20, 44,
+
+51, 18, 53, 23]. Although some methods borrow ideas from traditional methods such as cost volume processing [61] and pyramidal coarse-to-fine warping [44], they do not rely anymore on the conservation of an image descriptor. One of the current state-of-the-art architectures is the Recurrent All-Pairs Field Transforms (RAFT) [53]. This model exploits the correlation volume between all pairs of pixels and iteratively refines the flow with a recurrent neural network. Since obtaining ground-truth flow annotations is very expensive, supervised methods mostly train on synthetic datasets. This leads to a non-negligible generalization gap when transferring to real-world datasets. Consequently, complex curriculum learning schemes are needed to progressively adapt the learned optical flow from synthetic data to real scenarios [53, 50].
+
+Deep unsupervised methods More recently, unsupervised approaches proved to outperform traditional methods even without flow labels [22, 45, 39, 30, 24, 49]. They revisit the brightness constancy assumption by warping the target image with the estimated flow and optimizing a photometric loss. However they still lag behind supervised methods and require additional mechanisms for overcoming the limitations of the BC assumption, e.g. occlusion reasoning [39, 57] or self-supervision [31, 32, 24]. Occlusions were traditionally treated as outliers in a robust estimation setting [7], or estimated with a forward-backward consistency check [2, 39]. More recent approaches jointly learn occlusion maps with convolutional neural networks in a supervised way (i.e. with ground-truth occlusions) [37, 20, 19] or unsupervised way [63, 15, 21]. Nonetheless, most of these methods focus on specific cases of deviations from the brightness constancy assumption, e.g. occlusions or illumination changes. Our approach is more general and learns to compensate for any failure case of this simplified assumption. Besides, we learn from supervised flow data a confidence model of the BC assumption, which enables to learn our model in a semi-supervised setting [26, 60].
+
+Hybrid MB/ML Combining model-based (MB) and machine learning (ML) models is a long-standing subject [42, 54, 46] that yet remains widely open nowadays. Leveraging physical knowledge enables to design machine learning models that learn from less data, and offer better generalization while conserving physical plausibility. Many ideas were explored, such as imposing soft physical constraints [43, 48, 34, 28, 56] in the training loss function or hard constraints in the network architectures [6, 12, 27, 16, 36, 41]. However, most existing approaches assume a fully-known prior physical model. Very few works have investigated how to exploit incomplete physical models with deep neural networks [33, 38, 47, 29, 62]. Besides, exploiting incomplete physical knowledge in a deep hybrid model has never been explored for optical flow to the best of our knowledge.
+
+# 3 COMBO model for optical flow
+
+Given a pair of frames $I_{t-1}$ and $I_t \in \mathbb{R}^{W \times H \times 3}$ , the optical flow task consists in estimating the dense motion field $\mathbf{w} = (u, v) \in \mathbb{R}^{W \times H \times 2}$ that maps each pixel
+
+
+Fig. 2: Our proposed COMBO model for optical flow estimation. Given a pair of input frames $(I_{t - 1}, I_t)$ , COMBO first extract convolutional features. The model is composed of three branches that compute an estimate for the physical flow $\hat{\mathbf{w}}_p$ , the augmentation flow $\hat{\mathbf{w}}_a$ and the uncertainty map $\hat{\alpha}$ .
+
+from the source image $I_{t-1}$ to its corresponding relative location in the target image $I_t$ .
+
+We introduce COMBO, a deep learning model that explicitly exploits the brightness constancy (BC) assumption and learns the complementary information to compensate for the BC modeling errors.
+
+The COMBO model is depicted in Figure 2. The model takes a pair of input frames $(I_{t - 1}, I_t)$ and first encodes them into a feature space. From this common representation space, the rationale of COMBO is to decompose the dense flow $\hat{\mathbf{w}}$ using 3 main quantities: a physical term $\hat{\mathbf{w}}_p \in \mathbb{R}^{W \times H \times 2}$ fulfilling the BC assumption, an augmentation term $\hat{\mathbf{w}}_a \in \mathbb{R}^{W \times H \times 2}$ dedicated to capture the remaining information for accurate flow prediction. For each pixel, our decomposition also involves an uncertainty map $\hat{\alpha} \in [0,1]^{W \times H}$ representing the violation of the BC assumption at each pixel.
+
+In section 3.1, we present our proposed BC augmentation framework, ensuring a unique and meaningful decomposition of $\hat{\mathbf{w}}$ between the physical $\hat{\mathbf{w}}_p$ , augmented $\hat{\mathbf{w}}_a$ and uncertainty $\hat{\alpha}$ terms. From this formulation, we derive in section 3.2 a training scheme to learn the model parameters, including a supervised but also a semi-supervised variant leveraging the learned BC confidence $\hat{\alpha}$ .
+
+# 3.1 BC-augmented flow decomposition
+
+We consider the flow $\mathbf{w}(\mathbf{x})$ representing the displacement of pixel $\mathbf{x} = (x,y)$ from $I_{t - 1}(\mathbf{x})$ to $I_{t}(\mathbf{x})$ . Let us define the brightness constancy divergence as $\mathcal{L}_{BC}(\mathbf{x},\mathbf{w})\coloneqq \ell (I_{t - 1}(\mathbf{x}) - I_t(\mathbf{x} + \mathbf{w}))$ measured with the photometric loss $\ell$ (e.g. the L1 loss). In COMBO, we propose to decompose the ground truth flow
+
+$\mathbf{w}^*$ between a physical flow $\mathbf{w}_p^*$ , an augmentation flow $\mathbf{w}_a^*$ and an uncertainty map $\alpha^*$ :
+
+$$
+\mathbf {w} ^ {*} (\mathbf {x}) = (1 - \alpha^ {*} (\mathbf {x})) \mathbf {w} _ {p} ^ {*} (\mathbf {x}) + \alpha^ {*} (\mathbf {x}) \mathbf {w} _ {a} ^ {*} (\mathbf {x}). \tag {2}
+$$
+
+Since the decomposition in Eq. (2) is not necessarily unique, we define the COMBO decomposition $(\mathbf{w}_p^*, \mathbf{w}_a^*, \alpha^*)$ as the solution of the following constrained optimization problem:
+
+$$
+\min _ {\mathbf {w} _ {p}, \mathbf {w} _ {a}} \| \left(\mathbf {w} _ {a}, \mathbf {w} _ {p}\right) \| \quad \text {s u b j e c t t o :} \tag {3}
+$$
+
+$$
+\left\{ \begin{array}{l} \left(1 - \alpha^ {*} (\mathbf {x})\right) \mathbf {w} _ {p} (\mathbf {x}) + \alpha (\mathbf {x}) \mathbf {w} _ {a} (\mathbf {x}) = \mathbf {w} ^ {*} (\mathbf {x}) \\ \left(1 - \alpha^ {*} (\mathbf {x})\right) | I _ {1} (\mathbf {x}) - I _ {2} (\mathbf {x} + \mathbf {w} _ {p} (\mathbf {x})) | = 0 \\ \alpha^ {*} (\mathbf {x}) = \sigma \left(| I _ {1} (\mathbf {x}) - I _ {2} (\mathbf {x} + \mathbf {w} ^ {*} (\mathbf {x})) |\right). \end{array} \right.
+$$
+
+Theoretical properties of the decomposition: Under these constraints, the decomposition problem in Eq. (3) admits a unique solution $(\mathbf{w}_p^*, \mathbf{w}_a^*, \alpha^*)$ (we detail the proof in supplementary 1). The uniqueness in decomposition of a given flow into the three $(\mathbf{w}_p^*, \mathbf{w}_a^*, \alpha^*)$ components is important since it ensures a well posed problem for learning the different terms.
+
+Beyond its sound mathematical formulation, the decomposition in Eq. (3) is also meaningful. It ensures to properly and explicitly exploit the BC model and to overcome its limitations to represent real data in diverse and complex situations. We detail now each component of this decomposition problem:
+
+Brightness constancy flow $\hat{\mathbf{w}}_p(\mathbf{x})$ : We define the brightness constancy flow $\hat{\mathbf{w}}_p$ as a minimizer of the BC condition, similarly to traditional and unsupervised methods. The BC is a very useful constraint not fully exploited in deep supervised methods. However, as mentioned in introduction, this BC assumption is often violated in real data, e.g. in case of occlusions, illumination changes, textureless surfaces, etc. When directly minimizing $\mathcal{L}_{BC}(\mathbf{x},\mathbf{w}) = \ell (I_{t - 1}(\mathbf{x}) - I_t(\mathbf{x} + \mathbf{w}))$ , for a given pixel $\mathbf{x}$ in the source image, there may exist multiple possible matches in the target image satisfying the BC constraint. Therefore, the BC constraint is only applied to $\mathbf{w}_p$ in Eq. (3), not to the final flow vector $\mathbf{w}^*$ , and is weighted by the BC confidence measure $(1 - \alpha^{*}(\mathbf{x}))$ . This is done on purpose, since the BC constraint is not always verified when training a model from ground truth supervision, making this term possibly conflicting with the supervised objective. We verify experimentally that a naive incorporation of the BC loss during training is not effective. In contrast, COMBO exploits an augmented flow to jointly incorporate the BC knowledge with an adaptive compensation for its violation.
+
+$BC$ augmented flow $\hat{\mathbf{w}}_a(\mathbf{x})$ : In contrast to traditional and unsupervised methods, we do not leverage prior knowledge on the flow but instead rely on a data-driven augmentation $\hat{\mathbf{w}}_a$ to learn how to optimally compensate for the simplified model, as investigated by several recent augmented physical models [33, 55, 38, 47, 29, 62]. To ensure a unique decomposition in Eq. (3), we minimize the norm
+
+of the concatenated vector $(\hat{\mathbf{w}}_a,\hat{\mathbf{w}}_p)$ . The rationale is to compensate with the minimal correction $\| \hat{\mathbf{w}}_a\|$ from the brightness constancy assumption. This least-action augmentation also prevents $\hat{\mathbf{w}}_p(\mathbf{x})$ from being too large: the BC flow is enforced to be as close as possible to the ground-truth flow $\mathbf{w}^*$ . Minimizing the norm of $\hat{\mathbf{w}}_p$ also prevents degenerate cases with possibly several admissible $\hat{\mathbf{w}}_p$ equidistant to $\mathbf{w}^*$ (see supplementary 1 for a discussion).
+
+BC uncertainty $\alpha^{*}(\mathbf{x})$ : We weight the decomposition between $\hat{\mathbf{w}}_p$ and $\hat{\mathbf{w}}_a$ in Eq. (3) with the uncertainty map $\alpha^{*}(\mathbf{x}) = \sigma (\mathcal{L}_{BC}(\mathbf{x},\mathbf{w}^{*}))$ quantifying the per-pixel validity of the BC assumption, where $\sigma$ is a nonlinear function5 ensuring that the uncertainty values spread over [0; 1]. When $\alpha^{*}(\mathbf{x}) = 0$ , the BC assumption is verified; in that case, our decomposition reduces to the physical flow $\hat{\mathbf{w}} (\mathbf{x}) = \hat{\mathbf{w}}_p(\mathbf{x})$ as in traditional methods. On the contrary, when the BC is violated $(\alpha^{*}(\mathbf{x}) > 0)$ , the errors of the brightness constancy modelling are compensated by the data-driven model $\hat{\mathbf{w}}_a$ . This leads to a meaningful decomposition between $\hat{\mathbf{w}}_p$ and $\hat{\mathbf{w}}_a$ .
+
+# 3.2 Training
+
+In this section, we propose to jointly learn the three quantities $\mathbf{w}_p^*$ , $\mathbf{w}_a^*$ and $\alpha^*$ of the flow decomposition Eq. (2) with a deep neural architecture named COMBO. We introduce a practical learning framework to solve the decomposition problem in Eq. (3) in the supervised and semi-supervised settings. Given a dataset of labelled image pairs $\mathcal{D}_{sup} = \{(I_{t-1}, I_t, \mathbf{w}^*)_i\}_{i=1}^{N_{sup}}$ and unlabelled image pairs $\mathcal{D}_{unsup} = \{(I_{t-1}, I_t)_i\}_{i=1}^{N_{unsup}}$ , the goal is to learn the parameters $\theta = \{\theta_b, \theta_p, \theta_a\}$ of the COMBO model depicted in Figure 2, where $\theta_b$ are the backbone encoder parameters, $\theta_p$ the parameters of the BC flow model, $\theta_a$ are the parameters of the augmented flow model.
+
+The general loss for learning the COMBO model is the following:
+
+$$
+\begin{array}{l} \mathcal {L} (\mathcal {D}, \theta) = \lambda_ {p} \| \hat {\mathbf {w}} _ {p} - \mathbf {w} _ {p} ^ {*} \| _ {2} ^ {2} + \lambda_ {a} \| \hat {\mathbf {w}} _ {a} - \mathbf {w} _ {a} ^ {*} \| _ {2} ^ {2} + \lambda_ {t o t a l} \| \hat {\mathbf {w}} - \mathbf {w} ^ {*} \| _ {2} ^ {2} \\ + \lambda_ {p h o t o} \mathcal {L} _ {p h o t o} (\mathcal {D}, \theta) + \lambda_ {w} \| (\hat {\mathbf {w}} _ {a}, \hat {\mathbf {w}} _ {p}) \| ^ {2} + \lambda_ {\alpha} \mathcal {L} _ {\alpha} (\mathcal {D}, \theta), \tag {4} \\ \end{array}
+$$
+
+where $\hat{\mathbf{w}} (\mathbf{x}) = (1 - \hat{\alpha} (\mathbf{x}))\hat{\mathbf{w}}_p(\mathbf{x}) + \hat{\alpha} (\mathbf{x})\hat{\mathbf{w}}_a(\mathbf{x})$ is the flow predicted by COMBO.
+
+The total loss in Eq. (4) is composed of supervised losses on the final flow $\hat{\mathbf{w}}$ , the BC flow $\hat{\mathbf{w}}_p$ and the augmentation flow $\hat{\mathbf{w}}_a$ . In addition to the supervised loss on $\hat{\mathbf{w}}_p$ , we also use a photometric loss similarly to traditional and unsupervised methods. We use the L1 loss weighted by the certainty measure $(1 - \alpha^{*}(\mathbf{x}))$ :
+
+$$
+\mathcal {L} _ {\text {p h o t o}} (\mathcal {D}, \theta) = \sum_ {I _ {1}, I _ {2} \in \mathcal {D}} \sum_ {\mathbf {x}} (1 - \alpha^ {*} (\mathbf {x})) | I _ {1} (\mathbf {x}) - I _ {2} (\mathbf {x} + \hat {\mathbf {w}} _ {p}) | _ {1}. \tag {5}
+$$
+
+With the L1 loss, the physical branch of COMBO directly models the brightness conservation at the pixel level and the learned uncertainty captures the limitations of this hypothesis. Other photometric losses more robust to the brightness
+
+constancy limitations could have been chosen, e.g. the Charbonnier [9], SSIM [24] or census loss [39], that would produce a different physical flow. Our augmentation framework can seamlessly adapt to the level of approximation of the BC model at each pixel. Note that the photometric loss is complementary with the supervised loss $\| \hat{\mathbf{w}}_p - \mathbf{w}_p^*\| _2^2$ : a small error on the predicted flow $\hat{\mathbf{w}}_p$ results in a small endpoint error (EPE) but can have a large photometric error if $\hat{\mathbf{w}}_p$ leads to a large photometric change in the target image.
+
+Finally, we define the uncertainty loss as:
+
+$$
+\mathcal {L} _ {\alpha} \left(\mathcal {D} _ {s u p}, \theta\right) = \sum_ {I _ {1}, I _ {2} \in \mathcal {D} _ {s u p}} \sum_ {\mathbf {x}} \| \hat {\alpha} (\mathbf {x}) - \sigma \left(\mathcal {L} _ {B C} \left(\mathbf {x}, \mathbf {w} ^ {*}\right)\right) \| _ {2} ^ {2}. \tag {6}
+$$
+
+Curriculum learning for the BC uncertainty: In the COMBO decomposition $\hat{\mathbf{w}} (\mathbf{x}) = (1 - \hat{\alpha} (\mathbf{x}))\hat{\mathbf{w}}_p(\mathbf{x}) + \hat{\alpha} (\mathbf{x})\hat{\mathbf{w}}_a(\mathbf{x})$ , a bad estimate of the uncertainty $\alpha$ could be harmful for learning $\hat{\mathbf{w}}_p$ and $\hat{\mathbf{w}}_a$ . Therefore, similarly to the teacher forcing strategy in sequential models, we choose a scheduled sampling strategy [5] where we use the ground truth $\alpha^{*}$ with high probability at the beginning of learning, and decrease progressively this probability towards 0 to rely more and more on the prediction $\hat{\alpha}$ (see Algorithm 1).
+
+Supervised learning: In the supervised learning setting, we only exploit the supervised set $\mathcal{D}_{sup}$ . We minimize the total loss in Eq. (4) by using the fine-grained supervision on $(\mathbf{w}_p^*, \mathbf{w}_a^*, \alpha^*)$ that we have created (see supplementary 3.1 for examples of tuples $(\mathbf{w}_p^*, \mathbf{w}_a^*, \alpha^*)$ for each dataset).
+
+Semi-supervised learning: COMBO can be also favorably used in a semi-supervised training setting, which consists in exploiting the information of non-annotated images in $\mathcal{D}_{unsup}$ in addition to the annotated frames in $\mathcal{D}_{sup}$ . This is an important context in practice since labelling flow images is expensive at scale (in general $N_{unsup} \gg N_{sup}$ ). Leveraging unlabelled data directly on the target dataset is an appealing way for unsupervised domain adaptation.
+
+When learning in semi-supervised mode (see Algorithm 1), we mix in a minibatch labelled image pairs from $\mathcal{D}_{sup}$ and unlabelled image pairs from $\mathcal{D}_{unsup}$ . For labelled images, we again minimize the supervised loss $\mathcal{L}$ defined in Eq. (4). For unlabelled frames, we refine the estimation of $\hat{\mathbf{w}}_p$ by exploiting the photometric loss on pixels that are likely to satisfy the BC constraint (measured by the uncertainty map $\alpha$ learned with ground-truth data). We only minimize in that case the photometric loss $\mathcal{L}_{photo}(\mathcal{D}_{unsup},\theta)$ , which corresponds to the particular case of Eq. (4) by setting $\lambda_{photo} = 1$ and $\lambda_p = \lambda_a = \lambda_{total} = \lambda_w = \lambda_\alpha = 0$ . Importantly, for unlabelled images, we block the gradient flow in the uncertainty branch $\alpha$ since $\alpha$ can only be estimated in supervised mode.
+
+# 4 Experiments
+
+We evaluate and compare COMBO to recent state-of-the-art models on the optical flow datasets FlyingChairs [13], MPI Sintel [10] and KITTI-2015 [14], in
+
+Algorithm 1: COMBO optimization:
+Parameters: $\lambda_{p},\lambda_{a},\lambda_{total},\lambda_{photo},\lambda_{w},\lambda_{\alpha}\geq 0,\tau >0$ for epoch $= 1:N_{\mathrm{epoch}}$ do for each batch $b = (b_{sup},b_{unsup})$ do If Rand(0,1) $< 1 -$ epoch/50 Then:# scheduled sampling $\hat{\mathbf{w}} (\mathbf{x}) = (1 - \alpha^{*}(\mathbf{x}))\hat{\mathbf{w}}_p(\mathbf{x}) + \alpha^* (\mathbf{x})\hat{\mathbf{w}}_a(\mathbf{x})$ Else: $\hat{\mathbf{w}} (\mathbf{x}) = (1 - \hat{\alpha} (\mathbf{x}))\hat{\mathbf{w}}_p(\mathbf{x}) + \hat{\alpha} (\mathbf{x})\hat{\mathbf{w}}_a(\mathbf{x})$ Compute $\mathcal{L}_{sup} = \mathcal{L}(b_{sup},\theta ,\lambda_{sup},\lambda_{photo},\lambda_w,\lambda_\alpha)$ with Eq.4 Compute $\mathcal{L}_{unsup} = \mathcal{L}_{photo}(b_{unsup},\theta)$ $\theta_{j + 1} = \theta_j - \tau \nabla (\mathcal{L}_{sup} + \mathcal{L}_{unsup})$
+
+the supervised and semi-supervised contexts. For model analysis, we perform a train/test resplit of the Sintel and KITTI training datasets, as done by [30]. Our code is available at https://github.com/vincent-leguen/COMBO.
+
+# 4.1 Experimental setup
+
+We adopt for the backbone encoder and flow network the RAFT architecture [53], which is one of the current state-of-the-art methods for supervised optical flow. The encoder is composed of convolutional layers that extract features from images $I_{t-1}$ and $I_t$ at resolution $1/8$ . Then visual similarity is modelled by constructing a 4D correlation volume that computes matching costs for all possible displacements. The optical flow branch is a gated recurrent unit (GRU) that progressively refines the flow from an initial estimate, with lookups on the correlation volume. The final flow is the sum of residual refinements from the GRU, upsampled at full resolution.
+
+In the COMBO model, the encoder and correlation volume are shared, and each branch has its own GRU initialized from zero. The uncertainty branch
+
+
| Stage | Method | Chairs | Sintel-test-resplit | KITTI-test-resplit |
| Clean | Final | Fl-epe | Fl-all |
| C | RAFT | 0.82 | 1.11 | 1.76 | 10.7 | 39.7 |
| C | COMBO | 0.74 | 1.04 | 1.58 | 10.2 | 39.3 |
| C+T | RAFT | 1.15 | 0.82 | 1.17 | 5.67 | 17.9 |
| C+T | COMBO | 1.09 | 0.77 | 0.96 | 5.46 | 17.3 |
| C+T+ | RAFT | 1.23 | 0.57 | 0.76 | 1.79 | 7.12 |
| S+H+K | COMBO | 1.16 | 0.56 | 0.71 | 1.75 | 6.58 |
+
+Table 1: Performances of COMBO compared to the RAFT model (run with online code). COMBO consistently outperforms RAFT on the three training stages, illustrating the relevance of leveraging the BC physical model and complementing its failure cases.
+
+| Stage | Method | Chairs | Sintel (train) | KITTI-15 (train) |
| Clean | Final | Fl-epe | Fl-all |
| C | RAFT [53] | 0.82 | 2.26 | 4.52 | 10.67 | 39.72 |
| C | GMA [23] | 0.79 | 2.32 | 4.10 | 10.32 | 36.91 |
| C | COMBO | 0.74 | 2.19 | 4.37 | 10.19 | 39.02 |
| C+T | LiteFlowNet [20] | - | 2.48 | 4.04 | 10.39 | 28.5 |
| C+T | PWC-Net [51] | - | 2.55 | 3.93 | 10.35 | 33.7 |
| C+T | VCN [61] | - | 2.21 | 3.68 | 8.36 | 25.1 |
| C+T | MaskFlowNet [63] | - | 2.25 | 3.61 | - | 23.1 |
| C+T | RAFT [53] | 1.15 | 1.43 | 2.71 | 5.01 | 17.5 |
| C+T | GMA [23] | 1.19 | 1.31 | 2.73 | 4.69 | 17.1 |
| C+T | COMBO | 1.09 | 1.31 | 2.58 | 4.69 | 16.5 |
+
+Table 2: State-of-the-art performance comparison on FlyingChairs, Sinteltrain and KITTI-train, when learning on FlyingChairs (C) and FlyingChairs+FlyingThings (C+T). Scores are reported from corresponding papers.
+
+is simply adapted to provide a unique output channel. We give details on the network architectures and hyperparameters in supplementary 2. The code of COMBO will be released if accepted. Note that our method is agnostic to the optical flow backbone. Any other deep architecture than RAFT could be used for computing the physical, augmentation flow and the uncertainty map.
+
+# 4.2 Supervised state-of-the-art comparison
+
+Following the supervised learning curriculum of prior works [63, 52, 53, 23], we pretrain our models successively on the synthetic datasets FlyingChairs [13] and FlyingThings3D [37]. We then finetune on Sintel [10] by combining data from Sintel, KITTI-2015 and HD1K [25]. We finally finetune on KITTI-2015 with only data from KITTI.
+
+In Table 1, we compare the endpoint error (EPE) of COMBO with RAFT [53], by running the code from the authors. Since we rely on a RAFT architecture, the results in Table 1 directly evaluate the impact of the proposed augmented model and learning scheme. We see that COMBO consistently outperforms RAFT on FlyingChairs, Sintel-test-resplit and KITTI-test-resplit from all stages of the curriculum. This confirms the relevance of leveraging the BC constraint for regularizing supervised models, and the use of the augmentation for compensating its violations.
+
+In Table 2, we compare COMBO to competitive supervised optical flow baselines, from the stages FlyingChairs (C) and FlyingChairs+FlyingThings $(\mathrm{C} + \mathrm{T})$ When generalizing to Sintel-train and KITTI-train, COMBO outperforms RAFT [53] in all cases, and is superior or equivalent to the recent GMA model [23] in $6 / 8$ cases. Note also that COMBO outperforms all other methods on FlyingChairs.
+
+| model | mode | checkpoint | KITTI (test-resplit) |
| | | F1-epe | F1-all |
| RAFT [53] | sup | C | 2.28 | 7.60 |
| COMBO | sup | C | 2.19 | 7.30 |
| COMBO | semisup | C | 1.75 | 6.88 |
| RAFT [53] | sup | S | 1.79 | 7.12 |
| COMBO | sup | S | 1.75 | 6.58 |
| COMBO | semisup | S | 1.74 | 6.58 |
+
+Table 3: Comparison with RAFT on KITTI-test-resplit from the FlyingChairs (C) and Sintel (S) checkpoints, with supervised and semisup training on KITTI. We see that COMBO in semisup from Chairs is almost equivalent to COMBO from Sintel, showing that the training curriculum can be drastically reduced.
+
+# 4.3 Semi-supervised results
+
+We analyze the performances of COMBO in a semi-supervised learning setting in Table 3. We evaluate the different models on KITTI test-resplit, using for training the annotated images of KITTI train-resplit (sup) and the additional unlabelled images of KITTI (semisup). When training on KITTI from the earliest stage of the curriculum (FlyingChairs), we can see that COMBO-semisup (Fl-epe=1.75) largely improves over RAFT-sup (2.28) and COMBO-sup (2.19). It confirms that leveraging the vast amount of unlabelled frames is crucial for adapting the model to a target dataset from an early checkpoint. Interestingly, the semisup training from Chairs is almost equivalent to the COMBO model trained from the Sintel checkpoint (1.74). It shows that COMBO trained in a semisup context enables to greatly simplify the training curriculum to reach similar performances. This feature of COMBO is of crucial interest in many domains for transferring models to target datasets from a single synthetic training stage.
+
+To further analyze the semi-supervised learning ability of COMBO, we progressively reduce the number of training images on KITTI-resplit and compare the performances of RAFT and COMBOsemisup trained from the FlyingChairs checkpoint. In Figure 3, we observe that RAFT degrades much more sharply than COMBO with fewer training images, and the difference in EPE becomes very large with $10\%$ of training images (EPE=11.6 for RAFT v.s. 4.4 for COMBO). It highlights the crucial ability of COMBO to leverage the BC assumption on unlabeled frames.
+
+
+Fig.3: Performances on KITTI-resplit trained from the Chairs, w.r.t. the number of labelled frames.
+
+
+
+
+
+
+Fig. 4: Qualitative prediction results on MPI Sintel. We observe that in zones of high uncertainty of the BC, the physical flow $\hat{\mathbf{w}}_p$ is ill-defined; the augmentation flow $\hat{\mathbf{w}}_a$ successfully complements it for accurate flow estimation. We also show that the uncertainty learned by COMBO is consistent with the GT BC uncertainty, and that it detects other cases of violation of the BC different from occlusions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+COMBO $w_{p}$
+Fig. 5: Qualitative prediction results on KITTI 2015. We see that at the bottom of the image where the road becomes occluded, the physical flow $\hat{\mathbf{w}}_p$ is ill-defined and is complements by $\hat{\mathbf{w}}_a$ for accurate prediction.
+
+
+COMBO $W_{a}$
+
+
+COMBO EPE=45.266
+
+
+COMBO uncertainty
+
+
+
+
+
+
+Fig. 6: Failure cases of the brightness constancy detected by COMBO different from occlusions. The last column corresponds to image 1 masked by the map of thresholded uncertainty $\hat{\alpha}$ deprived of the ground-truth occlusions. From top to bottom, COMBO captures: illumination change, motion blur and fog.
+
+
+image2
+
+
+
+
+
+
+GT flow
+
+
+
+
+
+
+Illumination changes
+motion blur
+
+
+fog
+
+
+
+# 4.4 Ablation study
+
+We perform in Table 4 an ablation study on FlyingChairs to analyze the behaviour of the COMBO model. We first show that two RAFT branches trained with different seeds and mixed 50:50 improve over RAFT but is largely inferior to COMBO, show that the performances of COMBO do not simply come from an augmentation of the parameters or an ensembling effect. Then, we see that a single RAFT branch with the photometric loss $\mathcal{L}_{photo}$ in Eq. (5) (epe=0.794) is far inferior to COMBO (0.743). This is because the BC regularization helps in improving generalization in regions where the BC assumption is fulfilled, but is detrimental in regions where the BC assumption does not hold. In contrast, COMBO can leverage the BC assumption and complement it in an adaptive manner when it is violated, overcoming the conflict issues between the two terms.
+
+Moreover, the linear decomposition $\hat{\mathbf{w}} = \hat{\mathbf{w}}_p + \hat{\mathbf{w}}_a$ without the uncertainty branch, i.e. we set $\alpha (\mathbf{x}) = 1 / 2$ everywhere, is clearly inferior to COMBO. It shows the crucial necessity to account for the uncertainty of the BC. Finally, when we remove the minimization of $\| (\hat{\mathbf{w}}_a,\hat{\mathbf{w}}_p)\|$ from COMBO (then the decomposition is not unique anymore), the performances also decrease, highlighting the superiority of the well-posed and unique decomposition of COMBO.
+
+We then report in Table 5 the performances of the individual $\hat{\mathbf{w}}_p$ (resp. $\hat{\mathbf{w}}_a$ ) branches weighted by the certainty of the BC (resp. uncertainty). For example, we compute $EPE_{weighted}(\hat{\mathbf{w}}_p,\mathbf{w}^*) = \sum_{\mathbf{x}}(1 - \alpha^*(\mathbf{x}))\|\hat{\mathbf{w}}_p(\mathbf{x}) - \mathbf{w}^*(\mathbf{x})\|_2$ . We see that both $\hat{\mathbf{w}}_p$ and $\hat{\mathbf{w}}_a$ are superior to RAFT on areas where they apply. In particular the performance gap compared to RAFT widens on areas with high BC uncertainty (EPE= 2.20 v.s. 0.52), showing the benefits of the COMBO decomposition to greatly improve the estimation on challenging zones.
+
+| Method | EPE (FlyingChairs) |
| RAFT [53] | 0.818 |
| 2 RAFT branches mixed equally | 0.800 |
| RAFT + BC photometric loss | 0.794 |
| COMBO帽子p+hatw(a) (no weighting by uncertainty) | 0.769 |
| COMBO without min ||(hatw,a,hatw)p|| | 0.752 |
| COMBO | 0.743 |
+
+Table 4: Ablation study on FlyingChairs, showing the benefits of the meaningful and principled decomposition of COMBO, compared to the backbone RAFT.
+
+# 4.5 COMBO analysis
+
+We provide qualitative flow predictions of the COMBO model for Sintel-test-resplit in Figure 4 and KITTI-test-resplit in Figure 5. In uncertain zones ( $\hat{\alpha} \approx 1$ , for example in the occluded region of the bird in Figure 4 or at the bottom of Figure 5), we can see that $\hat{\mathbf{w}}_p$ gives incoherent results, as expected. In that case, the flow is efficiently complemented by $\hat{\mathbf{w}}_a$ to produce the COMBO flow.
+
+| Method | EPE weighted (FlyingChairs) |
| RAFT on BC certain zones | 0.48 |
| COMBO帽子p on certain zones | 0.30 |
| RAFT on BC uncertain zones | 2.29 |
| COMBO帽子a on uncertain zones | 0.52 |
+
+Table 5: Performances of the individual BC $\hat{\mathbf{w}}_p$ and residual $\hat{\mathbf{w}}_a$ flow branches on areas with high BC confidence (resp. high BC uncertainty).
+
+Occlusion detection: To analyze the ability of COMBO to detect occlusions, we represent in supplementary 3.2 the precision-recall curve of the COMBO uncertainty detector with respect to the ground-truth occlusion masks (which are known for Sintel). COMBO obtains an Average Precision (AP) of $59\%$ , which is a lower bound of the true AP of COMBO for occlusions (since COMBO also captures other failure cases than occlusions). This means that COMBO is able to efficiently detect occlusions without any ground-truth occlusion supervision, compared to the random classifier which reaches $7\%$ (ratio of occluded pixels).
+
+Detection of other failure cases of the BC: In the third line of Figure 4, we show the ground-truth (GT) BC uncertainty mask (defined as $\mathcal{L}_{BC} > \epsilon$ , $\epsilon = 0.01$ in Figure 4) and the ground-truth occlusions of Sintel. We observe that the COMBO uncertainty globally aligns with the GT BC uncertainty, and covers a larger area than the GT occlusions. To investigate this, we display the thresholded uncertainty mask $\alpha$ deprived of the GT occlusions: it shows that COMBO can capture other failure cases of the BC different than occlusions. Applying this mask on image 1 (bottom right of Figure 4) shows that this corresponds to illumination changes for this example.
+
+We further analyze the other failure cases of the BC in Figure 6. We can see that COMBO can detect other cases of violation of the BC, without any supervision masks on these cases. The top row of Figure 6 shows that the uncertainty $\alpha$ detects the illumination change on the arm of the woman. On the middle row, the uncertainty concentrates on the woman running, which causes motion blur. The bottom row shows a BC uncertainty on a large part of the image, caused by the presence of fog. We provide additional visualizations in supplementary 3.4.
+
+# 5 Conclusion
+
+We have introduced COMBO, a new physically-constrained architecture for optical flow estimation that explicitly exploits the simplified brightness constancy constraint. COMBO learns the uncertainty of the BC and how to complement it with a data-driven network. COMBO reaches state-of-the-art results on several benchmarks, and is able to greatly simplify the training curriculum with a semi-supervised learning scheme. An appealing perspective would be to investigate the application of augmented physical models to multi-frame optical flow estimation.
+
+# References
+
+1. Agustsson, E., Minnen, D., Johnston, N., Balle, J., Hwang, S.J., Toderici, G.: Scale-space flow for end-to-end optimized video compression. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8503-8512 (2020)
+2. Alvarez, L., Deriche, R., Papadopoulos, T., Sánchez, J.: Symmetrical dense optical flow estimation with occlusions detection. International Journal of Computer Vision 75(3), 371-385 (2007)
+3. Bailer, C., Varanasi, K., Stricker, D.: Cnn-based patch matching for optical flow with thresholded hinge embedding loss. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3250-3259 (2017)
+4. Balakrishnan, G., Zhao, A., Sabuncu, M.R., Guttag, J., Dalca, A.V.: An unsupervised learning model for deformable medical image registration. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 9252-9260 (2018)
+5. Bengio, S., Vinyals, O., Jaitly, N., Shazeer, N.: Scheduled sampling for sequence prediction with recurrent neural networks. Advances in neural information processing systems 28 (2015)
+6. de Bezenac, E., Pajot, A., Gallinari, P.: Deep learning for physical processes: Incorporating prior scientific knowledge. ICLR (2018)
+7. Brox, T., Bruhn, A., Papenberg, N., Weickert, J.: High accuracy optical flow estimation based on a theory for warping. In: European conference on computer vision. pp. 25-36. Springer (2004)
+8. Brox, T., Malik, J.: Large displacement optical flow: descriptor matching in variational motion estimation. IEEE transactions on pattern analysis and machine intelligence 33(3), 500-513 (2010)
+9. Bruhn, A., Weickert, J., Schnörr, C.: Lucas/kanade meets horn/schunck: Combining local and global optic flow methods. International journal of computer vision 61(3), 211-231 (2005)
+0. Butler, D.J., Wulff, J., Stanley, G.B., Black, M.J.: A naturalistic open source movie for optical flow evaluation. In: European conference on computer vision. pp. 611-625. Springer (2012)
+1. Corpetti, T., Mémin, É., Pérez, P.: Dense estimation of fluid flows. IEEE Transactions on pattern analysis and machine intelligence 24(3), 365-380 (2002)
+2. Daw, A., Thomas, R.Q., Carey, C.C., Read, J.S., Appling, A.P., Karpatne, A.: Physics-guided architecture (pga) of neural networks for quantifying uncertainty in lake temperature modeling. In: Proceedings of the 2020 siam international conference on data mining. pp. 532-540. SIAM (2020)
+3. Dosovitskiy, A., Fischer, P., Ilg, E., Hausser, P., Hazirbas, C., Golkov, V., Van Der Smagt, P., Cremers, D., Brox, T.: Flownet: Learning optical flow with convolutional networks. In: Proceedings of the IEEE international conference on computer vision (ICCV). pp. 2758-2766 (2015)
+4. Geiger, A., Lenz, P., Stiller, C., Urtasun, R.: Vision meets robotics: The kitti dataset. The International Journal of Robotics Research 32(11), 1231-1237 (2013)
+5. Godet, P., Boulch, A., Plyer, A., Le Besnerais, G.: Starflow: A spatiotemporal recurrent cell for lightweight multi-frame optical flow estimation. In: 2020 25th International Conference on Pattern Recognition (ICPR). pp. 2462-2469. IEEE (2021)
+
+16. Greydanus, S., Dzamba, M., Yosinski, J.: Hamiltonian neural networks. In: Advances in Neural Information Processing Systems (NeurIPS). pp. 15353-15363 (2019)
+17. Horn, B.K., Schunck, B.G.: Determining optical flow. Artificial intelligence 17(1-3), 185-203 (1981)
+18. Hui, T.W., Tang, X., Loy, C.C.: Liteflownet: A lightweight convolutional neural network for optical flow estimation. In: Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR). pp. 8981-8989 (2018)
+19. Hur, J., Roth, S.: Iterative residual refinement for joint optical flow and occlusion estimation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5754-5763 (2019)
+20. Ilg, E., Mayer, N., Saikia, T., Keuper, M., Dosovitskiy, A., Brox, T.: Flownet 2.0: Evolution of optical flow estimation with deep networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2462-2470 (2017)
+21. Janai, J., Guney, F., Ranjan, A., Black, M., Geiger, A.: Unsupervised learning of multi-frame optical flow with occlusions. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 690-706 (2018)
+22. Jason, J.Y., Harley, A.W., Derpanis, K.G.: Back to basics: Unsupervised learning of optical flow via brightness constancy and motion smoothness. In: European Conference on Computer Vision. pp. 3-10. Springer (2016)
+23. Jiang, S., Campbell, D., Lu, Y., Li, H., Hartley, R.: Learning to estimate hidden motions with global motion aggregation. CVPR (2021)
+24. Jonschkowski, R., Stone, A., Barron, J.T., Gordon, A., Konolige, K., Angelova, A.: What matters in unsupervised optical flow. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II 16. pp. 557-572. Springer (2020)
+25. Kondermann, D., Nair, R., Honauer, K., Krispin, K., Andrusis, J., Brock, A., Gussefeld, B., Rahimimoghaddam, M., Hofmann, S., Brenner, C., et al.: The hci benchmark suite: Stereo and flow ground truth with uncertainties for urban autonomous driving. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops. pp. 19-28 (2016)
+26. Lai, W.S., Huang, J.B., Yang, M.H.: Semi-supervised learning for optical flow with generative adversarial networks. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. pp. 353-363 (2017)
+27. Le Guen, V., Thome, N.: Disentangling physical dynamics from unknown factors for unsupervised video prediction. In: CVPR (2020)
+28. Li, Z., Kovachki, N., Azizzadenesheli, K., Liu, B., Bhattacharya, K., Stuart, A., Anandkumar, A.: Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.08895 (2020)
+29. Linial, O., Eytan, D., Shalit, U.: Generative ODE modeling with known unknowns. ICLR 2020 Deep Differential Equations Workshop (2020)
+30. Liu, L., Zhang, J., He, R., Liu, Y., Wang, Y., Tai, Y., Luo, D., Wang, C., Li, J., Huang, F.: Learning by analogy: Reliable supervision from transformations for unsupervised optical flow estimation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6489-6498 (2020)
+31. Liu, P., King, I., Lyu, M.R., Xu, J.: Ddflow: Learning optical flow with unlabeled data distillation. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 33, pp. 8770-8777 (2019)
+
+32. Liu, P., Lyu, M., King, I., Xu, J.: Selfflow: Self-supervised learning of optical flow. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4571-4580 (2019)
+33. Long, Y., She, X., Mukhopadhyay, S.: Hybridnet: integrating model-based and data-driven learning to predict evolution of dynamical systems. Conference on Robot Learning (CoRL) (2018)
+34. Lu, L., Jin, P., Karniadakis, G.E.: Deeponet: Learning nonlinear operators for identifying differential equations based on the universal approximation theorem of operators. arXiv preprint arXiv:1910.03193 (2019)
+35. Lucas, B.D., Kanade, T., et al.: An iterative image registration technique with an application to stereo vision. Vancouver, British Columbia (1981)
+36. Lutter, M., Ritter, C., Peters, J.: Deep lagrangian networks: Using physics as model prior for deep learning. arXiv preprint arXiv:1907.04490 (2019)
+37. Mayer, N., Ilg, E., Hausser, P., Fischer, P., Cremers, D., Dosovitskiy, A., Brox, T.: A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4040-4048 (2016)
+38. Mehta, V., Char, I., Neiswanger, W., Chung, Y., Schneider, J.: Neural dynamical systems. ICLR 2020 Deep Differential Equations Workshop (2020)
+39. Meister, S., Hur, J., Roth, S.: Unflow: Unsupervised learning of optical flow with a bidirectional census loss. In: Thirty-Second AAAI Conference on Artificial Intelligence (2018)
+40. Mémin, E., Pérez, P.: Dense estimation and object-based segmentation of the optical flow with robust techniques. IEEE Transactions on Image Processing 7(5), 703-719 (1998)
+41. Mohan, A.T., Lubbers, N., Livescu, D., Chertkov, M.: Embedding hard physical constraints in neural network coarse-graining of 3d turbulence. arXiv preprint arXiv:2002.00021 (2020)
+42. Psichogios, D.C., Ungar, L.H.: A hybrid neural network-first principles approach to process modeling. AIChE Journal 38(10), 1499-1511 (1992)
+43. Raissi, M.: Deep hidden physics models: Deep learning of nonlinear partial differential equations. The Journal of Machine Learning Research 19(1), 932-955 (2018)
+44. Ranjan, A., Black, M.J.: Optical flow estimation using a spatial pyramid network. In: Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR). pp. 4161-4170 (2017)
+45. Ren, Z., Yan, J., Ni, B., Liu, B., Yang, X., Zha, H.: Unsupervised deep learning for optical flow estimation. In: Thirty-First AAAI Conference on Artificial Intelligence (2017)
+46. Rico-Martinez, R., Anderson, J., Kevrekidis, I.: Continuous-time nonlinear signal processing: a neural network based approach for gray box identification. In: Proceedings of IEEE Workshop on Neural Networks for Signal Processing. pp. 596-605. IEEE (1994)
+47. Saha, P., Dash, S., Mukhopadhyay, S.: PHICNet: Physics-incorporated convolutional recurrent neural networks for modeling dynamical systems. arXiv preprint arXiv:2004.06243 (2020)
+48. Sirignano, J., Spiliopoulos, K.: Dgm: A deep learning algorithm for solving partial differential equations. Journal of computational physics 375, 1339-1364 (2018)
+49. Stone, A., Maurer, D., Ayvaci, A., Angelova, A., Jonschkowski, R.: Smurf: Self-teaching multi-frame unsupervised raft with full-image warping. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3887-3896 (2021)
+
+50. Sun, D., Vlasic, D., Herrmann, C., Jampani, V., Krainin, M., Chang, H., Zabih, R., Freeman, W.T., Liu, C.: Autoflow: Learning a better training set for optical flow. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10093-10102 (2021)
+51. Sun, D., Yang, X., Liu, M.Y., Kautz, J.: Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In: Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR). pp. 8934-8943 (2018)
+52. Sun, D., Yang, X., Liu, M.Y., Kautz, J.: Models matter, so does training: An empirical study of cnns for optical flow estimation. IEEE transactions on pattern analysis and machine intelligence 42(6), 1408-1423 (2019)
+53. Teed, Z., Deng, J.: RAFT: recurrent all-pairs field transforms for optical flow. In: European Conference on Computer Vision (ECCV) (2020)
+54. Thompson, M.L., Kramer, M.A.: Modeling chemical processes using prior knowledge and neural networks. AIChE Journal 40(8), 1328-1340 (1994)
+55. Wang, Q., Li, F., Tang, Y., Xu, Y.: Integrating model-driven and data-driven methods for power system frequency stability assessment and control. IEEE Transactions on Power Systems 34(6), 4557-4568 (2019)
+56. Wang, S., Wang, H., Perdikaris, P.: Learning the solution operator of parametric partial differential equations with physics-informed deeponets. arXiv preprint arXiv:2103.10974 (2021)
+57. Wang, Y., Yang, Y., Yang, Z., Zhao, L., Wang, P., Xu, W.: Occlusion aware unsupervised learning of optical flow. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4884-4893 (2018)
+58. Wedel, A., Cremers, D., Pock, T., Bischof, H.: Structure-and motion-adaptive regularization for high accuracy optic flow. In: 2009 IEEE 12th International Conference on Computer Vision. pp. 1663-1668. IEEE (2009)
+59. Xu, J., Ranftl, R., Koltun, V.: Accurate optical flow via direct cost volume processing. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1289-1297 (2017)
+60. Yan, W., Sharma, A., Tan, R.T.: Optical flow in dense foggy scenes using semi-supervised learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13259-13268 (2020)
+61. Yang, G., Ramanan, D.: Volumetric correspondence networks for optical flow. Advances in neural information processing systems 32, 794-805 (2019)
+62. Yin, Y., Le Guen, V., Dona, J., Ayed, I., de Bezenac, E., Thome, N., Gallinari, P.: Augmenting physical models with deep networks for complex dynamics forecasting. In: Ninth International Conference on Learning Representations ICLR 2021 (2021)
+63. Zhao, S., Sheng, Y., Dong, Y., Chang, E.I., Xu, Y., et al.: Maskflownet: Asymmetric feature matching with learnable occlusion mask. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6278-6287 (2020)
\ No newline at end of file
diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/images.zip b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..142f81828d45ab1615f6c238e97d340653613c70
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d17e1746100610b0af1fbea89a74e046675e86a02e3427ad1f44ace36e1122d6
+size 464145
diff --git a/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/layout.json b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..45489743baf97e9688418f870e27a551f125dd6a
--- /dev/null
+++ b/complementingbrightnessconstancywithdeepnetworksforopticalflowprediction/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e97b91074191ff3f884a933980fd0c61804f1fef5d3649f9005b8531f2199035
+size 547474
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_content_list.json b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..48217c9fbd9e20a0b2f602dee191763c1108dc6c
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:164e1b3268e8f31ffd586dd7cf2c8808a4a0a8749ce6c44893ac95960ba8a2ce
+size 77219
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_model.json b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4adb00cee5f9f2a8629c879b1186f010b6e08269
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb27c1748f6bb16d3bed95da2d3b246abdcd82b56d2fdc01c69b63fb27387574
+size 99097
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_origin.pdf b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..be6548684f28f7d1ce93df297f113447fbee1d49
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/19c72cef-4d5f-4ad1-83af-c52baa8e74df_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98d7d9e706cbcff45dd6079a00a46d14d95212b27654805e1aedfdea1bc0e5a0
+size 2766287
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/full.md b/completelyselfsupervisedcrowdcountingviadistributionmatching/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..39869694fc06c87a9ff135d4ab02388670196930
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/full.md
@@ -0,0 +1,257 @@
+# Completely Self-Supervised Crowd Counting via Distribution Matching
+
+Deepak Babu Sam\*, Abhinav Agarwalla\*, Jimmy Joseph, Vishwanath A. Sindagi, R. Venkatesh Babu, and Vishal M. Patel
+
+$^{1}$ Indian Institute of Science, Bangalore 560012, India
+ $^{2}$ Johns Hopkins University, Baltimore MD 21218, USA
+{deepaksam,venky}@iisc.ac.in, {agarwallaabhinav,jimmyj005}@gmail.com, {vishwanathsindagi,vpatel36}@jhu.edu
+
+Abstract. Dense crowd counting is a challenging task that demands millions of head annotations for training models. Though existing self-supervised approaches could learn good representations, they require some labeled data to map these features to the end task of density estimation. We mitigate this issue with the proposed paradigm of complete self-supervision, which does not need even a single labeled image. The only input required to train, apart from a large set of unlabeled crowd images, is the approximate upper limit of the crowd count for the given dataset. Our method dwells on the idea that natural crowds follow a power law distribution, which could be leveraged to yield error signals for backpropagation. A density regressor is first pretrained with self-supervision and then the distribution of predictions is matched to the prior. Experiments show that this results in effective learning of crowd features and delivers significant counting performance.
+
+Keywords: Self-supervision, unsupervised learning, crowd counting
+
+# 1 Introduction
+
+The ability to estimate head counts of dense crowds effectively and efficiently serves several practical applications. This has motivated deeper research in the field and resulted in a plethora of crowd density regressors. These CNN based models deliver excellent counting performance almost entirely on the support of fully supervised training. Such a data hungry paradigm is limiting the further development of the field as it is practically infeasible to annotate thousands of people in dense crowds for every kind of setting under consideration. The fact that current datasets are relatively small and cover only limited scenarios, accentuates the necessity of a better training regime. Hence, developing methods to leverage the easily available unlabeled data has gained attention recently.
+
+The classic way of performing unsupervised learning revolves around autoencoders [18, 26, 40, 57]. Autoencoders or its variants are optimized to predict back
+
+
+Fig. 1. Though self-supervision methods learn features in an unsupervised manner (in orange), they require labeled training to map these features to the end task (in blue). But complete self-supervision is devoid of any such instance-level supervision, instead relies on matching the statistics of the predictions to a prior distribution (in green).
+
+their inputs, usually through a representational bottleneck. By doing so, the acquired features are generic enough that they could be employed for solving other tasks of interest. These methods have graduated to the more recent framework of self-supervision, where useful representations are learned by performing some alternate task for which pseudo labels can be easily obtained. For example, in self-supervision with colorization approach [28, 29, 70], a model is trained to predict the color image given its grayscale version. One can easily generate grayscale inputs from RGB images. Similarly, there are lots of tasks for which labels are freely available like predicting angle of rotation from an image [14, 15], solving jumbled scenes [44], inpainting [47] etc. Though self-supervision is effective in learning useful representations, they require a final mapping from the features to the end task of interest. This is thought to be essentially unavoidable as some supervisory signal is necessary to aid the final task. For this, typically a linear layer or a classifier is trained on top of the learned features using supervision from labeled data, defeating the true purpose of self-supervision. In the case of crowd counting, one requires training with annotated data for converting the features to a density map. To reiterate, the current unsupervised approaches could capture the majority of its features from unlabeled data, but demand supervision at the end for them to be made useful for any practical applications.
+
+Our work emerges precisely from the above limitation of the standard self-supervision methods, but narrowed down to the case of crowd density estimation. The objective is to eliminate the mandatory final labeled supervision needed for mapping the learned self-supervised features to a density map output. In other words, we mandate developing a model that can be trained without using any labeled data. Such a problem statement is not only challenging, but also ill-posed. Without providing a supervisory signal, the model cannot recognize the task of interest and how to properly guide the training stands as the prime issue.
+
+We solve this in a novel manner by carefully aiding the model to regress crowd density on the back of making some crucial assumptions. The idea relies on the observation that natural crowds tend to follow certain long tailed statistics and could be approximated to an appropriate parametric prior distribution. If a network trained with a self-supervised task is available, its features can be faithfully mapped to crowd density by enforcing the predictions to match the prior distribution. The matching is measured in terms of Sinkhorn distance [12], which is differentiated to derive error signals for supervision. This proposed framework is contrasted against the normal self-supervision regime in Figure 1, with the central difference being the replacement of the essential labeled training at the end by supervision through distribution matching. We show that the proposed approach results in effective learning of crowd features and delivers good performance in terms of counting metrics.
+
+# 2 Related Work
+
+Though there are earlier works like [9] on counting people in sparse crowds, the paradigm of dense crowd counting via density regression plausibly begins with [19]. The initial methods generally employ hand-crafted features and frequency analysis for counting. With the advent of deep learning, many CNN based density regressors have emerged. It ranges from the initial simple models [67] to multi-network/multi-scale architectures designed specifically to address the drastic diversity in crowd images [5, 7, 8, 45, 71]. Regressors with better, deeper and recurrent based deep models [24, 30, 32] are shown to improve counting performance. An alternate line of works enhance density regression by providing auxiliary information through crowd classification [51, 52], scene context [2, 10, 36], perspective data [49, 64], attention [35, 65, 66] and even semantic priors [59]. Models designed to progressively predict density maps and perform refinement is explored in [20, 48, 54]. Works like [34, 53] effectively fuse multiscale information. Some approaches try to bring flavors of detection to crowd counting [3, 4, 31, 33, 38]. Interestingly, all these works, including more recent ones [39, 58, 60, 61], are fully supervised and leverage annotated data to achieve good performance. The issue of annotation has drawn attention of a few works in the field and is mitigated via multiple means. A count ranking loss on unlabeled images is employed in a multi-task formulation along with labeled data by [37]. Wang et al. [62] train using labeled synthetic data and adapt to real crowd scenario. The autoencoder method proposed in [6] optimizes almost $99\%$ of the model parameters with unlabeled data. However, all of these models require some annotated data (either given by humans or obtained through synthetic means) for training.
+
+Our approach is not only new to crowd counting, but also kindles alternate avenues in the area of unsupervised learning as well. Though initial works on the subject employ autoencoders or its variants [18, 26, 40, 57] for learning useful features, the paradigm of self-supervision with pseudo labels stands out to be superior in many aspects. Works like [28, 29, 70], learn representa
+
+
+Fig. 2. Computing the distribution of natural crowds: crops from dense crowd images are framed to a spatial grid of cells and crowd counts of all the cells are aggregated to a histogram (obtained on Shanghaitech Part_A dataset [71]). The distribution is certainly long tailed and could be approximated to a power law.
+
+tions through colorizing a grayscale image. Apart from these, pseudo labels for supervision are computed from motion cues [1, 22, 46], temporal information in videos [41, 63], learning to inpaint [47], co-occurrence [21], spatial context [13, 43, 44], cross-channel prediction [69], spotting artifacts [23], predicting object rotation [14, 15] etc. The recent work of Zhang et al. [68] introduce the idea of auto-encoding transformations rather than data. Furthermore, self-supervision is shown effective for unsupervised domain adaptation in [56]. An extensive and rigorous comparison of all major self-supervised methods is available in [27]. All these approaches focus on learning generic features and not the final task. But we extend self-supervision paradigm directly to the downstream task of interest.
+
+# 3 Our Approach
+
+# 3.1 Natural Crowds and Density Distribution
+
+As mentioned in Section 1, our objective of training a density regressor without using any annotated data is somewhat ill-posed. The main reason being the absence of any supervisory signal to guide the model towards the task of interest, which is the density estimation of crowd images. But this issue could be circumvented by effectively exploiting certain structure or pattern specific to the problem. In the case of crowd images, restricting to only dense ones, we deduce an interesting pattern on the density distribution. They seem to spread out following a power law. To see this, we sample fixed size crops from lots of dense crowd images and divide each crop into a grid of cells as shown in Figure 2. Then the number people in every cell is computed and accumulated to a histogram. The distribution of these cell counts is quite clearly seen to be long tailed, with regions having low counts forming the head and high counts joining the tail. The number of cell regions with no people has the highest frequency, which then rapidly decays as the crowd density increases. This resembles the
+
+way natural crowds are arranged with sparse regions occurring more often than rarely forming highly dense neighborhoods. Coincidentally, it has been shown that many natural phenomena obey a similar power law and is being studied heavily [11]. The dense crowds also appear conforming to this pattern as evident from multiple works [16, 17, 25, 42] etc. on the dynamics of pedestrian gatherings.
+
+Moving to a more formal description, if $\pmb{D}$ represents the density map for the input image $\pmb{I}$ , then the crowd count is given by $C = \sum_{xy} D_{xy}$ (please refer [7, 19, 71] regarding creation of density maps). $\pmb{D}$ is framed into a grid of $M \times N$ (typically set as $M = N = 3$ ) cells, with $C_{mn}$ denoting the crowd count in the cell indexed by $(m, n)$ . Now let $H^{GT}$ be the histogram computed by collecting the cell counts $(C_{mn})$ from all the images. We try to find a parametric distribution that approximately follows $H^{GT}$ with special focus to the long tailed region. The power law with exponential cut-off seems to be better suited (see Figure 2). Consequently, the crowd counts in cells $C_{mn}$ could be thought as being generated by the following relation,
+
+$$
+C _ {m n} \sim P _ {\text {p r i o r}} (\mathrm {c}) \propto c ^ {\alpha} \exp (- \lambda c), \tag {1}
+$$
+
+where $P_{prior}$ is the substitute power law distribution. There are two parameters to $P_{prior}$ with $\alpha$ controlling the shape and $\lambda$ setting the tail length.
+
+Our approach is to fix a prior distribution so that it can be enforced on the model predictions. Studies like [16, 42] simulate crowd behaviour dynamics and estimate the exponent of the power law to be around 2. Empirically, we also find that $\alpha = 2$ works in most cases of dense crowds, with the only remaining parameter to fix is the $\lambda$ . Observe that $\lambda$ affects the length of the tail and directly determines the maximum number of people in any given cell. If the maximum count $C^{max}$ is specified for the given set of crowd images, then $\lambda$ could be fixed such that the cumulative probability density (the value of CDF) of $P_{prior}$ at $C^{max}$ is very close to 1. We assume $1 / S$ as the probability of finding a cell with count $C^{max}$ out of $S$ images in the given set. Now the CDF value at $C^{max}$ could be set to $1 - 1 / S$ , simply the probability for getting values less than the maximum. Note that $C^{max}$ need not be exact as small variations do not change $P_{prior}$ significantly. This makes it practical as the accurate maximum count might not be available in real-world scenarios. Since $C^{max}$ is for the cells, the maximum crowd count of the full image $C^{fmax}$ is related as $C^{max} = C^{fmax} / (MNS_{crop})$ , where $S_{crop}$ denotes the average number of crops that make up a full image (and is typically set as 4). Thus, for a given a set of highly dense images, only one parameter, the $C^{fmax}$ is required to fix an appropriate prior distribution.
+
+We make a small modification to the prior distribution $P_{prior}$ as its value range starts from 1. $H^{GT}$ has values from zero with large probability mass concentrated near the low count region. Roughly $30\%$ of the mass is seen to be distributed for counts less than or around 1. So, that much probability mass near the head region of $P_{prior}$ is redistributed to [0,1] range in a uniform manner. This is found to be better for both training stability and performance.
+
+In short, now we have a prior distribution representing how the crowd density is being allocated among the given set of images. Suppose there exists a CNN
+
+
+STAGE 1: SELF-SUPERVISION
+
+
+STAGE 2: SINKHORN TRAINING
+Fig. 3. The architecture of CSS-CCNN is shown. CSS-CCNN has two stages of training: the first trains the base feature extraction network in a self-supervised manner with rotation task and the second stage optimizes the model for matching the statistics of the density predictions to that of the prior distribution using optimal transport.
+
+model that can output density maps, then one could try to generate error signals for updating the parameters of the model by matching the statistics of the predictions with that of the prior. But that could be a very weak signal for proper training of the model. It would be helpful if the model has a good initialization to start the supervision by distribution matching, which is precisely what we do by self-supervision in the next section.
+
+# 3.2 Stage 1: Learning Features with Self-Supervision
+
+We rely on training the model with self-supervision to learn effective and generic features that could be useful for the end task of density estimation. That means the model has to be trained in stages, with the first stage acquiring patterns frequently occurring in the input images. Since only dense crowd images are fed, we hope to learn mostly features relevant to crowds. These could be peculiar edges discriminating head-shoulder patterns formed by people to fairly high-level semantics pertaining to crowds. Note that the model is not signaled to pick up representations explicitly pertinent to density estimation, but implicitly culminate in learning crowd patterns as those are the most prominent part of the input data distribution. Hence, the features acquired by self-supervision could serve as a faithful initialization for the second stage of distribution matching.
+
+Regarding self-supervision, there are numerous ways to generate pseudo labels for training models. The task of predicting image rotations is a simple, but highly effective for learning good representations [27]. The basic idea is to randomly rotate an image and train the model to predict the angle of rotation. By doing so, the network learns to detect characteristic edges or even fairly high-level patterns of the objects relevant for determining the orientation. These features are observed to be generic enough for diverse downstream tasks [27] and hence we choose self-supervision through rotation as our method.
+
+Figure 3 shows the architecture of our density regressor, named the CSS-CCNN (for Completely Self-Supervised Counting CNN). It has a base Feature Extraction Network (FEN), which is composed of three VGG [50] style convolutional blocks with max poolings in-between. This is followed by two task heads: $C_1$ for the first training stage of self-supervision, and $C_2$ for regressing crowd density at second stage. The first stage branch has two more convolutions and a fully connected layer to finally classify the input image to one of the rotation classes. We take $112 \times 112$ crops from crowd images and randomly rotate the crop by one of the four predefined angles (0, 90, 180, 270 degrees). The model is trained with cross-entropy loss between the predicted and the actual rotation labels. The optimization runs till saturation as evaluated on a validation set.
+
+Once the training is complete, the FEN has learned useful features for density estimation and the rotation classification head is removed. Now the parameters of FEN are frozen and is ready to be used in the second stage of training.
+
+# 3.3 Stage 2: Sinkhorn Training
+
+After the self-supervised training stage, FEN is extended to a density regressor by adding two convolutional layers as shown in Figure 3. We take features from both second and third convolution blocks for effectively mapping to crowd density. This aggregates features from slightly different receptive fields and is seen to deliver better performance. The layers of FEN are frozen and only a few parameters in the freshly added layers are open for training in the second stage of distribution matching. This particularly helps to prevent over-fitting as the training signal generated could be weak for updating large number of parameters. Now we describe the details of the exact matching process.
+
+The core idea is to compute the distribution of crowd density predicted by CSS-CCNN and optimize the network to match that closely with the prior $P_{prior}$ . For this, a suitable distance metric between the two distributions should be defined with differentiability as a key necessity. Note that the predicted distribution is in the form of an empirical measure (an array of cell count values) and hence it is difficult to formulate an easy analytical expression for the computing similarity. The classic Earth Mover's Distance (EMD) measures the amount of probability mass that needs to be moved if one tries to transform between the distributions (also described as the optimal transport cost). But this is not a differentiable operation and cannot be used directly in our case. Hence, we choose the Sinkhorn distance formulation proposed in [12]. Sinkhorn distance between two empirical measures is proven to be an upper bound for EMD and
+
+has a differentiable implementation. Moreover, this method performs favorable in terms of efficiency and speed as well.
+
+Let $D^{CS}$ represent the density map output by CSS-CCNN and $C^{CS}$ hold the cells extracted from the predictions. To make the distribution matching statistically significant, a batch of images are evaluated to get the cell counts $(C_{mn}^{CS}\mathrm{s})$ , which are then formed into an array $H^{CS}$ . We also sample the prior $P_{prior}$ and create another empirical measure $H^{GT}$ to act as the ground truth. Now the Sinkhorn loss $\mathcal{L}_{sink}$ is computed between $H^{GT}$ and $H^{CS}$ . It is basically a regularized version of optimal transport (OT) distance for the two sample sets. Designate $h^{GT}$ and $h^{CS}$ as the probability vectors (summing to 1) associated with the empirical measures $H^{GT}$ and $H^{CS}$ respectively. Now a transport plan $P$ could be conceived as the joint likelihood of shifting the probability mass from $h^{GT}$ to $h^{CS}$ . Define $U$ to be the set of all such valid candidate plans as,
+
+$$
+\boldsymbol {U} = \left\{\boldsymbol {P} \in \mathbb {R} _ {+} ^ {d \times d} \mid \boldsymbol {P} \mathbf {1} = \boldsymbol {h} ^ {G T}, \boldsymbol {P} ^ {T} \mathbf {1} = \boldsymbol {h} ^ {C S} \right\}. \tag {2}
+$$
+
+There is a cost $M$ associated with any given transport plan, where $M_{ij}$ is the squared difference between the counts of $i$ th sample of $H^{GT}$ and $j$ th of $H^{CS}$ . Closer the two distribution, lower would be the cost for transport. Hence, the Sinkhorn loss $\mathcal{L}_{sink}$ is defined as the cost pertinent to the optimal transportation plan with an additional regularization term. Mathematically,
+
+$$
+\mathcal {L} _ {\text {s i n k}} \left(H ^ {G T}, H ^ {C S}\right) = \underset {\boldsymbol {P} \in \boldsymbol {U}} {\arg \min } \langle \boldsymbol {P}, \boldsymbol {M} \rangle_ {F} - \frac {1}{\beta} E (\boldsymbol {P}), \tag {3}
+$$
+
+where $\langle >>_F$ stands for the Frobenius inner product, $E(P)$ is the entropy of the joint distribution $P$ and $\beta$ is a regularization constant (see [12] for more details). It is evident that minimizing $\mathcal{L}_{sink}$ brings the two distributions closer in terms of how counts are allotted.
+
+The network parameters are updated to optimize $\mathcal{L}_{sink}$ , thereby bringing the distribution of predictions close to that of the prior. At every iteration of the training, a batch of crowd images are sampled from the dataset and empirical measures for the predictions as well as prior are constructed to backpropagate the Sinkhorn loss. The value of $\mathcal{L}_{sink}$ on a validation set of images is monitored for convergence and the training is stopped if the average loss does not improve over a certain number of epochs. Note that we do not use any annotated data even for validation. The counting performance is evaluated at the end with the model chosen based on the best mean validation Sinkhorn loss.
+
+Thus, our Sinkhorn training procedure does not rely on instance-level supervision, but exploits matching the statistics computed from a set of inputs to that of the prior. One criticism regarding this method could be that the model need not learn the task of crowd density estimation by optimizing the Sinkhorn loss. It could learn any other arbitrary task that follows a similar distribution. The counter-argument stems from the semantics of the features learned by the base network. Since the initial training mostly captures features related to dense crowds, the Sinkhorn optimization has only limited flexibility in what it can do other than map them through a fairly simple function to crowd density. This
+
+
+Fig. 4. Density maps estimated by CSS-CCNN along with that of baseline methods. Despite being trained without a single annotated image, CSS-CCNN is seen to be quite good at discriminating the crowd regions as well as regressing the density values.
+
+is especially true as there is only a small set of parameters being trained with Sinkhorn. It is highly likely and straightforward to map the frequent crowd features to its density values, whose distribution is signaled through the prior. Moreover, we show through extensive experiments that CSS-CCNN ends up learning crowd density estimation.
+
+# 4 Experiments and Analysis
+
+Any crowd density regressor is evaluated mainly for the standard counting metrics. There are two metrics widely being followed by the community. The first is the MAE or Mean Absolute Error, which directly measures the counting performance. It is the absolute difference of the predicted and actual counts averaged over the test set or simply expressed as MAE = $(1 / S_{test})\sum_{i = 1}^{N}|C_i - C_i^{GT}|$ , where $C_i$ is the count predicted by the model for $i$ th image and $C_i^{GT}$ denotes the actual count. Note that $S_{test}$ is the number of images in the test set. Coming to the second metric, the Mean Squared Error or MSE is defined as
+
+Table 1. Performance comparison of CSS-CCNN with other methods. Our model outperforms all the baselines.
+
+| Method | ST PartA | UCF-QNRF | UCF-CC-50 | JHU-CRWD |
| MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE |
| WTA-CCNN [6] | 154.7 | 229.4 | - | - | 433.7 | 583.3 | - | - |
| CCNN Self-Super | 121.2 | 197.5 | 196.8 | 309.3 | 348.8 | 484.3 | 147.5 | 436.2 |
| CCNN Random | 431.1 | 559.0 | 718.7 | 1036.3 | 1279.3 | 1567.9 | 320.3 | 793.5 |
| CCNN Mean | 282.8 | 359.9 | 567.1 | 752.8 | 771.2 | 898.4 | 316.3 | 732.3 |
| CCNN P prior | 272.2 | 372.5 | 535.6 | 765.9 | 760.0 | 949.9 | 302.3 | 707.6 |
| CSS-CCNN (0 labels) | 197.3 | 295.9 | 437.0 | 722.3 | 564.9 | 959.4 | 217.6 | 651.3 |
+
+MSE = SQRT((1/Stest) ∑i=1N (Ci - CiGT)2), a measure of the variance of count estimation and it represents the robustness of the model.
+
+Our completely self-supervised framework is unique in many ways that the baseline comparisons should be different from the typical supervised methods. It is not fair to compare CSS-CCNN with other approaches as they use the full annotated data for training. Hence, we take a set of solid baselines for our model to demonstrate its performance. The CCNN Random experiment refers to the results one would get if only Stage 1 self-supervision is done without the subsequent Sinkhorn training. This is the random accuracy for our setting and helpful in showing whether the proposed complete self-supervision works. Since our approach takes one parameter, the maximum count value of the dataset $(C^{fmax})$ as input, CCNN Mean baseline indicates the counting performance if the regressor blindly predicts the given value for all the images. We choose mean value as it makes for sense in this setting than the maximum (which anyway has worse performance than mean). Another important validation for our proposed paradigm is the CCNN $P_{prior}$ experiment, where the model gives out a value randomly drawn from the prior distribution as its prediction for a given image. The counting performance of this baseline tells us with certainty whether the Stage 2 training does anything more than that by chance. Note that we do not initialize CCNN with any pretrained weights as is typically done for supervised counting models. CCNN Self-Super runs the Stage 1 training to learn the FEN parameters and is followed by labeled optimization for updating the regressor layers. These self-supervised or fully supervised methods are not directly comparable to our approach as we do not use any annotated data for training, but are shown for completeness. Also note that only the train/validation set images are used for optimizing CSS-CCNN and the ground truth annotations are never used. The counting metrics are computed on the labeled test set.
+
+# 4.1 Crowd Datasets
+
+The Shanghaiitech Part_A [71] is a popular dense crowd counting dataset, containing 482 images randomly crawled from the Internet. It has images with crowd counts as low as 33 to as high as 3139, with an average of 501. The train set has
+
+
+Fig. 5. Comparing our completely self-supervised method to fully supervised and self-supervised approaches under a limited amount of labeled training data. The x-axis denotes the number of training images along with the count (in thousands) of head annotations available for training, while the y-axis represents the MAE thus obtained. At low data scenarios, CSS-CCNN has significantly superior performance.
+
+
+
+300 images, out of which $10\%$ is held out for validation. There are 182 images testing. The hyper-parameter used for this is $C^{fmax} = 3000$ . We compare the performance of CSS-CCNN with the baselines listed earlier and other competing methods in Table 1. It is clear that CSS-CCNN outperforms all the baselines by a significant margin. This shows that the proposed method works better than any naive strategies that do not consider the input images. Figure 4 visually compares density predictions made by CSS-CCNN and other models. The predictions of our approach are mostly on crowd regions and closely follows the ground truth, emphasizing its ability to discriminate crowds well.
+
+UCF-QNRF dataset [20] is a large and diverse collection of crowd images with 1.2 million annotations. There are 1535 images with crowd count varying from 49 to 12865, resulting in an average of 815 individuals per image. The dataset offers very high-resolution images with an average resolution of $2013 \times 2902$ . The max count hyper-parameter is set to $C^{fmax} = 12000$ . We achieve similar performance trends on UCF-QNRF dataset as well. CSS-CCNN outperforms all the unsupervised baselines in terms of MAE and MSE as evident from Table 1.
+
+UCF_CC_50 dataset [19] has just 50 images with extreme variation in crowd density ranging from 94 to 4543. The small size and diversity together makes this dataset the most challenging. We follow the standard 5-fold cross-validation scheme suggested by the creators of the dataset to report the performance metrics. Since the number of images is quite small, the assumption taken for setting the prior distribution gets invalid to certain extent. But a slightly different parameter to the prior distribution works. We set $\alpha = 1$ and $C^{fmax} = 4000$ . Despite being a small and highly diverse dataset, CSS-CCNN is able to beat all the baselines. The self-supervised MAE is also better than [6]. These results evidence the effectiveness of our method.
+
+Table 2. Evaluating CSS-CCNN in a true practical setting: the model is trained on images crawled from the web, but evaluated on crowd datasets.
+
+| Train on web images | MAE | MSE |
| Test on ST_PartA | 208.8 | 309.5 |
| Test on UCF-QNRF | 450.7 | 755.9 |
| Test on JHU-CROWD++ | 241.2 | 706.8 |
+
+JHU-CROWD++ [54, 55] is a comprehensive dataset with 1.51 million head annotations spanning 4372 images. The crowd scenes are obtained under various scenarios and weather conditions, making it one of the challenging dataset in terms of diversity. Furthermore, JHU-CROWD++ has a richer set of annotations at head level as well as image level. The maximum count is fixed to $C^{f_{max}} = 8000$ . The performance trends are quite similar to other datasets, with our approach delivering better MAE than the baselines as evident from Table 1. This indicates the generalization ability of CSS-CCNN across different datasets.
+
+# 4.2 Performance with Limited Data
+
+Here we explore the proposed algorithm along with fully supervised and self-supervised approaches when few annotated images are available for training. The analysis is performed by varying the number of labeled samples and the resultant counting metrics are presented in Figure 5. For training CSS-CCNN with data, we utilise the available annotated data to compute the optimal Sinkhorn assignments $P^{*}$ and then optimize the $\mathcal{L}_{sink}$ loss. This way both the labeled as well as unlabeled data can be leveraged for training by alternating respective batches (in a 5:1 ratio). It is clear that, at very low data, scenarios CSS-CCNN beats the supervised as well as self-supervised baselines by a significant margin. The Sinkhorn training shows $13\%$ boost in MAE (for Shanghaiitech Part_A) by using just one labeled sample as opposed to no samples. This indicates that CSS-CCNN can perform well in extremely low data regimes. It takes about 20K head annotations for the supervised model to perform as well as CSS-CCNN. Also, CSS-CCNN has significantly less number of parameters to learn using the labeled samples as compared to a fully supervised network. These results suggests that our complete self-supervision is the right paradigm to employ for crowd counting when the amount of available annotated data is less.
+
+# 4.3 CSS-CCNN in True Practical Setting
+
+The complete self-supervised setting is motivated for scenarios where no labeled images are available for training. But till now we have been using images from crowd datasets with the annotations being intentionally ignored. Now consider crawling lots of crowd images from the Internet and employing these unlabeled data for training CSS-CCNN. For this, we use textual tags related to dense
+
+
+Fig. 6. Double logarithmic representation of maximum likelihood fit for the crowd counts from different datasets.
+
+
+
+crowds and similarity matching with dataset images to collect approximately 5000 dense crowd images. No manual pruning of undesirable images with motion blur, perspective distortion or other artifacts is done. CSS-CCNN is trained on these images with the same hyper-parameters as that of Shanghaitech Part_A and the performance metrics are computed on the datasets with annotations. From Table 2, it is evident that our model achieves very competitive MAE on the crowd datasets (compared to Table 1), despite not using images from those datasets for training. This further demonstrates the generalization ability of CSS-CCNN to learn from less curated data, emphasizing the practical utility.
+
+# 4.4 Analysis of the Prior Distribution
+
+The proposed Sinkhorn training requires a prior distribution of crowd counts to be defined and the choice of an appropriate prior is essential for the best model performance as seen from Table 3. Here we analyze the crowd data more carefully to see why the truncated power law is the right choice of prior. For this, the counts from crowd images are extracted as described in Section 3.1 and a maximum likelihood fit over various parametric distributions is performed. The double logarithmic visualization of the probability distribution of both the data and the priors are available in Figure 6. Note that the data curve is almost a straight line in the logarithmic plot, a clear marker for power law characteristic. Both truncated power law and lognormal tightly follow the distribution. But on close inspection of the tail regions, we find truncated power law to best represent the prior. This further validates our choice of the prior distribution.
+
+# 4.5 Sensitivity Analysis for the Crowd Parameter
+
+As described in Section 3.1, CSS-CCNN requires the maximum crowd count $(C^{fmax})$ for the given set of images as an input. This is necessary to fix the prior distribution parameter $\lambda$ . One might not have the exact max value for
+
+Table 3. Ablating the effect of hyper-parameters on CSS-CCNN. Our model is robust to fairly large change in the maximum count parameter.
+
+| Param | MAE | MSE |
| Uniform Prior | 261.8 | 406.0 |
| Pareto Prior | 248.3 | 386.2 |
| Lognormal Prior | 239.5 | 345.8 |
| Truncated Power Law Prior | 197.3 | 295.9 |
| Cfmax= 2000 | 204.2 | 316.4 |
| Cfmax= 2500 | 197.9 | 304.6 |
| Cfmax= 3000 | 197.3 | 295.9 |
| Cfmax= 3500 | 191.9 | 288.5 |
| α = 1.9 | 202.9 | 303.3 |
| α = 2.0 | 197.3 | 295.9 |
| α = 2.1 | 200.7 | 305.6 |
+
+the crowds in a true practical setting; an approximate estimate is a more reasonable assumption. Hence, we vary $C^{fmax}$ around the actual value and train CSS-CCNN on Shanghaitech PartA [71] and UCF-QNRF[20]. The performance metrics in Table 3 show that changing $C^{fmax}$ to certain extent does not alter the performance significantly. The MAE remained roughly within the same range, even though the max parameter is being changed in the order of 500. These findings indicate that the our approach is insensitive to the exact crowd hyperparameter value, increasing its practical utility. We also check the sensitivity of our approach on the power law exponent $\alpha$ . Varying $\alpha$ around 2 results in similar performances, in agreement with our design choices (see Section 3.1).
+
+# 5 Conclusions
+
+We show for the first time that a density regressor can be fully trained from scratch without using a single annotated image. This new paradigm of complete self-supervision relies on optimizing the model by matching the statistics of the distribution of predictions to that of a predefined prior. Though the counting performance of the model stands better than other baselines, there is a performance gap compared to fully supervised methods. Addressing this issue could be the prime focus of future works. For now, our work can be considered as a proof of concept that models could be trained directly for solving the downstream task of interest, without providing any instance-level labeled data.
+
+# 6 Acknowledgments
+
+This work was supported by MeitY (Ministry of Electronics and Information Technology) project (No. 4(16)2019-ITEA), Govt. of India. VMP was supported by an ARO grant W911NF-21-1-0135.
+
+# Bibliography
+
+[1] Agrawal, P., Carreira, J., Malik, J.: Learning to see by moving. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2015)
+[2] Babu Sam, D., Babu, R.V.: Top-down feedback for crowd counting convolutional neural network. In: Proceedings of the AAAI Conference on Artificial Intelligence (2018)
+[3] Babu Sam, D., Peri, S.V., Sundararaman, M.N., Babu, R.V.: Going beyond the regression paradigm with accurate dot prediction for dense crowds. In: Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV) (2020)
+[4] Babu Sam, D., Peri, S.V., Sundararaman, M.N., Kamath, A., Babu, R.V.: Locate, size and count: Accurately resolving people in dense crowds via detection. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) (2020)
+[5] Babu Sam, D., Sajjan, N.N., Babu, R.V., Srinivasan, M.: Divide and grow: Capturing huge diversity in crowd images with incrementally growing CNN. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+[6] Babu Sam, D., Sajjan, N.N., Maurya, H., Babu, R.V.: Almost unsupervised learning for dense crowd counting. In: Proceedings of the AAAI Conference on Artificial Intelligence (2019)
+[7] Babu Sam, D., Surya, S., Babu, R.V.: Switching convolutional neural network for crowd counting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017)
+[8] Cao, X., Wang, Z., Zhao, Y., Su, F.: Scale aggregation network for accurate and efficient crowd counting. In: Proceedings of the European Conference on Computer Vision (ECCV) (2018)
+[9] Chan, A.B., Liang, Z.S.J., Vasconcelos, N.: Privacy preserving crowd monitoring: Counting people without people models or tracking. In: IEEE Conference on Computer Vision and Pattern Recognition (2008)
+[10] Cheng, Z.Q., Li, J.X., Dai, Q., Wu, X., Hauptmann, A.G.: Learning spatial awareness to improve crowd counting. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[11] Clauset, A., Shalizi, C.R., Newman, M.E.: Power-law distributions in empirical data. SIAM review (2009)
+[12] Cuturi, M.: Sinkhorn distances: Lightspeed computation of optimal transport. In: Advances in Neural Information Processing Systems (NIPS) (2013)
+[13] Doersch, C., Gupta, A., Efros, A.A.: Unsupervised visual representation learning by context prediction. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2015)
+
+[14] Feng, Z., Xu, C., Tao, D.: Self-supervised representation learning by rotation feature decoupling. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[15] Gidaris, S., Singh, P., Komodakis, N.: Unsupervised representation learning by predicting image rotations. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+[16] Helbing, D., Johansson, A., Al-Abideen, H.Z.: Dynamics of crowd disasters: An empirical study. Physical review E (2007)
+[17] Helbing, D., Kühnert, C., Lämmer, S., Johansson, A., Gehlsen, B., Ammoser, H., West, G.B.: Power laws in urban supply networks, social systems, and dense pedestrian crowds. In: Complexity Perspectives in Innovation and Social Change, pp. 433-450. Springer (2009)
+[18] Hinton, G.E., Salakhutdinov, R.R.: Reducing the dimensionality of data with neural networks. Science (2006)
+[19] Idrees, H., Saleemi, I., Seibert, C., Shah, M.: Multi-source multi-scale counting in extremely dense crowd images. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2013)
+[20] Idrees, H., Tayyab, M., Athrey, K., Zhang, D., Al-Maadeed, S., Rajpoot, N., Shah, M.: Composition loss for counting, density map estimation and localization in dense crowds. In: Proceedings of the European Conference on Computer Vision (ECCV) (2018)
+[21] Isola, P., Zoran, D., Krishnan, D., Adelson, E.H.: Learning visual groups from co-occurrences in space and time. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016)
+[22] Jayaraman, D., Grauman, K.: Learning image representations tied to egomotion. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2015)
+[23] Jenni, S., Favaro, P.: Self-supervised feature learning by learning to spot artifacts. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+[24] Jiang, X., Xiao, Z., Zhang, B., Zhen, X., Cao, X., Doermann, D., Shao, L.: Crowd counting and density estimation by trellis encoder-decoder networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[25] Karamouzas, I., Skinner, B., Guy, S.J.: A universal power law governing pedestrian interactions. APS (2015)
+[26] Kingma, D.P., Welling, M.: Auto-encoding variational bayes. In: Proceedings of the International Conference on Learning Representations (ICLR) (2013)
+[27] Kolesnikov, A., Zhai, X., Beyer, L.: Revisiting self-supervised visual representation learning. In: Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[28] Larsson, G., Maire, M., Shakhnarovich, G.: Learning representations for automatic colorization. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+
+[29] Larsson, G., Maire, M., Shakhnarovich, G.: Colorization as a proxy task for visual understanding. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017)
+[30] Li, Y., Zhang, X., Chen, D.: CSRNet: Dilated convolutional neural networks for understanding the highly congested scenes. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+[31] Lian, D., Li, J., Zheng, J., Luo, W., Gao, S.: Density map regression guided detection network for rgb-d crowd counting and localization. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[32] Liu, C., Weng, X., Mu, Y.: Recurrent attentive zooming for joint crowd counting and precise localization. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[33] Liu, J., Gao, C., Meng, D., Hauptmann, A.G.: DecideNet: Counting varying density crowds through attention guided detection and density estimation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+[34] Liu, L., Qiu, Z., Li, G., Liu, S., Ouyang, W., Lin, L.: Crowd counting with deep structured scale integration network. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[35] Liu, N., Long, Y., Zou, C., Niu, Q., Pan, L., Wu, H.: ADCrowdNet: An attention-injective deformable convolutional network for crowd understanding. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[36] Liu, W., Salzmann, M., Fua, P.: Context-aware crowd counting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[37] Liu, X., Van De Weijer, J., Bagdanov, A.D.: Exploiting unlabeled data in CNNs by self-supervised learning to rank. IEEE Transactions on Pattern Analysis and Machine Intelligence (2019)
+[38] Liu, Y., Shi, M., Zhao, Q., Wang, X.: Point in, box out: Beyond counting persons in crowds. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[39] Ma, Z., Wei, X., Hong, X., Gong, Y.: Learning scales from points: A scalable aware probabilistic model for crowd counting. In: Proceedings of the 28th ACM International Conference on Multimedia (2020)
+[40] Makhzani, A., Frey, B.J.: Winner-take-all autoencoders. In: Advances in Neural Information Processing Systems (NIPS) (2015)
+[41] Misra, I., Zitnick, C.L., Hebert, M.: Shuffle and learn: unsupervised learning using temporal order verification. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+[42] Moussaïd, M., Helbing, D., Theraulaz, G.: How simple rules determine pedestrian behavior and crowd disasters. Proceedings of the National Academy of Sciences (2011)
+[43] Nathan Mundhenk, T., Ho, D., Chen, B.Y.: Improvements to context based self-supervised learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018)
+
+[44] Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+[45] Onoro-Rubio, D., López-Sastre, R.J.: Towards perspective-free object counting with deep learning. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+[46] Pathak, D., Girshick, R., Dollar, P., Darrell, T., Hariharan, B.: Learning features by watching objects move. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017)
+[47] Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., Efros, A.A.: Context encoders: Feature learning by inpainting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016)
+[48] Ranjan, V., Le, H., Hoai, M.: Iterative crowd counting. In: Proceedings of the European Conference on Computer Vision (2018)
+[49] Shi, M., Yang, Z., Xu, C., Chen, Q.: Revisiting perspective information for efficient crowd counting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[50] Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+[51] Sindagi, V.A., Patel, V.M.: CNN-based cascaded multi-task learning of high-level prior and density estimation for crowd counting. In: Proceedings of the IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS) (2017)
+[52] Sindagi, V.A., Patel, V.M.: Generating high-quality crowd density maps using contextual pyramid CNNs. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2017)
+[53] Sindagi, V.A., Patel, V.M.: Multi-level bottom-top and top-bottom feature fusion for crowd counting. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[54] Sindagi, V.A., Yasarla, R., Patel, V.M.: Pushing the frontiers of unconstrained crowd counting: New dataset and benchmark method. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[55] Sindagi, V.A., Yasarla, R., Patel, V.M.: JHU-CROWD++: Large-scale crowd counting dataset and a benchmark method. Technical Report (2020)
+[56] Sun, Y., Tzeng, E., Darrell, T., Efros, A.A.: Unsupervised domain adaptation through self-supervision. arXiv preprint arXiv:1909.11825 (2019)
+[57] Vincent, P., Larochelle, H., Bengio, Y., Manzagol, P.A.: Extracting and composing robust features with denoising autoencoders. In: Proceedings of the International Conference on Machine Learning (ICML) (2008)
+[58] Wan, J., Chan, A.: Modeling noisy annotations for crowd counting. Advances in Neural Information Processing Systems (2020)
+[59] Wan, J., Luo, W., Wu, B., Chan, A.B., Liu, W.: Residual regression with semantic prior for crowd counting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+
+[60] Wan, J., Wang, Q., Chan, A.B.: Kernel-based density map generation for dense object counting. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020)
+[61] Wang, Q., Gao, J., Lin, W., Li, X.: Nwpu-crowd: A large-scale benchmark for crowd counting and localization. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020)
+[62] Wang, Q., Gao, J., Lin, W., Yuan, Y.: Learning from synthetic data for crowd counting in the wild. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[63] Wang, X., Gupta, A.: Unsupervised learning of visual representations using videos. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2015)
+[64] Yan, Z., Yuan, Y., Zuo, W., Tan, X., Wang, Y., Wen, S., Ding, E.: Perspective-guided convolution networks for crowd counting. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[65] Zhang, A., Shen, J., Xiao, Z., Zhu, F., Zhen, X., Cao, X., Shao, L.: Relational attention network for crowd counting. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[66] Zhang, A., Yue, L., Shen, J., Zhu, F., Zhen, X., Cao, X., Shao, L.: Attentional neural fields for crowd counting. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2019)
+[67] Zhang, C., Li, H., Wang, X., Yang, X.: Cross-scene crowd counting via deep convolutional neural networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2015)
+[68] Zhang, L., Qi, G.J., Wang, L., Luo, J.: AET vs. AED: Unsupervised representation learning by auto-encoding transformations rather than data. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019)
+[69] Zhang, R., Isola, P., Efros, A.: Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017)
+[70] Zhang, R., Isola, P., Efros, A.A.: Colorful image colorization. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+[71] Zhang, Y., Zhou, D., Chen, S., Gao, S., Ma, Y.: Single-image crowd counting via multi-column convolutional neural network. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016)
\ No newline at end of file
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/images.zip b/completelyselfsupervisedcrowdcountingviadistributionmatching/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f55b41b8143df8e07150e2bd79bf42619cd16006
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:38cb50e7c6a626317175802d89f4bbdd7d65592a0461b3c16e554ae7f392207e
+size 435940
diff --git a/completelyselfsupervisedcrowdcountingviadistributionmatching/layout.json b/completelyselfsupervisedcrowdcountingviadistributionmatching/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0b0bb4953e2bb8bafe9ded319572ba2342529747
--- /dev/null
+++ b/completelyselfsupervisedcrowdcountingviadistributionmatching/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0a1bd2c7f49927aa7ee1fabf8e96a79008cbe9f8d3d97e470941136e47f4cb0
+size 398849
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_content_list.json b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f1cf592af4c2795715f450fd953cfff4ab390d4d
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b35fe4eefd04150e64a6262e30a3a83753aded7b5bd3edd8fba79d7e367edd9
+size 72880
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_model.json b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f92792536de00d88035e74ec14085b311bca6a4c
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca1bbba4434e3a884109e90a700cb748994b867a4ea5cb0517ffc3689c8a3023
+size 89086
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_origin.pdf b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4dfea89a804ddd03cf7cdece804a1c3d57c5b791
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/17c013bf-7bdf-421f-902f-3f7fe8744cc4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:800e01ddcec9c3c41367bda190e75eea45525d45af54ecc40414e0b22140e0f1
+size 5970027
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/full.md b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..bfe346a1c3cd7dfa6b355cc1b93ec2fc0ec78fb2
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/full.md
@@ -0,0 +1,274 @@
+# Compositional Human-Scene Interaction Synthesis with Semantic Control
+
+Kaifeng Zhao $^{1}$ , Shaofei Wang $^{1}$ , Yan Zhang $^{1}$ , Thabo Beeler $^{2}$ , and Siyu Tang $^{1}$
+
+$^{1}$ ETH Zürich
+{kaifeng.zhao, shaofei.wang, yan.zhang, siyu.tang}@inf.ethz.ch
+ $^{2}$ Google
+thabo.beeler@gmail.com
+
+Abstract. Synthesizing natural interactions between virtual humans and their 3D environments is critical for numerous applications, such as computer games and AR/VR experiences. Recent methods mainly focus on modeling geometric relations between 3D environments and humans, where the high-level semantics of the human-scene interaction has frequently been ignored. Our goal is to synthesize humans interacting with a given 3D scene controlled by high-level semantic specifications as pairs of action categories and object instances, e.g., "sit on the chair". The key challenge of incorporating interaction semantics into the generation framework is to learn a joint representation that effectively captures heterogeneous information, including human body articulation, 3D object geometry, and the intent of the interaction. To address this challenge, we design a novel transformer-based generative model, in which the articulated 3D human body surface points and 3D objects are jointly encoded in a unified latent space, and the semantics of the interaction between the human and objects are embedded via positional encoding. Furthermore, inspired by the compositional nature of interactions that humans can simultaneously interact with multiple objects, we define interaction semantics as the composition of varying numbers of atomic action-object pairs. Our proposed generative model can naturally incorporate varying numbers of atomic interactions, which enables synthesizing compositional human-scene interactions without requiring composite interaction data. We extend the PROX dataset with interaction semantic labels and scene instance segmentation to evaluate our method and demonstrate that our method can generate realistic human-scene interactions with semantic control. Our perceptual study shows that our synthesized virtual humans can naturally interact with 3D scenes, considerably outperforming existing methods. We name our method COINS, for CO compositional INInteraction Synthesis with Semantic Control. Code and data are available at https://github.com/zkf1997/COINS.
+
+Keywords: human-scene interaction synthesis, semantic composition, virtual humans.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Fig. 1: Given a pair of action and object instance as the semantic specification, our method generates virtual humans naturally interacting with the object (first row). Furthermore, our method retargets interactions on unseen action-object combinations (second row) and synthesizes composite interactions without requiring any corresponding composite training data (third row).
+
+
+
+
+
+# 1 Introduction
+
+People constantly interact with their surroundings, and such interactions have semantics, specifically as combinations of actions and object instances, e.g., "sit on the chair" or "lie on the bed". Incorporating and controlling such interaction semantics is critical for creating virtual humans with realistic behavior. An effective solution for semantic-aware virtual human generation could advance existing technologies in AR/VR, computer games, and synthetic data generation to train machine learning perception algorithms. However, existing methods focus on modeling geometric relationships between virtual humans and their 3D environments [11, 45, 46], and thus are not able to synthesize body-scene interactions with semantic control of human actions and specific interaction objects. This heavily limits their use in practice.
+
+In this paper, we aim to incorporate semantic control into the synthesis of human-scene interactions. This is a challenging task due to the following reasons. First, semantic-aware human-scene interactions are characterized by body artic
+
+ulation, 3D object geometry, and the intent of the interaction. It is challenging to learn a generalizable representation to capture such heterogeneous information. Second, given a 3D scene, the space for plausible human-scene interactions is enormous, and obtaining sufficiently diverse training data remains challenging.
+
+To address these challenges, we introduce a novel interaction synthesis approach that leverages transformer-based generative models and can synthesize realistic 3D human bodies, given a 3D scene and a varying number of action-object pairs. These pairs can specify the intent of the interactions and the interacting objects. The key advantages of our models are two-fold: First, we represent human body articulation and 3D object geometry as tokens in the proposed transformer network, and the interaction semantics are embedded via positional encoding. Combined with a conditional variational auto-encoder (VAE) [16,33], we learn a unified latent space that captures the distribution of human articulation conditioned on the given 3D objects and the interaction semantics. Second, our models can be used to synthesize composite interactions, as they can naturally incorporate a varying number of 3D objects and interaction semantics. By training only on irreducible atomic interactions (e.g., "sit on the sofa", "touch the table"), our model can generate novel composite interactions (e.g., "sit on the sofa and touch the table") in unseen 3D scenes without requiring composite training data (Fig. 1). Furthermore, we decompose the interaction synthesis task into three stages. First, we infer plausible global body locations and orientations given pairs of actions and objects. Second, we generate detailed body articulation and body-scene contact that aligns with the object geometry and interaction semantics. Lastly, we further refine the local body-scene contact by leveraging the inferred contact map.
+
+To train and evaluate our method, we extend the PROX dataset [10] to the PROX-S dataset, which includes 3D instance segmentation, SMPL-X body estimation, and per-frame annotation of interaction semantics. Since there are no existing methods working on the same task of populating scenes with semantic control, we adapt PiGraph [31] and POSA [11] to this new task, and train their modified versions on the PROX-S dataset as baselines. Our perceptual study shows that our proposed method can generate realistic 3D human bodies in a 3D scene with semantic control, significantly outperforming those baselines.
+
+In summary, our contributions are: (1) a novel compositional representation for interaction with semantics; (2) a generative model for synthesizing diverse and realistic human-scene interactions from semantic specifications; (3) a framework for composing atomic interactions to generate composite interactions; and (4) the extended human-scene interaction dataset PROX-S containing scene instance segmentation and per-frame interaction semantic annotation.
+
+# 2 Related Work
+
+Human-Scene Interaction Synthesis. Synthesizing human-scene interactions has been a challenging problem in the computer vision and graphics community. Various methods have been proposed to analyze object affordances and gener
+
+ate static human-scene interactions [6,8,12,15,17,30,31]. However, the realism of synthesized interactions from these methods is often limited by their oversimplified human body representations. The recently published PSI [46] uses the parametric body model SMPL-X [23] to put 3D human bodies into scenes, conditioned on scene semantic segmentation and depth map. In addition, geometric constraints are applied to resolve human-scene contact and penetration problems. PLACE [45] learns the human-scene proximity and contact in interactions to infer physically plausible humans in 3D scenes. POSA [11] proposes an egocentric contact feature map that encodes per-vertex contact distance and semantics information. A stochastic model is trained to predict contact feature maps given body meshes, with the predicted contact features guiding the body placement optimization in scenes. Wang et al. [40] generate human bodies at specified locations and orientations, conditioning on the point cloud of the scene and implicitly modeling the scene affordance. Concurrent work [41] first generates scene-agnostic body poses from actions and then places body into scene using POSA, which is similar to the POSA-I baseline we implement.
+
+Apart from being realistic, semantic control is another important goal in synthesizing interactions. PiGraph [31] learns a probabilistic distribution for each annotated interaction category and synthesizes interactions by selecting the highest scoring samples of fitted categorical distribution. Conditional action synthesis methods [1,2,24] generate human motion conditioned on action categories or text descriptions while ignoring human-scene interaction. NSM [34] uses a mixture of experts modulated by the action category to generate human motion of seven predefined categories. SAMP [9] extends NSM by incorporating stochastic motion modeling and a GoalNet predicting possible interaction goals given scene objects and action categories. NSM and SAMP are limited in interaction semantics modeling since they can only model interactions with one single object or the surrounding environment as a whole. Our work, in contrast, models the compositional nature of interaction semantics and can generate composite interactions involving multiple objects simultaneously.
+
+Human Behavior Semantics Modelling. Understanding human behavior is an important problem that has long received a significant amount of attention. Action recognition [13,14,32,37] classifies human activities into predefined action categories. Language driven pose and motion generation [1,2,35] incorporates natural languages that can represent more expressive and fine-grained action semantics. Human-object interaction detection [5,7,42] models interactions as triplets of (human, action, object), detecting humans and objects from images along with the relations between them.
+
+One key observation is that humans can perform multiple actions simultaneously and such behaviors have composite semantics. Composite semantics are often modeled as the combination of basic semantic units, like how phrases are composed by words in natural languages. Semantic composition is termed as compound in linguistics [18, 25] and studied in natural language processing [21, 22, 43]. PiGraph [31] describes composite human-scene interaction semantics with a set of (verb, noun) pairs. BABEL [26] uses natural language
+
+labels to annotate human motion capture data [3,19,20,36,38] and allow multiple descriptions existing in a single frame to model composite semantics. These works model semantics on the object category level and ignore the differences among instances of the same category. Our work goes beyond this limitation to model interaction semantics with specific object instances, which is critical for solving ambiguity in scenes with multiple objects of the same category.
+
+# 3 Method
+
+# 3.1 Preliminaries
+
+Body Representation. We represent the 3D human body using a simplified SMPL-X model, consisting of vertex locations, triangle faces, and auxiliary per-vertex binary contact features, denoted as $\mathbf{B} = (\mathbf{V},\mathbf{F},\mathbf{C})$ . For computational efficiency, we downsample the original SMPl-X mesh to have 655 vertices $\mathbf{V}\in \mathbb{R}^{655\times 3}$ and 1296 faces $\mathbf{F}\in \{1\dots 655\}^{1296\times 3}$ using the sampling method of [28]. The binary contact features $\mathbf{C}\in \{0,1\}^{655}$ indicate whether each body vertex is in contact with scene objects [11]. Specifically, we consider a body vertex is in contact if its distance to scene objects is below a threshold value. We introduce the auxiliary contact features because human-object contact is a strong cue for interaction semantics, e.g., "touch" implies contact on hands. We use the contact features to further refine human-scene interaction in post-optimization.
+
+3D Scene Representation. We represent a 3D scene as a set of object instances, denoted as $\mathbf{S} = \{o^i\}_{i=1}^O$ where $O$ is the number of object instances. Each object instance $o^i \in \mathbb{R}^{8192 \times 9}$ is an oriented point cloud of 8192 points with attributes of location, color, and normal. We represent objects as point clouds to incorporate the geometry information and enable generalization to open-set objects that do not belong to predefined object categories, unlike previous works [11,31,46] that only use object category information. Moreover, the effect of intra-class object variance on interactions can be learned from the object geometry to improve fine-grained human-scene contacts.
+
+Compositional Interaction Representation. Human-scene interactions involve three types of components: human bodies, actions, and objects. Inspired by the observation that humans can perform multiple interactions at the same time, we propose a compositional interaction representation $\mathbf{I} = (\mathbf{B},\{(a^i,o^i)\}_{i = 1}^M)$ , where $\mathbf{B}$ denotes the human body, and $\{(a^{i},o^{i})\}_{i = 1}^{M}$ is a set of atomic interactions. We use the term atomic interaction to refer to the basic, irreducible building block for interaction semantics, and each atomic interaction $(a^i,o^i)$ is a pair of a one-hot encoded action and an object instance, e.g., "sit on a chair". In addition, interactions can comprise more than one such atomic interaction unit, since one can simultaneously interact with multiple objects, e.g., "sit on a chair and type on a keyboard". We refer to such interactions consisting of more than one atomic interaction as composite interactions.
+
+
+Fig. 2: Illustration of our COINS method for human-scene interaction synthesis with semantic control. Given a 3D scene and semantic specifications of actions (e.g., "sit on", "touch") paired with object instances (highlighted with color), COINS first generates a plausible human pelvis location and orientation and then generates the detailed body.
+
+# 3.2 Interaction Synthesis with Semantic Control
+
+Synthesizing interactions with semantic control requires generating human bodies interacting with given scene objects in a natural and semantically correct way. Specifically, given a scene $S$ and interaction semantics specified as $\{(a^i,o^i)\}_{i = 1}^M$ , the task is to generate a human body $\mathbf{B}$ that perceptually satisfies the constraints of performing action $a^i$ with object $o^i$ .
+
+We propose a multi-stage method for interaction synthesis with semantic control as illustrated in Fig. 2. Given interaction semantics specified as action-object pairs, we first infer possible pelvis locations and orientations. Then we transform objects to the generated pelvis coordinate frame and sample body and contact map in the local space. We separately train two transformer-based conditional VAE (cVAE) [16, 33] models for pelvis and body generation, and name them as PelvisVAE and BodyVAE respectively. Lastly, we apply an interaction-based optimization that is guided by contact features to refine the generated interactions.
+
+Architecture. We propose a transformer-based conditional variational auto-encoder (cVAE) architecture that can handle the heterogeneous inputs of our compositional interaction representation containing body mesh vertices, object points without predefined topology, and interaction semantics. Specifically, object points and body vertices are represented as token inputs to the transformer, and learnable action embeddings are added to paired object tokens as positional encoding.
+
+The BodyVAE architecture is illustrated in Fig. 3. The PelvisVAE shares a similar architecture and we refer readers to the Supp. Mat. for illustration.
+
+
+Fig. 3: Illustration of BodyVAE architecture. Human body and objects are represented as tokens of the transformers while each action category is mapped to a learnable embedding and added to the corresponding object tokens. Modules within the dashed box are the semantic conditions of a varying number of action-object pairs. We denote addition with $\oplus$ and positional encoding with "PE". We visualize vertices with positive contact features as blue on the body mesh.
+
+Our cVAE networks take varying numbers of action-object pairs as conditional inputs. Each action category is mapped to a learnable embedding, and each object point cloud is first converted to 256 local keypoints using PointNet++ [27]. The action embedding is then added to the tokens of the paired object as positional encoding. Compared to treating actions as separate tokens [24], encoding actions into the positional encoding for object tokens can regulate each action to only affect the paired object, e.g., the action "sit on" is only related to the sofa, but not the table, in the example of Fig. 3. The human body input comprises mesh vertices with location and auxiliary contact features. We apply a linear layer to map vertices to tokens and vertex index based positional encoding to encode body topology.
+
+The transformer encoder maps input interactions into a latent space and the decoder predicts human bodies with contact features from conditional action-object pairs and the sampled latent code. On top of the encoder transformer network, we apply average pooling on the output human tokens followed by a linear layer to predict the latent normal distribution. At the decoder, we use a template body with person-dependent shape parameters for body tokens. Using the personalized template body makes our model generalize to different body shapes and enables explicit control of the body shape. The sampled latent code is used for keys and values of the encoder-decoder attention layers [39].
+
+BodyVAE shares the same transformer-based architecture and the same conditional input of action-object pairs as PelvisVAE. There are mainly two differences between BodyVAE and PelvisVAE. First, BodyVAE represents a human as a body mesh with contact features, while PelvisVAE represents a human as the pelvis joint location and orientation. Second, all input objects are in the
+
+scene coordinate frame in PelvisVAE while input objects are transformed to the local pelvis coordinate frame in BodyVAE.
+
+To make our sampled bodies compatible with the SMPL-X body model and ensure a valid body shape, we jointly train a Multi-Layer Perceptron (MLP) [29] with the BodyVAE to regress the corresponding SMPL-X body parameters from the sampled body meshes. We refer to the Supp. Mat. for more details on architecture and the training losses.
+
+Interaction-Based Optimization. Our model is trained with the pseudo ground truth body estimation [10, 44], which does not guarantee natural human-scene contact. Therefore, the generated interactions can also be unnatural. We follow [11, 45, 46] to apply interaction-based optimization to refine the interactions. We use generated SMPL-X parameters as initialization and optimize body translation $t$ , global orientation $R$ and pose $\theta$ . The optimization objective is given by:
+
+$$
+E (t, R, \theta) = \mathcal {L} _ {\text {i n t e r a c t i o n}} + \mathcal {L} _ {\text {c o l l}} + \mathcal {L} _ {\text {r e g}}, \tag {1}
+$$
+
+where $\mathcal{L}_{\text{interaction}}$ encourages body vertices with positive contact features to have zero distance to objects, $\mathcal{L}_{\text{coll}}$ is the scene SDF based collision term defined in [46], and the $\mathcal{L}_{\text{reg}}$ term penalizes $t,R$ and $\theta$ deviating from the initialization. We refer to the Supp. Mat. for detailed definitions.
+
+# 3.3 Compositional Interaction Generation
+
+Compositional interaction generation aims to generate composite interactions using models trained only on atomic interactions. Compositional interaction generation reflects the compositional nature of interaction semantics and can save the need to collect composite interaction data. Although our transformer-based generative model can synthesize bodies given composite interaction semantics, e.g. "sit on the sofa and touch the wall", it requires collecting data and training for all composite interactions we want to synthesize. However, collecting composite interaction data is exponentially more expensive than atomic interactions considering the vast possible combinations of atomic interactions. Therefore, it is desirable to have an automatic way to generate composite interactions requiring only atomic interaction data.
+
+To that end, we propose a simple yet effective two-step approach to generating composite interactions using models trained only on atomic interactions: (1) Compositional pelvis generation, where we formulate the task of generating pelvis frames given composite interaction semantics as finding the intersection of pelvis distributions of atomic interactions. (2) Compositional body generation, where we leverage attention masks derived from contact statistics in transformer inference to compose atomic interactions at the body parts level.
+
+Compositional Pelvis Generation. We formulate compositional pelvis generation as finding the intersection of pelvis distributions of component atomic interactions. Using our PelvisVAE trained for atomic interactions, we can decode the
+
+prior standard Gaussian distribution to distributions of plausible pelvis frames given atomic interaction semantics. Each component atomic interaction of a composite interaction determines a pelvis frame distribution in scenes, and intuitively the plausible pelvis of the composite interaction should lie in the intersection of all pelvis distributions. Therefore, we propose a compositional pelvis generation method where we sample pelvis frames for each atomic interaction, optimize all pelvis frames to be close in space, and average the optimized pelvis frames as the generated composite pelvis frame.
+
+Specifically, we denote the decoder of the PelvisVAE as a function $\mathcal{G}(z^i |a^i,o^i)$ mapping a latent code $z^{i}$ to a pelvis frame conditioned on the action-object pair of $(a^i,o^i)$ , we obtain the final pelvis frame from the composition of $M$ atomic interactions from the following optimization problem:
+
+$$
+\tilde {Z} = \underset {Z = \{z ^ {i} \} _ {i = 1} ^ {M}} {\arg \min } \sum_ {1 \leq i < M} \sum_ {i < j \leq M} | \mathcal {G} \left(z ^ {i} \mid a ^ {i}, o ^ {i}\right) - \mathcal {G} \left(z ^ {j} \mid a ^ {j}, o ^ {j}\right) | - \lambda \sum_ {1 \leq i \leq M} \log (p \left(z ^ {i}\right)), \tag {2}
+$$
+
+$Z$ denotes the set of $M$ randomly sampled latent codes for $M$ component atomic interactions, and $\lambda$ is a tunable weight. The initial values of the latent codes are randomly sampled from the prior distribution. The motivation is to optimize the latent codes of $M$ component atomic interactions to make their decoded pelvis frames as close as possible in the scene while maintaining high probabilities in each component pelvis distribution. We take the average of the $M$ optimized component pelvis frames as the sampled composite pelvis frame.
+
+Compositional Body Generation. For compositional body generation, we use the attention mechanism of transformer networks to compose atomic interactions at body part level. Although we use BodyVAE trained only on atomic interaction data, we can input more than one atomic interaction and achieve compositional body generation with additional attention masks derived from contact statistics.
+
+Our method is inspired by the observation from contact probability statistics that interaction semantics can often be determined by contact on certain body parts instead of the whole body, e.g., sitting is characterized by contact around the hip area. Specifically, we calculate the per-vertex contact probability for each action using training data. The vertex contact probability for one action is defined as the ratio of the number of positive contact features of the vertex and the number of all contact features of the vertex in the interaction data of the specified action. Heatmap visualization of such categorical contact statistics is shown in Fig. 4. High contact probability indicates a high correlation between the body vertex area and action semantics.
+
+Inspired by the observed action-part correlation, we propose leveraging the attention mechanism to compose atomic interactions according to three body parts: upper limbs, lower limbs, and torso. Given composite interaction semantics for body generation, we calculate the sum of contact probability at each part for each action. If the sum of contact probability of one action at one body part exceeds those of other actions by a threshold, we mask the attention between the
+
+
+"Lie on"-Side
+
+
+"Lie on"-Bottom
+
+
+"Sit on"-Side
+
+
+"Sit on"-Bottom
+
+
+Fig. 4: Visualization of per-vertex contact probability for two actions from the side and bottom views. Brighter colors indicate higher contact probability with objects. We randomly sample a pose within the action category for visualization.
+
+
+Fig. 5: Illustration of the PROX-S dataset. From left to right, it shows the RGB image, 3D scene reconstruction with instance segmentation, and the fitted SMPL-X human body with per-frame interaction semantic labels.
+
+
+
+part and all other atomic interactions to be zero. Taking the composite interaction "sit on chair and touch table" as an example, touching has a significantly greater sum of contact probability on upper limbs so the attention between upper limb tokens and chair (objects not paired with touching) tokens will be masked as zero.
+
+We input such attention masks and component atomic interactions to the transformer for compositional body generation. The derived attention masks can naturally compose the component atomic interactions via BodyVAE.
+
+# 4 Experiments
+
+# 4.1 Dataset
+
+We annotate a new dataset called PROX-S on top of the PROX [10] dataset to evaluate interaction synthesis with semantic control since there is no existing dataset suitable for this task. The PROX-S dataset contains (1) 3D instance segmentation of all 12 PROX scenes; (2) 3D human body reconstructions within the scenes; and (3) per-frame interaction semantic labels in the form of action-object pairs, as shown in Fig. 5. We refer to the Supp. Mat. for the detailed process description and statistics.
+
+# 4.2 Evaluation Metrics
+
+Semantic Contact. Compared to the semantics-agnostic body-scene contact score used in [46], we propose a semantic contact score to evaluate whether the generated interactions adhere to the semantic specifications characterized by proper body-scene contact. Using the action-specific body vertex contact probability introduced in Sec. 3.3 as weights, we calculate a weighted sum of binary contact features for each body in the training data and name the sum as the semantic contact score. This action-dependent semantic contact score reflects how body contact features align with the semantics of one action. We use the 20 percentile semantic contact score of training data bodies as the threshold score for each action to filter low-quality training interaction data with inaccurate contact. When evaluating a generated interaction sample, we calculate the weighted sum of contact features and compare it to the action-specific threshold score. The semantic contact score is one if the sum is higher than the threshold and zero otherwise.
+
+Physical Plausibility. We evaluate the physical plausibility of generated interactions using the non-collision metric from [4,11,45,46]. It is calculated as the ratio of the number of body vertices with non-negative scene SDF values and the number of all body vertices.
+
+Diversity. Following [46], we perform K-Means clustering to cluster the SMPL-X parameters of generated bodies into 50 clusters and evaluate the diversity using the entropy of the cluster ID histogram and the mean distance to cluster centers.
+
+Perceptual Study. We evaluate the perceptual realism and semantic accuracy of generated human-scene interactions by conducting perceptual studies on Amazon Mechanical Turk (AMT). We perform a binary-choice perceptual study where samples of the same interaction semantics from different sources are shown and the turkers are asked to choose the more natural one. For semantic accuracy, we instruct the turkers to rate the consistency between shown interaction samples and semantic labels from 1 (strongly disagree) to 5 (strongly agree). For more details regarding the perceptual studies, please refer to the Supp. Mat.
+
+# 4.3 Baselines
+
+There is no existing method that directly applies to the problem of generating 3D human bodies given a 3D scene and interaction semantics. Therefore, we modify two state-of-the-art interaction synthesis methods for our tasks and train their models using the same PROX-S dataset.
+
+$PiGraph-X$ . PiGraph [31] is the most related work to our knowledges, which simultaneously generates scene placement and human skeletons from interaction category specifications. We remove the scene placement step of the original paper and replace the skeleton body representation with the more realistic SMPL-X
+
+(a) Interaction Synthesis with Semantic Control.
+
+Table 1: Binary Realism Perceptual Study.
+
+| % users rated as “more realistic” |
| Ours | POSA-I |
| 63.8 % | 36.2 % |
| Ours | PiGraph-X |
| 79.7 % | 20.3 % |
| Ours | PseudoGT |
| 45.3 % | 54.7 % |
+
+(b) Interaction Synthesis via Semantic Composition.
+
+| % users rated as “more realistic” |
| Ours-C | PiGraph-X-C |
| 81.2 % | 18.2 % |
| Ours-C | PseudoGT |
| 42.4 % | 57.6 % |
+
+body model. We refer to this modified PiGraph variant as PiGraph-X. For compositional interaction generation, we extend PiGraph by sampling basic bodies from all comprised atomic interactions and using the average similarity score to those atomic interactions. We denote this PiGraph extension as PiGraph-X-C.
+
+POSA-I. POSA [11] generates human-scene interactions using optimization guided by per-vertex contact features. However, POSA lacks global control of the generated contact features and cannot generate human bodies conditioned on interaction semantics. To incorporate global semantics of human-scene interaction, we modify POSA to generate human bodies with vertex-level contact features from interaction semantics in the format of action-noun pairs. We denote the semantic-controllable POSA variant as POSA-I.
+
+# 4.4 Interaction Synthesis with Semantic Control
+
+We evaluate the synthesized interactions in terms of perceptual realism, perceptual semantic accuracy, semantic contact, physical plausibility, and diversity. Table 1 and 2 show the results of the perceptual studies on binary realism and other quantitative metrics, respectively. Our method significantly outperforms the baselines in the binary realism study and even comes close to the body poses reconstructed from the real human-scene interactions, which we consider as the pseudo ground truth. Our method also achieves higher perceptual semantic ratings than all the baselines. Quantitatively, our method achieves the highest semantic contact score (0.93) which significantly outperforms the baselines. Our method performs comparably on physical plausibility as POSA-I and significantly better than PiGraph-X. For diversity metrics, our method has a larger cluster entropy and smaller cluster size compared to the baselines. We observe more frequent unnatural interaction samples from PiGraph-X and POSA-I, which accounts for their larger cluster sizes. Note that our method is a generative pipeline where we evaluate every randomly sampled result, while both baselines need to search thousands of samples of global placement in scenes.
+
+We show the qualitative comparison of interactions generated from ours and two baselines in Fig. 6. PiGraph-X naively models the human body as independent joints and therefore suffers from unnatural body poses, poor human-scene
+
+Table 2: Evaluation of semantics, physical plausibility and diversity.
+
+ | Semantic Accuracy | Semantic Contact | Non-Collision | Entropy | Cluster Size | Samples |
| PiGraph-X | 3.90 ± 0.93 | 0.84 | 0.85 | 3.67 | 1.07 | 25K |
| POSA-I | 4.03 ± 0.85 | 0.67 | 0.98 | 3.75 | 1.08 | >1K |
| Ours | 4.17 ± 0.71 | 0.93 | 0.97 | 3.77 | 0.83 | 1 |
+
+
+Fig. 6: Qualitative comparison of interactions generated with our method and two baselines. Each row shows interactions generated from one method. From left to right, the columns correspond to different interaction semantics of "lying on the sofa", "stepping up on the chair", "sitting on the chair and touching the table", and "standing on the floor and touching the shelving".
+
+contact, and penetration. POSA-I generates bodies with physically plausible interactions, but since it needs to find plausible body placement in the scene, its optimization can easily get stuck at local minimums that are not semantically accurate and have inferior human-scene contact. In contrast, our method learns how humans interact with objects given different interaction semantics and generates realistic interactions that are both physically plausible and human-like.
+
+# 4.5 Compositional Interaction Generation
+
+We conduct the same evaluation for novel composite interaction generation as introduced in Sec. 4.4. We compare our method to the PiGraph-X-C extension for compositional interaction generation. POSA-I is not included in this part since it can not be easily extended for semantic composition. In the forced-alternative-choice (binary-choice) perceptual study (Tab. 1 (b)), our method significantly outperforms the baseline. The semantic accuracy, semantic contact, non-collision and diversity comparisons are shown in Tab. 3. Our method achieves significantly
+
+
+Fig. 7: Qualitative comparison of composite interactions generated using ours-C and PiGraph-X-C. Each row shows interactions generated from one method.
+
+Table 3: Evaluation of semantics, physical plausibility and diversity for novel compositional interaction generation.
+
+ | Semantic Accuracy | Semantic Contact | Non-Collision | Entropy | Cluster Size | Samples |
| PiGraph-X-C | 3.88 ± 1.15 | 0.80 | 0.84 | 3.72 | 1.09 | 25K |
| Ours-C | 3.95 ± 1.18 | 0.76 | 0.98 | 3.80 | 0.68 | 1 |
+
+better semantic accuracy, physical plausibility, and sample efficiency. The slight inferior semantic contact score is because the combinations of actions and objects in the test scenes may not always afford natural contact, like touching an incomplete wall in Fig. 7 (d). Touching the wall and floor simultaneously generates higher contact scores but perceptually unnatural poses to humans.
+
+We refer to the Supp. Mat. for more qualitative results, failures, ablation study, and limitations.
+
+# 5 Conclusion
+
+In this paper, we introduce a method to generate humans interacting with 3D scenes given interaction semantics as action-object pairs. We propose a compositional interaction representation and transformer-based VAE models to stochastically generate human-scene interactions. We further explored generating composite interactions by composing atomic interactions, which does not demand training on composite interaction data. Our method is a step towards creating virtual avatars interacting with 3D scenes.
+
+Acknowledgements: We sincerely acknowledge the anonymous reviewers for their insightful suggestions. We thank Francis Engelmann for help with scene segmentation and proofreading, and Siwei Zhang for providing body fitting results. This work was supported by the SNF grant 200021 204840.
+
+# References
+
+1. Ahn, H., Ha, T., Choi, Y., Yoo, H., Oh, S.: Text2action: Generative adversarial synthesis from language to action. In: Proc. of ICRA. IEEE (2018)
+2. Ahuja, C., Morency, L.P.: Language2pose: Natural language grounded pose forecasting. In: Proc. of 3DV. IEEE (2019)
+3. Akhter, I., Black, M.J.: Pose-conditioned joint angle limits for 3d human pose reconstruction. In: Proc. of CVPR (2015)
+4. Engelmann, F., Rematas, K., Leibe, B., Ferrari, V.: From Points to Multi-Object 3D Reconstruction. In: Proc. of CVPR (2021)
+5. Gkioxari, G., Girshick, R., Dollár, P., He, K.: Detecting and recognizing human-object interactions. In: Proc. of CVPR (2018)
+6. Grabner, H., Gall, J., Van Gool, L.: What makes a chair a chair? In: Proc. of CVPR. IEEE (2011)
+7. Gupta, A., Kembhavi, A., Davis, L.S.: Observing human-object interactions: Using spatial and functional compatibility for recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence 31, 1775-1789 (2009)
+8. Gupta, A., Satkin, S., Efros, A.A., Hebert, M.: From 3d scene geometry to human workspace. In: Proc. of CVPR. IEEE (2011)
+9. Hassan, M., Ceylan, D., Villegas, R., Saito, J., Yang, J., Zhou, Y., Black, M.J.: Stochastic scene-aware motion prediction. In: Proc. of ICCV (2021)
+10. Hassan, M., Choutas, V., Tzionas, D., Black, M.J.: Resolving 3D human pose ambiguities with 3D scene constraints. In: Proc. of ICCV (2019)
+1. Hassan, M., Ghosh, P., Tesch, J., Tzionas, D., Black, M.J.: Populating 3D scenes by learning human-scene interaction. In: Proc. of CVPR (2021)
+2. Hu, R., Yan, Z., Zhang, J., Van Kaick, O., Shamir, A., Zhang, H., Huang, H.: Predictive and generative neural networks for object functionality. arXiv preprint arXiv:2006.15520 (2020)
+3. Ji, S., Xu, W., Yang, M., Yu, K.: 3d convolutional neural networks for human action recognition. IEEE transactions on pattern analysis and machine intelligence 35(1), 221-231 (2012)
+4. Kay, W., Carreira, J., Simonyan, K., Zhang, B., Hillier, C., Vijayanarasimhan, S., Viola, F., Green, T., Back, T., Natsev, P., et al.: The kinetics human action video dataset. arXiv preprint arXiv:1705.06950 (2017)
+5. Kim, V.G., Chaudhuri, S., Guibas, L.J., Funkhouser, T.: Shape2pose: humancentric shape analysis. In: ACM Transactions on Graphics, (Proc. SIGGRAPH) (2014)
+6. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114 (2013)
+7. Li, X., Liu, S., Kim, K., Wang, X., Yang, M.H., Kautz, J.: Putting humans in a scene: Learning affordance in 3d indoor environments. In: Proc. of CVPR (2019)
+8. Lieber, R., Stekauer, P.: The oxford handbook of compounding (2011)
+9. Mahmood, N., Ghorbani, N., Troje, N.F., Pons-Moll, G., Black, M.J.: AMASS: Archive of motion capture as surface shapes. In: Proc. of ICCV (2019)
+20. Mandery, C., Terlemez, O., Do, M., Vahrenkamp, N., Asfour, T.: The kit whole-body human motion database. In: Proc. of ICAR (2015)
+21. Mineshima, K., Martínez-Gómez, P., Miyao, Y., Bekki, D.: Higher-order logical inference with compositional semantics. In: Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (2015)
+
+22. Mitchell, J., Lapata, M.: Vector-based models of semantic composition. In: Proc. of ACL (2008)
+23. Pavlakos, G., Choutas, V., Ghorbani, N., Bolkart, T., Osman, A.A.A., Tzionas, D., Black, M.J.: Expressive body capture: 3d hands, face, and body from a single image. In: Proc. of CVPR (2019)
+24. Petrovich, M., Black, M.J., Varol, G.: Action-conditioned 3d human motion synthesis with transformer vae. In: Proc. of ICCV (2021)
+25. Plag, I.: Word-formation in English. Cambridge University Press (2018)
+26. Punnakkal, A.R., Chandrasekaran, A., Athanasiou, N., Quiros-Ramirez, A., Black, M.J.: BABEL: Bodies, action and behavior with english labels. In: Proc. of CVPR (2021)
+27. Qi, C.R., Yi, L., Su, H., Guibas, L.J.: Pointnet++: Deep hierarchical feature learning on point sets in a metric space. arXiv preprint arXiv:1706.02413 (2017)
+28. Ranjan, A., Bolkart, T., Sanyal, S., Black, M.J.: Generating 3D faces using convolutional mesh autoencoders. In: Proc. of ECCV (2018)
+29. Rumelhart, D.E., Hinton, G.E., Williams, R.J.: Learning internal representations by error propagation. Tech. rep., California Univ San Diego La Jolla Inst for Cognitive Science (1985)
+30. Savva, M., Chang, A.X., Hanrahan, P., Fisher, M., Nießner, M.: Scenegrok: Inferring action maps in 3d environments. ACM transactions on graphics (TOG), (Proc. SIGGRAPH) 33(6), 1-10 (2014)
+31. Savva, M., Chang, A.X., Hanrahan, P., Fisher, M., Nießner, M.: PiGraphs: Learning Interaction Snapshots from Observations. ACM Transactions on Graphics, (Proc. SIGGRAPH) 35(4) (2016)
+32. Simonyan, K., Zisserman, A.: Two-stream convolutional networks for action recognition in videos. Proc. of NeurIPS (2014)
+33. Sohn, K., Lee, H., Yan, X.: Learning structured output representation using deep conditional generative models. Proc. of NeurIPS (2015)
+34. Starke, S., Zhang, H., Komura, T., Saito, J.: Neural state machine for character-scene interactions. In: ACM Trans. Graph.(ACM SIGGRAPH Asia) (2019)
+35. Tevet, G., Gordon, B., Hertz, A., Bermano, A.H., Cohen-Or, D.: Motionclip: Exposing human motion generation to clip space. arXiv preprint arXiv:2203.08063 (2022)
+36. De la Torre, F., Hodgins, J., Bargteil, A., Martin, X., Macey, J., Collado, A., Beltran, P.: Guide to the carnegie mellon university multimodal activity (cmummac) database (2009)
+37. Tran, D., Wang, H., Torresani, L., Ray, J., LeCun, Y., Paluri, M.: A closer look at spatiotemporal convolutions for action recognition. In: Proc. of CVPR (2018)
+38. Troje, N.F.: Decomposing biological motion: A framework for analysis and synthesis of human gait patterns. Journal of Vision 2, 371-387 (2002)
+39. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. Proc. of NeurIPS (2017)
+40. Wang, J., Xu, H., Xu, J., Liu, S., Wang, X.: Synthesizing long-term 3d human motion and interaction in 3d scenes. In: Proc. of CVPR (2021)
+41. Wang, J., Rong, Y., Liu, J., Yan, S., Lin, D., Dai, B.: Towards diverse and natural scene-aware 3d human motion synthesis. In: Proc. of CVPR (2022)
+42. Yao, B., Fei-Fei, L.: Modeling mutual context of object and human pose in human-object interaction activities. In: Proc. of CVPR (2010)
+43. Yin, D., Meng, T., Chang, K.W.: Sentibert: A transferable transformer-based architecture for compositional sentiment semantics. arXiv preprint arXiv:2005.04114 (2020)
+
+44. Zhang, S., Zhang, Y., Bogo, F., Marc, P., Tang, S.: Learning motion priors for 4d human body capture in 3d scenes. In: Proc. of ICCV (2021)
+45. Zhang, S., Zhang, Y., Ma, Q., Black, M.J., Tang, S.: PLACE: Proximity learning of articulation and contact in 3D environments. In: Proc. of 3DV (2020)
+46. Zhang, Y., Hassan, M., Neumann, H., Black, M.J., Tang, S.: Generating 3d people in scenes without people. In: Proc. of CVPR (2020)
\ No newline at end of file
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/images.zip b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..bf5bfae9bee82af56ef2f75b51a5a3b6e2767be7
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c8e4d644a48d73c5468e131bd2486fc42eea3459973ed14a5debbeab805171de
+size 428352
diff --git a/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/layout.json b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..80ad66bf5935e050f1203d2e82018195adedb2fa
--- /dev/null
+++ b/compositionalhumansceneinteractionsynthesiswithsemanticcontrol/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae6d07e47215741f7d1085e41210bc754d49f45048652a41ce977002e054063c
+size 335681
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_content_list.json b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..458820bce6bac882680e690c6e7bda88339f18f4
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7b98779c9ccf236b6916c2fd5af86a7e82c1f8a3cdb8a4fd703dc323a8a960ac
+size 94796
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_model.json b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3d9c23dd8e6de01ccbbc55991890c4abb0318eb1
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:968179da8f0b9da00e50388b86338423c65a54adc3a7799619460b9ad5a4d42b
+size 120094
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_origin.pdf b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..91d782a0f261eb787620644a5cde08ae994fafa9
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/6b5233b8-d7c6-4251-96ae-22b3d8016aa7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa53eebb32db4cd49df4c1a4376b1e2e2629a169c749ff56de3e113d0b2f616a
+size 1672701
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/full.md b/compositionalvisualgenerationwithcomposablediffusionmodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c74af1fafce689fa1c5dbf3715d8b6bca0529d71
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/full.md
@@ -0,0 +1,484 @@
+# Compositional Visual Generation with Composable Diffusion Models
+
+Nan Liu $^{1\star}$ , Shuang Li $^{2\star}$ , Yilun Du $^{2\star}$
+
+Antonio Torralba², and Joshua B. Tenenbaum²
+
+1 University of Illinois Urbana-Champaign
+
+2 Massachusetts Institute of Technology
+
+nanliu4@illinois.edu, {lishuang,yilundu,torralba,jbt}@mit.edu
+
+Abstract. Large text-guided diffusion models, such as DALLE-2, are able to generate stunning photorealistic images given natural language descriptions. While such models are highly flexible, they struggle to understand the composition of certain concepts, such as confusing the attributes of different objects or relations between objects. In this paper, we propose an alternative structured approach for compositional generation using diffusion models. An image is generated by composing a set of diffusion models, with each of them modeling a certain component of the image. To do this, we interpret diffusion models as energy-based models in which the data distributions defined by the energy functions may be explicitly combined. The proposed method can generate scenes at test time that are substantially more complex than those seen in training, composing sentence descriptions, object relations, human facial attributes, and even generalizing to new combinations that are rarely seen in the real world. We further illustrate how our approach may be used to compose pre-trained text-guided diffusion models and generate photorealistic images containing all the details described in the input descriptions, including the binding of certain object attributes that have been shown difficult for DALLE-2. These results point to the effectiveness of the proposed method in promoting structured generalization for visual generation.
+
+Keywords: Compositionality, Diffusion Models, Energy-based Models, Visual Generation
+
+# 1 Introduction
+
+Our understanding of the world is highly compositional in nature. We are able to rapidly understand new objects from their components, or compose words into complex sentences to describe the world states we encounter [21]. We are able
+
+(a) Composing Language Descriptions
+
+"A red car parked in a desert" AND "hills behind the car" AND "Aurora in the sky"
+
+
+"The sun setting in a horizon" AND "A house next to a pond" AND "Hills in the background"
+
+
+"A house with snow on the roof" AND "The house behind a tree" AND "A car in front of a tree"
+
+
+"A cloudy blue sky" AND "A mountain in the horizon" AND "Cherry Blossoms in front of the mountain"
+
+
+"A Ferris wheel" AND "A lake right next to the Ferris wheel" AND Buildings next to the lake
+
+
+"Palm trees on both sides of the street" AND "Pink Sunset in the horizon" AND "A car moving away"
+
+(b) Composing Objects
+Fig. 1: Our method allows compositional visual generation across a variety of domains, such as language descriptions, objects, object relations, and human attributes.
+
+Obj1 (0.1, 0.5) AND Obj1 (0.1, 0.65) AND Obj2 (0.5, 0.3) AND Obj2 (0.3, 0.55) AND Obj3 (0.5, 0.65) AND Obj3 (0.5, 0.45) AND Obj4 (0.7, 0.5) Obj4 (0.7, 0.3)
+
+(c) Composing Object Relations
+
+"A large purple metal "A large yellow rubber cube to the left of a cylinder to the right large gray rubber of a small gray metal cube" AND "A large cube" AND "A large purple metal cube to yellow rubber cylinder the right of a large below a large red yellow rubber sphere" rubber cube
+
+(d) Composing Facial Attributes
+
+NOT Female) AND Smiling AND (NOT Glasses)
+
+
+Male AND Blonde hair AN (NOT glasses)
+
+to make 'infinite use of finite means' [4], i.e., repeatedly reuse and recombine concepts we have acquired in a potentially infinite manner. We are interested in constructing machine learning systems to have such compositional capabilities, particularly in the context of generative modeling.
+
+Existing text-conditioned diffusion models such as DALLE-2 [30] have recently made remarkable strides towards compositional generation, and are capable in generating photorealistic images given textual descriptions. However, such systems are not fully compositional in nature and generate incorrect images when given more complex descriptions [24,39]. An underlying difficulty may be that such models encode text descriptions as fixed-size latent vectors. However, as textual descriptions become more complex, more information needs to be squeezed into the fixed-size vector. Thus it is impossible to encode arbitrarily complex textual descriptions.
+
+In this work, we propose to factorize the compositional generation problem, using different diffusion models to capture different subsets of a compositional specification. These diffusion models are then explicitly composed together to jointly generate an image. By explicitly factorizing the compositional generative modeling problem, our method is able to generalize to significantly more complex combinations that are unseen during training.
+
+Such an explicit form of compositionality has been explored before under the context of Energy-Based Models (EBMs) [7,8,23]. However, directly training EBMs has been proved to be unstable and hard to scale. We show that diffu
+
+sion models can be interpreted as implicitly parameterized EBMs, which can be further composed for image generation, significantly improving training stability and image quality.
+
+Our proposed method enables zero-shot compositional generation across different domains as shown in Figure 1. First, we illustrate how our approach may be applied to large pre-trained diffusion models, such as GLIDE [26], to compose multiple text descriptions. Next, we illustrate how our approach can be applied to compose objects and object relations, enabling zero-shot generalization to a larger number of objects. Finally, we illustrate how our framework can compose different facial attributes to generate human faces.
+
+Contributions: In this paper, we introduce an approach towards compositional visual generation using diffusion models. First, we show that diffusion models can be composed by interpreting them as energy-based models and drawing on this connection, show how we may compose diffusion models together.
+
+Second, we propose two compositional operators, conjunction and negation, on top of diffusion models that allow us to compose concepts in different domains during inference without any additional training. We show that the proposed method enables effective zero-shot combinatorial generalization. Finally, we evaluate our method on composing language descriptions, objects, object relations, and human facial attributes. Our method can generate high-quality images containing all the concepts and outperforms baselines by a large margin. For example, the accuracy of our method is $24.02\%$ higher than the best baseline for composing three objects in the specified positions on the CLEVR dataset.
+
+# 2 Related Work
+
+Controllable Image Generation. Our work is related to existing work on controllable image generation. One type of approach towards controllable image generation specifies the underlying content of an image utilizing text through either GANs [43,44,2], VQ-VAEs [31], or diffusion models [26]. An alternative type of approach towards controllable image generation manipulates the underlying attributes in an image [35,42,46]. In contrast, we are interested in compositionally controlling the underlying content of an image at test time, generating images that exhibit compositions of multiple different types of image content. Thus, most relevant to our work, existing work has utilized EBMs to compose different factors describing a scene [7,27,8,23]. We illustrate how we may implement such probabilistic composition on diffusion models, achieving better performance.
+
+Diffusion Models. Diffusion models have emerged as a promising class of generative models that formulates the data-generating process as an iterative denoising procedure [36,15]. The denoising procedure can be seen as parameterizing the gradients of the data distribution [38], connecting diffusion models to EBMs [22,10,28,12,11]. Diffusion models have recently shown great promise in image generation [6], enabling effective image editing [25,20], text conditioning [26,32,13], and image inpainting [33]. The iterative, gradient-based sampling of diffusion models lends itself towards flexible conditioning [6], enabling us to com-
+
+pose factors across different images. While diffusion models have been developed for image generation [37], they have further proven successful in the generation of waveforms [3], 3D shapes [45], decision making [16] and text [1], suggesting that our proposed composition operators may further be applied in such domains.
+
+# 3 Background
+
+# 3.1 Denoising Diffusion Models
+
+Denoising Diffusion Probabilistic Models (DDPMs) are a class of generative models where generation is modeled as a denoising process. Starting from sampled noise, the diffusion model performs $T$ denoising steps until a sharp image is formed. In particular, the denoising process produces a series of intermediate images with decreasing levels of noise, denoted as $\boldsymbol{x}_T, \boldsymbol{x}_{T-1}, \dots, \boldsymbol{x}_0$ , where $\boldsymbol{x}_T$ is sampled from a Gaussian prior and $\boldsymbol{x}_0$ is the final output image.
+
+DDPMs construct a forward diffusion process by gradually adding Gaussian noise to the ground truth image. A diffusion model then learns to revert this noise corruption process. Both the forward processes $q(\pmb{x}_t|\pmb{x}_{t-1})$ and the reverse process $q(\pmb{x}_{t-1}|\pmb{x}_t)$ are modeled as the products of Markov transition probabilities:
+
+$$
+q \left(\boldsymbol {x} _ {0: T}\right) = q \left(\boldsymbol {x} _ {0}\right) \prod_ {t = 1} ^ {T} q \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {t - 1}\right), \quad p _ {\theta} \left(\boldsymbol {x} _ {T: 0}\right) = p \left(\boldsymbol {x} _ {T}\right) \prod_ {t = T} ^ {1} p _ {\theta} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}\right), \tag {1}
+$$
+
+where $q(\pmb{x}_0)$ is the real data distribution and $p(\pmb{x}_T)$ is a standard Gaussian prior.
+
+A generative process $p_{\theta}(\pmb{x}_{t-1}|\pmb{x}_t)$ is trained to generate realistic images by approximating the reverse process through variational inference. Each step of the generative process is a Gaussian distribution with learned mean and covariance:
+
+$$
+p _ {\theta} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}\right) := \mathcal {N} \left(\mu_ {\theta} \left(\boldsymbol {x} _ {t}, t\right), \sigma_ {t} ^ {2}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t} + \epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t\right), \sigma_ {t} ^ {2}\right), \tag {2}
+$$
+
+where $\pmb{x}_{t-1}$ is parameterized by a mean $\mu_{\theta}(\pmb{x}_t, t)$ represented by a perturbation $\epsilon_{\theta}(\pmb{x}_t, t)$ to a noisy image $\pmb{x}_t$ . The goal is to remove the noise gradually by predicting a less noisy image at timestep $\pmb{x}_{t-1}$ given a noisy image $\pmb{x}_t$ . To generate real images, we sample $\pmb{x}_{t-1}$ from $t = T$ to $t = 1$ using the parameterized marginal distribution $p_{\theta}(\pmb{x}_{t-1}|\pmb{x}_t)$ , with an individual step corresponding to:
+
+$$
+\boldsymbol {x} _ {t - 1} = \boldsymbol {x} _ {t} + \epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t\right) + \mathcal {N} \left(0, \sigma_ {t} ^ {2}\right). \tag {3}
+$$
+
+The generated images become more realistic over multiple iterations.
+
+# 3.2 Energy Based Models
+
+Energy-Based Models (EBMs) [10,9,12,28] are a class of generative models where the data distribution is modeled using an unnormalized probability density. Given an image $\pmb{x} \in \mathbb{R}^D$ , the probability density of image $\pmb{x}$ is defined as:
+
+$$
+p _ {\theta} (\boldsymbol {x}) \propto e ^ {- E _ {\theta} (\boldsymbol {x})}, \tag {4}
+$$
+
+
+Fig. 2: Compositional generation. Our method can compose multiple concepts during inference and generate images containing all the concepts without further training. We first send an image from iteration $t$ and each of the concept to the diffusion model to generate a set of scores $\{\epsilon_{\theta}(\pmb{x}_t,t|\pmb{c}_1),\dots,\epsilon_{\theta}(\pmb{x}_t,t|\pmb{c}_n)\}$ . We then compose different concepts using the proposed compositional operators, such as conjunction, to denoise the generated images. The final image is obtained after $T$ iterations.
+
+where the energy function $E_{\theta}(\pmb {x}):\mathbb{R}^{D}\to \mathbb{R}$ is a learnable neural network.
+
+A gradient based MCMC procedure, Langevin dynamics [10], is then used to sample from an unnormalized probability distribution to iteratively refine the generated image $\pmb{x}$ :
+
+$$
+\boldsymbol {x} _ {t} = \boldsymbol {x} _ {t - 1} - \frac {\lambda}{2} \nabla_ {\boldsymbol {x}} E _ {\theta} (\boldsymbol {x} _ {t - 1}) + \mathcal {N} (0, \sigma^ {2}). \tag {5}
+$$
+
+The procedure for sampling from diffusion models in Equation (3) is functionally similar to the sampling procedure used by EBMs in Equation (5). In both settings, images are iteratively refined starting from Gaussian noise, with a small amount of additional Gaussian noise added at each iterative step.
+
+# 4 Our approach
+
+In this section, we first introduce how we may interpret diffusion models as energy-based models in section 4.1 and then introduce how we compose diffusion models for visual generation in section 4.2.
+
+# 4.1 Diffusion Models as Energy Based Models
+
+The sampling procedure of diffusion models in Equation (3) and EBMs in Equation (5) are functionally similar. At a timestep $t$ , in diffusion models, images are updated using a learned denoising network $\epsilon_{\theta}(\pmb{x}_t,t)$ while in EBMs, images are updated using the gradient of the energy function $\nabla_{\pmb{x}}E_{\theta}(\pmb{x}_t)\propto \nabla_{\pmb{x}}\log p_{\theta}(\pmb {x})$ which is the score of the estimated probability distribution $p_{\theta}(\pmb {x})$ .
+
+The denoising network $\epsilon_{\theta}(\pmb{x}_{t}, t)$ is trained to predict the underlying score of the data distribution [41,37] when the number of diffusion steps increases to infinity. Similarly, an EBM is trained so that $\nabla_{\pmb{x}}E_{\theta}(\pmb{x}_{t})$ corresponds to the score of the data distribution as well. In this sense, $\epsilon_{\theta}(\pmb{x}_{t}, t)$ and $\nabla_{\pmb{x}}E_{\theta}(\pmb{x}_{t})$ are functionally the same, and the underlying sampling procedure in Equation (3) and
+
+Equation (5) are equivalent. We may view a trained diffusion model $\epsilon_{\theta}(\pmb{x}_t,t)$ as implicitly parameterizing an EBM by defining its data gradient $\nabla_{\pmb{x}}E_{\theta}(\pmb{x}_{t})$ at each data point, and we will subsequently refer to $\epsilon_{\theta}(\pmb{x}_t,t)$ as the score function. Such a parameterization enables us to leverage past work towards composing EBMs and apply it to diffusion models.
+
+Composing EBMs. Previous EBMs [14,7] have shown good compositionality ability for visual generation. Given $n$ independent EBMs, $E_{\theta}^{1}(\pmb{x}), \dots, E_{\theta}^{n}(\pmb{x})$ , the functional form of EBMs in Equation (4) enable us to compose multiple separate EBMs together to obtain a new EBM. The composed distribution can be represented as:
+
+$$
+p _ {\text {c o m p o s e}} (\boldsymbol {x}) \propto p _ {\theta} ^ {1} (\boldsymbol {x}) \dots p _ {\theta} ^ {n} (\boldsymbol {x}) \propto e ^ {- \sum_ {i} E _ {\theta} ^ {i} (\boldsymbol {x})} = e ^ {- E _ {\theta} (\boldsymbol {x})}, \tag {6}
+$$
+
+where $p_{\theta}^{i}\propto e^{-E_{\theta}^{i}(\pmb {x})}$ is the probability density of image $\pmb{x}$ (Equation (4)). Langevin dynamics is used to iteratively refine the generated image $\pmb{x}$ .
+
+$$
+\boldsymbol {x} _ {t} = \boldsymbol {x} _ {t - 1} - \frac {\lambda}{2} \nabla_ {\boldsymbol {x}} \left(\sum_ {i} E _ {\theta} ^ {i} \left(\boldsymbol {x} _ {t - 1}\right)\right) + \mathcal {N} (0, \sigma^ {2}). \tag {7}
+$$
+
+Composing Diffusion Models. By leveraging the interpretation that diffusion models are functionally similar to EBMs, we may compose diffusion models in a similar way. The generative process and the score function of a diffusion model can be represented as $p_{\theta}^{i}(\pmb{x}_{t - 1}|\pmb{x}_{t})$ and $\epsilon_{\theta}^{i}(\pmb{x},t)$ , respectively. If we treat the individual score function in diffusion models as the learned gradient of energy functions in EBMs, the composition of diffusion models has a score function of $\sum_{i}\epsilon_{\theta}^{i}(\pmb {x},t)$ . Thus the generative process of composing multiple diffusion models becomes:
+
+$$
+p _ {\text {c o m p o s e}} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t} + \sum_ {i} \epsilon_ {\theta} ^ {i} \left(\boldsymbol {x} _ {t}, t\right), \sigma_ {t} ^ {2}\right). \tag {8}
+$$
+
+A complication when parameterizing of a gradient field of EBM $\nabla_{\pmb{x}}E_{\theta}(\pmb{x}_t)$ with a learned score function $\epsilon_{\theta}(\pmb{x},t)$ , is that the gradient field may not be conservative, and thus does not lead to a valid probability density. However, as discussed in [34], explicitly parameterizing the learned function $\epsilon_{\theta}(\mathbf{x},t)$ as the gradient of EBM achieves similar performance as the non-conservative parameterization of diffusion models, suggesting this is not problematic.
+
+# 4.2 Compositional Generation through Diffusion Models
+
+Next, we discuss how we compose diffusion models for image generation. We aim to generate images conditioned on a set of concepts $\{c_1, c_2, \ldots, c_n\}$ . To do this, we represent each concept $c_i$ as an individual diffusion model, which are composed to generate images. Inspired by EBMs [7,23], we define two compositional operators, conjunction (AND) and negation (NOT), to compose diffusion models. We learn a set of diffusion models representing the conditional image generation $p(\boldsymbol{x} | c_i)$ given factor $c_i$ and an unconditional image generation $p(\boldsymbol{x})$ .
+
+Concept Conjunction (AND). We aim to generate images containing certain attributes. Following [7], the conditional probability can be factorized as
+
+$$
+p (\boldsymbol {x} | \boldsymbol {c} _ {1}, \dots , \boldsymbol {c} _ {n}) \propto p (\boldsymbol {x}, \boldsymbol {c} _ {1}, \dots , \boldsymbol {c} _ {n}) = p (\boldsymbol {x}) \prod_ {i} p (\boldsymbol {c} _ {i} | \boldsymbol {x}). \tag {9}
+$$
+
+We can represent $p(\pmb{c}_i|\pmb{x})$ using a combination of a conditional distribution $p(\pmb{x}|\pmb{c}_i)$ and an unconditional distribution $p(\pmb{x})$ , with both of them are parameterized as diffusion models $p(\pmb{c}_i|\pmb{x}) \propto \frac{p(\pmb{x}|\pmb{c}_i)}{p(\pmb{x})}$ . The expression of $p(\pmb{c}_i|\pmb{x})$ corresponds to the implicit classifier that represents the likelihood of $\pmb{x}$ exhibiting factor $\pmb{c}_i$ . Substituting $p(\pmb{c}_i|\pmb{x})$ in Equation 9, we can rewrite Equation 9 as the probability distribution:
+
+$$
+p (\boldsymbol {x} | \boldsymbol {c} _ {1}, \dots , \boldsymbol {c} _ {n}) \propto p (\boldsymbol {x}) \prod_ {i} \frac {p (\boldsymbol {x} | \boldsymbol {c} _ {i})}{p (\boldsymbol {x})}. \tag {10}
+$$
+
+We sample from this resultant distribution using Equation (8), with a new composed score function $\epsilon^{*}(\pmb{x}_{t},t)$ :
+
+$$
+\epsilon^ {*} (\boldsymbol {x} _ {t}, t) = \epsilon_ {\theta} (\boldsymbol {x} _ {t}, t) + \alpha \sum_ {i} \left(\epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t \mid \boldsymbol {c} _ {i}\right) - \epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t\right)\right), \tag {11}
+$$
+
+where the constant $\alpha$ corresponds to a temperature scaling on $\frac{p(\boldsymbol{x}|\boldsymbol{c}_i)}{p(\boldsymbol{x})}$ . We may then generate the composed sample using the following generative process:
+
+$$
+p ^ {*} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}\right) := \mathcal {N} \left(\boldsymbol {x} _ {t} + \epsilon^ {*} \left(\boldsymbol {x} _ {t}, t\right), \sigma_ {t} ^ {2}\right). \tag {12}
+$$
+
+In the setting in which image generation is conditioned on a single concept, the above sampling procedure reduces to classifier-free guidance.
+
+Concept Negation (NOT). In concept negation, we aim to generate image with the absence of a certain factor $\tilde{\pmb{c}}_j$ . We also need to generate images that look realistic. One easy way to do this is to make the generated images contain another factor $\pmb{c}_i$ . Following [7], concept negation can be represented as the composed probability distribution $p(\pmb{x}|$ not $\tilde{\pmb{c}}_j,\pmb{c}_1,\pmb{c}_2,\dots ,\pmb{c}_n) = \frac{\prod_i p(\pmb{x}|\pmb{c}_i)}{p(\pmb{x}|\tilde{\pmb{c}}_j)^{\alpha}}$ . Following [7], we refactorize the joint probability distribution as:
+
+$$
+p (\boldsymbol {x} | \text {n o t} \tilde {\boldsymbol {c}} _ {j}, \boldsymbol {c} _ {1}, \boldsymbol {c} _ {2}, \dots , \boldsymbol {c} _ {n}) \propto p (\boldsymbol {x}, \text {n o t} \tilde {\boldsymbol {c}} _ {j}, \boldsymbol {c} _ {1}, \boldsymbol {c} _ {2}, \dots , \boldsymbol {c} _ {n}) = p (\boldsymbol {x}) \frac {\prod_ {i} p (\boldsymbol {c} _ {i} | \boldsymbol {x})}{p (\tilde {\boldsymbol {c}} _ {j} | \boldsymbol {x}) ^ {\beta}}. \tag {13}
+$$
+
+Using the implicit classifier factorization $p(\pmb{c}_i|\pmb{x}) \propto \frac{p(\pmb{x}|\pmb{c}_i)}{p(\pmb{x})}$ , we can rewrite the above expression as:
+
+$$
+p (\boldsymbol {x} | \text {n o t} \tilde {\boldsymbol {c}} _ {j}, \boldsymbol {c} _ {1}, \boldsymbol {c} _ {2}, \dots , \boldsymbol {c} _ {n}) \propto p (\boldsymbol {x}) \frac {p (\boldsymbol {x}) ^ {\beta}}{p (\boldsymbol {x} | \tilde {\boldsymbol {c}} _ {j}) ^ {\beta}} \prod_ {i} \frac {p (\boldsymbol {x} | \boldsymbol {c} _ {i})}{p (\boldsymbol {x})}. \tag {14}
+$$
+
+Similarly, we may construct a new learned score $\epsilon^{*}(\pmb{x}_{t},t)$ using Equation (8) to sample from the generative process to represent this negated probability distribution at each timestep:
+
+Algorithm 1 Code for Composing Diffusion Models
+1: Require Diffusion model $\epsilon_{\theta}(\pmb{x},t|\pmb{c})$ , scale $\alpha$ negation factor $\beta$ noises $\sigma_t$
+2: // Code for conjunction
+3: Initialize sample $x_{T}\sim \mathcal{N}(\mathbf{0},\mathbf{I})$
+4: for $t = T,\dots ,1$ do
+5: $\epsilon_i\gets \epsilon_\theta (\pmb {x}_t,t|\pmb {c}_i)$ // compute conditional scores for each factor $c_{i}$
+6: $\epsilon \leftarrow \epsilon_{\theta}(\pmb {x}_t,t)$ // compute unconditional score
+7: $x_{t - 1}\sim \mathcal{N}(x_t + \epsilon +\alpha \sum_i(\epsilon_i - \epsilon),\sigma_t^2)$ // sampling
+8: end for
+9:
+10: // Code for negation
+11: Initialize sample $x_{T}\sim \mathcal{N}(\mathbf{0},\mathbf{I})$
+12: for $t = T,\ldots ,1$ do
+13: $\tilde{\epsilon}_{j}\gets \epsilon_{\theta}(\pmb{x}_{t},t|\tilde{\pmb{c}}_{j})$ // compute conditional scores for negated factor $\tilde{c}_j$
+14: $\epsilon_{i}\gets \epsilon_{\theta}(\pmb{x}_{t},t|\pmb{c}_{i})$ // compute conditional scores for each factor $c_{i}$
+15: $\epsilon \leftarrow \epsilon_{\theta}(\pmb {x}_t,t)$ // compute unconditional score
+16: $x_{t - 1}\sim \mathcal{N}(x_t + \epsilon +\alpha \{-\beta (\tilde{\epsilon}_j - \epsilon) + \sum_i(\epsilon_i - \epsilon)\} ,\sigma_t^2)$ // sampling
+17: end for
+
+$$
+\epsilon^ {*} (\boldsymbol {x} _ {t}, t) = \epsilon_ {\theta} (x _ {t}, t) + \alpha \{- \beta \left(\epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t \mid \tilde {\boldsymbol {c}} _ {j}\right) - \epsilon_ {\theta} (\boldsymbol {x} _ {t}, t)\right) + \sum_ {i} \left(\epsilon_ {\theta} \left(\boldsymbol {x} _ {t}, t \mid \boldsymbol {c} _ {i}\right) - \epsilon_ {\theta} (\boldsymbol {x} _ {t}, t)\right) \}, \tag {15}
+$$
+
+where the constant $\alpha$ corresponds to a temperature scaling on each implicit classifier $\frac{p(\boldsymbol{x}|\boldsymbol{c}_i)}{p(\boldsymbol{x})}$ . We may then generate samples from this modified learned score using Equation 12.
+
+Algorithm 1 provides the pseudo-code for composing diffusion models using concept conjunction and negation. Our method can compose pre-trained diffusion models during inference time without any additional training.
+
+# 5 Experiment Setup
+
+# 5.1 Datasets
+
+CLEVR. CLEVR [17] is a synthetic dataset containing objects with different shapes, colors, and sizes. The training set consists of 30,000 images at $128 \times 128$ resolution. Each image contains $1 \sim 5$ objects and a 2D coordinate $(x,y)$ label indicating that the image contains an object at $(x,y)$ . In our experiments, the 2D coordinate label is the coordinate of one random object in the image.
+
+Relational CLEVR. Relational CLEVR [23] contains relational descriptions between objects in the image, such as "a red cube to the left of a blue cylinder". The training dataset contains 50,000 images at $128 \times 128$ resolution. Each training image contains $1 \sim 5$ objects, and one label describing a relation between
+
+two objects. If there is only one object in the image, the second object in the relational description is null.
+
+FFHQ. FFHQ [18] is a real world human face dataset. The original FFHQ dataset consists of 70,000 human face images without labels. [5] annotates three binary attributes, including smile, gender, and glasses, for the images using pretrained classifiers. As a result, there are 51,067 images labeled by the classifiers.
+
+# 5.2 Evaluation Metrics
+
+Binary classification accuracy. During testing, we evaluate the performance of the proposed method and baselines on three different settings. The first test setting, 1 Component, generates images conditioned on a single concept (matching the training distribution). The second and third test settings,
+
+2 Components and 3 Components, generate images by composing two and three concepts respectively using the conjunction and negation operators. They are used to evaluate the models' generalization ability to new combinations.
+
+For each task, we use the training data (real images) to train a binary classifier that takes an image and a concept, e.g. 'smiling', as input, and predicts whether the image contains or represents the concept. We then apply this classifier to a generated image, checking whether it faithfully captures each of the concepts. In each test setting, each method generates 5,000 images for evaluation. The accuracy of the method is the percentage of generated images capturing all the concepts (See Appendix B).
+
+Frechet Inception Distance (FID) is a commonly used metric for evaluating the quality of generated images. It uses a pretrained inception model [40] to extract features for the generated images and real images and measure their feature similarity. Specifically, we use Clean-FID [29] to evaluate the generated images. FID is usually computed on 50,000 generated images, but we use 5,000 images in our experiments, thus causing our FID scores to be higher than usual.
+
+# 6 Experiments
+
+We compare the proposed method and baselines (section 6.1) on compositional generation on different domains. We show results of composing natural language descriptions (section 6.2), objects (section 6.3), object relational descriptions (section 6.4), and human facial attributes (Appendix A). Results analysis are shown in section 6.5.
+
+# 6.1Baselines
+
+We compare our method with baselines for compositional visual generation.
+
+Energy-based models (EBM) [7] is the first paper using EBMs for compositional visual generation. They propose three compositional operators for composing different concepts. Our works is inspired by [7], but we compose diffusion models and achieve better results.
+
+
+GLIDE
+
+
+
+
+
+
+
+
+
+
+
+
+Composed GLIDE (Ours)
+"A starry night sky" AND "A polar bear in a forest"
+Fig. 3: Composing Language Descriptions. We develop Composed GLIDE (Ours), a version of GLIDE [26] that utilizes our compositional operators to combine textual descriptions, without further training. We compare it to the original GLIDE, which directly encodes the descriptions as a single long sentence. Our approach more accurately captures text details, such as the "overwater bungalows" in the third example.
+
+
+"A white church sitting on a hill" AND "Aurora in the sky"
+
+
+"A pink sky in the horizon" AND "A sailboat at the sea" AND "Overwater bungalows"
+
+
+"A blue bird on a tree" AND "A red car behind the tree" AND "A green forest in the background"
+"A pink sky" AND "A blue mountain in the horizon" AND "Cherry Blossoms in front of the mountain"
+
+
+"A green tree swaying in the wind" AND "A red brick house located behind a tree" AND "A healthy lawn in front of the house"
+
+
+
+StyleGAN2 [19] is one of the state-of-the-art GAN methods for unconditional image generation. To enable compositional image generation, We optimize the latent code by decreasing the loss between a trained binary classifier and the given labels. We use the final latent code to generate images.
+
+LACE [27] uses pre-trained classifiers to generate energy scores in the latent space of the pre-trained StyleGAN2 model. To enable compositional image synthesis, LACE uses compositional operators [7].
+
+GLIDE [26] is a recent state-of-the-art text-conditioned diffusion model. For composing language descriptions, we use the classifier-free model released by OpenAI for comparison. For the rest tasks, we train the GLIDE model using the same data as our method.
+
+# 6.2 Composing Language Descriptions
+
+We first validate that our approach can compose natural language descriptions. We use the pre-trained text conditional diffusion models from GLIDE [26]. The image generation results of the released GLIDE model (a small model) is shown in Figure 3. We develop Composed GLIDE (Ours), a version of GLIDE [26] that utilizes our compositional operators to combine textual descriptions, without further training. We compare this model to the original GLIDE model, which directly encodes the descriptions as a single long sentence.
+
+In Figure 3, $GLIDE$ takes a single long sentence as input, for example "A pink sky in the horizon, a sailboat at the sea, and overwater bungalows". In contrast,
+
+
+Fig. 4: Composing Objects. Our method can compose multiple objects while baselines either miss or generate more objects.
+
+Table 1: Quantitative evaluation of ${128} \times {128}$ image generation results on CLEVR. The binary classification accuracy (Acc) and FID scores are reported. Our method outperforms baselines on all the three test settings.
+
+| Models | 1 Component | 2 Components | 3 Components |
| Acc (%) ↑ | FID ↓ | Acc (%) ↑ | FID ↓ | Acc (%) ↑ | FID ↓ |
| EBM [7] | 70.54 | 78.63 | 28.22 | 65.45 | 7.34 | 58.33 |
| StyleGAN2 [19] | 1.04 | 51.37 | 0.04 | 23.29 | 0.00 | 19.01 |
| LACE [27] | 0.70 | 50.92 | 0.00 | 22.83 | 0.00 | 19.62 |
| GLIDE [26] | 0.86 | 61.68 | 0.06 | 38.26 | 0.00 | 37.18 |
| Ours | 86.42 | 29.29 | 59.20 | 15.94 | 31.36 | 10.51 |
+
+Composed GLIDE (Ours) composes several short sentences using the concept conjunction operator, e.g. "A pink sky in the horizon" AND "A sailboat at the sea" AND "Overwater bungalows". While both GLIDE and Composed GLIDE (Ours) can generate reasonable images containing objects described in the text prompt, our approach with the compositional operators can more accurately capture text details, such as the presence of "a polar bear" in the first example and the "overwater bungalows" in the third example.
+
+# 6.3 Composing Objects
+
+Given a set of 2D object positions, we aim to generate images containing objects at those positions.
+
+Qualitative results. We compare the proposed method and baselines on composing objects in Figure 4. We only show the concept conjunction here because the object positions are not binary values, and thus negation of object positions is not interpretable. Given a set of object position labels, we compose them to generate images. Our model can generate images of objects at certain locations while the baseline methods either miss objects or generate incorrect objects.
+
+
+Fig. 5: Composing Visual Relations. Image generation results on the Relational CLEVR dataset. Our model is trained to generate images conditioned on a single object relation, but during inference, our model can compose multiple object relations, generating better results than baselines.
+
+Table 2: Quantitative evaluation of $128 \times 128$ image generation results on the Relational CLEVR dataset. The binary classification accuracy (Acc) and FID score on three test settings are reported. Although EBM performs well on the binary classification accuracy, its FID score is much lower than other methods. Our method achieves comparable or better results than baselines.
+
+| Models | 1 Component | 2 Components | 3 Components |
| Acc (%) ↑ | FID ↓ | Acc (%) ↑ | FID ↓ | Acc (%) ↑ | FID ↓ |
| EBM [23] | 78.14 | 44.41 | 24.16 | 55.89 | 4.26 | 58.66 |
| StyleGAN2 [19] | 20.18 | 22.29 | 1.66 | 30.58 | 0.16 | 31.30 |
| LACE [27] | 1.10 | 40.54 | 0.10 | 40.61 | 0.04 | 40.60 |
| GLIDE [26] | 32.68 | 57.48 | 7.48 | 59.47 | 2.14 | 61.52 |
| Ours | 60.40 | 29.06 | 21.84 | 29.82 | 2.80 | 26.11 |
+
+Quantitative results. As shown in Table 1, our method outperforms baselines by a large margin. The binary classification accuracy of our method is $15.88\%$ higher than the best baseline, EBM, in the 1 component test setting and is 24.02 higher than EBM on the more challenging 3 Components setting. Our method is more effective in zero-shot compositional generalization. In addition, our method can generate images with lower FID scores (more similar to the real images).
+
+# 6.4 Composing Object Relations
+
+Qualitative results. We further compare the proposed approach and baselines on composing object relational descriptions in Figure 5. Our model is trained to generate images conditioned on a single object relation, but it can compose multiple object relations during inference without additional training. Both LACE
+
+and StyleGAN2 fail to capture object relations in the input sentences, but EBM and our method can correctly compose multiple object relations. Our method generates higher-quality images compared with EBM, e.g. the object boundaries are sharper in our results than EBM. Surprisingly, DALLE-2 and GLIDE can generate high-quality images, but they fail to understand object relations.
+
+Quantitative results. Same as experiments in section 6.3, we evaluate the proposed method and baselines on three test settings in Table 2. We train a binary classifier to evaluate whether an image contains objects that satisfy the input relational description. For binary classification accuracy, our method outperforms StyleGAN2 (CLIP), LACE, and GLIDE on all three test settings. EBMs perform well on composing relational descriptions, but their FID scores are much worse than other methods, i.e. their generated images are not realistic.
+
+# 6.5 Results analysis
+
+We show the image generation results conditioned on each individual sentence description, and our composition results in Figure 6. We provide four successful compositional examples, where the generated image contains all the concepts mentioned in the input sentences.
+
+Failure cases. We observed three main failure cases of the proposed method. The first one is the pre-trained diffusion models do not understand certain concepts, such as "person" in (b). We used the pre-trained diffusion model, GLIDE [26], which is trained to avoid generating human images. The second type of failure is because the diffusion models confuse the objects' attributes. In (c), the generated image contains "a red bear" while the input is "a bear in a red forest". The third type of failure is because the composition does not work, e.g. the "bird-shape and flower-color object" and the "dog-fur and sofa-shape object" in (d). Such failures usually happen when the objects are in the center of the images.
+
+# 7 Conclusion
+
+In this paper, we compose diffusion models for image generation. By interpreting diffusion models as energy-based models, we may explicitly compose them and generate images with significantly more complex combinations that are never seen during training. We propose two compositional operators, concept conjunction and negation, allowing us to compose diffusion models during the inference time without any additional training. The proposed composable diffusion models can generate images conditioned on sentence descriptions, objects, object relations, human facial attributes, and even generalize to new combinations that are rarely seen in the real world. These results demonstrate the effectiveness of the proposed method for compositional visual generation.
+
+A limitation of our current approach is that while we are able to compose multiple diffusion models together, they are instances of the same model. We found limited success when composing diffusion models trained on different datasets. In
+
+
+(a) Successful Examples
+"An abandoned vehicle"
+
+
+"A forest covered with snow"
+
+
+
+
+"A camel!"
+
+
+"A forest"
+
+
+"A camel" AND "A forest"
+
+
+"A horse"
+"A yellow flower field"
+
+
+An abandoned vehicle? AND "A forest covered with snow"
+
+
+"A horse" AND "A yellow flower field."
+
+
+"A boat"
+
+
+"A desert"
+
+
+"A boat" AND "A desert"
+
+
+(b) Diffusion model fails
+"A bus"
+
+
+"A person"
+
+
+"A bus" AND
+"A person"
+
+
+(c) Diffusion model confuses object attributes
+"A bear in a red forest"
+
+
+"A car stuck in the forest"
+
+
+"A bear in a red forest" AND "A car stuck in the forest"
+
+
+(d) Composition fails
+"A bird"
+
+
+"A flower"
+
+
+"A bird" AND "A flower"
+
+
+"A couch"
+
+
+"A dog sitting in the living room."
+
+
+"A couch" AND "A dog sitting in the living room"
+Fig. 6: Qualitative results. Successful examples (a) and failure examples (b-d) generated by the proposed method. There are three main types of failures: (b) The pretrained diffusion model does not understand certain concepts, such as "person". (c) The pre-trained diffusion model confuses objects' attributes. (d) The composition fails. This usually happens when the objects are in the center of the images.
+
+contrast, compositional generation with EBMs [7] can successfully compose multiple separately trained models. Incorporating additional structures into diffusion models from EBMs [10], such as a conservative score field, may be a promising direction towards enabling compositions of separately trained diffusion models.
+
+Acknowledgments. Shuang Li is supported by Raytheon BBN Technologies Corp. under the project Symbiant (reg. no. 030256-00001 90113), Mitsubishi Electric Research Laboratory (MERL) under the project Generative Models For Annotated Video, and CMU and Army Research Laboratory under the project Contrastive dissection to visualize the differences between synthetic and real trained representations (reg. no. 1130233-442111). Yilun Du is supported by a NSF Graduate Fellowship.
+
+# References
+
+1. Austin, J., Johnson, D.D., Ho, J., Tarlow, D., van den Berg, R.: Structured denoising diffusion models in discrete state-spaces. In: Advances in Neural Information Processing Systems (2021)
+2. Bau, D., Andonian, A., Cui, A., Park, Y., Jahanian, A., Oliva, A., Torralba, A.: Paint by word. arXiv preprint arXiv:2103.10951 (2021)
+3. Chen, N., Zhang, Y., Zen, H., Weiss, R.J., Norouzi, M., Chan, W.: Wavegrad: Estimating gradients for waveform generation. arXiv preprint arXiv:2009.00713 (2020)
+4. Chomsky, N.: Aspects of the Theory of Syntax. The MIT Press, Cambridge (1965), http://www.amazon.com/Aspects-Theory-Syntax-Noam-Chomsky/ dp/0262530074
+5. DCGM: Gender, age, and emotions extracted for flickr-faces-hq dataset (ffhq). https://github.com/DCGM/ffhq-features-dataset (2020)
+6. Dhariwal, P., Nichol, A.: Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems 34 (2021)
+7. Du, Y., Li, S., Mordatch, I.: Compositional visual generation with energy based models. Advances in Neural Information Processing Systems 33, 6637-6647 (2020)
+8. Du, Y., Li, S., Sharma, Y., Tenenbaum, J., Mordatch, I.: Unsupervised learning of compositional energy concepts. Advances in Neural Information Processing Systems 34 (2021)
+9. Du, Y., Li, S., Tenenbaum, J., Mordatch, I.: Improved contrastive divergence training of energy based models. arXiv preprint arXiv:2012.01316 (2020)
+0. Du, Y., Mordatch, I.: Implicit generation and generalization in energy-based models. arXiv preprint arXiv:1903.08689 (2019)
+1. Gao, R., Song, Y., Poole, B., Wu, Y.N., Kingma, D.P.: Learning energy-based models by diffusion recovery likelihood. In: International Conference on Learning Representations (2021), https://openreview.net/forum?id=v_1Soh8QUNc
+2. Grathwohl, W., Wang, K.C., Jacobsen, J.H., Duvenaud, D., Zemel, R.: Learning the stein discrepancy for training and evaluating energy-based models without sampling. In: International Conference on Machine Learning (2020)
+3. Gu, S., Chen, D., Bao, J., Wen, F., Zhang, B., Chen, D., Yuan, L., Guo, B.: Vector quantized diffusion model for text-to-image synthesis. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10696-10706 (2022)
+4. Hinton, G.E.: Training products of experts by minimizing contrastive divergence. Neural computation 14(8), 1771-1800 (2002)
+5. Ho, J., Jain, A., Abbeel, P.: Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems 33, 6840-6851 (2020)
+6. Janner, M., Du, Y., Tenenbaum, J., Levine, S.: Planning with diffusion for flexible behavior synthesis. In: International Conference on Machine Learning (2022)
+7. Johnson, J., Hariharan, B., Van Der Maaten, L., Fei-Fei, L., Lawrence Zitnick, C., Girshick, R.: Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2901-2910 (2017)
+8. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 4401-4410 (2019)
+
+19. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of stylegan. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 8110-8119 (2020)
+20. Kim, G., Ye, J.C.: Diffusionclip: Text-guided image manipulation using diffusion models (2021)
+21. Lake, B.M., Salakhutdinov, R., Tenenbaum, J.B.: Human-level concept learning through probabilistic program induction. Science 350(6266), 1332-1338 (2015). https://doi.org/10.1126/science.aab3050, https://www.science.org/doi/abs/10.1126/science.aab3050
+22. LeCun, Y., Chopra, S., Hadsell, R., Ranzato, M., Huang, F.: A tutorial on energy-based learning. Predicting structured data 1(0) (2006)
+23. Liu, N., Li, S., Du, Y., Tenenbaum, J., Torralba, A.: Learning to compose visual relations. Advances in Neural Information Processing Systems 34 (2021)
+24. Marcus, G., Davis, E., Aaronson, S.: A very preliminary analysis of dall-e 2. arXiv preprint arXiv:2204.13807 (2022)
+25. Meng, C., He, Y., Song, Y., Song, J., Wu, J., Zhu, J.Y., Ermon, S.: Sdedit: Guided image synthesis and editing with stochastic differential equations. In: International Conference on Learning Representations (2021)
+26. Nichol, A., Dhariwal, P., Ramesh, A., Shyam, P., Mishkin, P., McGrew, B., Sutskever, I., Chen, M.: Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741 (2021)
+27. Nie, W., Vahdat, A., Anandkumar, A.: Controllable and compositional generation with latent-space energy-based models. Advances in Neural Information Processing Systems 34 (2021)
+28. Nijkamp, E., Hill, M., Han, T., Zhu, S.C., Wu, Y.N.: On the anatomy of mcmc-based maximum likelihood learning of energy-based models. arXiv preprint arXiv:1903.12370 (2019)
+29. Parmar, G., Zhang, R., Zhu, J.Y.: On aliased resizing and surprising subtleties in gan evaluation. In: CVPR (2022)
+30. Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., Chen, M.: Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125 (2022)
+31. Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Radford, A., Chen, M., Sutskever, I.: Zero-shot text-to-image generation. In: International Conference on Machine Learning. pp. 8821-8831. PMLR (2021)
+32. Rombach, R., Blattmann, A., Lorenz, D., Esser, P., Ommer, B.: High-resolution image synthesis with latent diffusion models. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10684-10695 (2022)
+33. Sahara, C., Chan, W., Chang, H., Lee, C.A., Ho, J., Salimans, T., Fleet, D.J., Norouzi, M.: Palette: Image-to-image diffusion models. arXiv preprint arXiv:2111.05826 (2021)
+34. Salimans, T., Ho, J.: Should ebms model the energy or the score? In: Energy Based Models Workshop-ICLR 2021 (2021)
+35. Shoshan, A., Bhonker, N., Kviatkovsky, I., Medioni, G.: Gan-control: Explicitly controllable gans. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 14083-14093 (2021)
+36. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., Ganguli, S.: Deep unsupervised learning using nonequilibrium thermodynamics. In: International Conference on Machine Learning. pp. 2256-2265. PMLR (2015)
+37. Song, J., Meng, C., Ermon, S.: Denoising diffusion implicit models. In: International Conference on Learning Representations (2021)
+
+38. Song, Y., Sohl-Dickstein, J., Kingma, D.P., Kumar, A., Ermon, S., Poole, B.: Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456 (2020)
+39. Swimmer963: What dall-e 2 can and cannot do (May 2022), https://www. lesswrong.com/posts/uKp6tBFStnsvrot5t/what-dall-e-2-can-and-cannot-do
+40. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z.: Rethinking the inception architecture for computer vision. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2818-2826 (2016)
+41. Vincent, P.: A connection between score matching and denoising autoencoders. Neural computation 23(7), 1661-1674 (2011)
+42. Xiao, T., Hong, J., Ma, J.: Elegant: Exchanging latent encodings with gan for transferring multiple face attributes. In: Proceedings of the European conference on computer vision (ECCV). pp. 168-184 (2018)
+43. Xu, T., Zhang, P., Huang, Q., Zhang, H., Gan, Z., Huang, X., He, X.: Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1316-1324 (2018)
+44. Zhang, H., Xu, T., Li, H., Zhang, S., Wang, X., Huang, X., Metaxas, D.N.: Stack-gan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In: Proceedings of the IEEE international conference on computer vision. pp. 5907-5915 (2017)
+45. Zhou, L., Du, Y., Wu, J.: 3D shape generation and completion through point-voxel diffusion. In: International Conference on Computer Vision (2021)
+46. Zhu, J., Shen, Y., Zhao, D., Zhou, B.: In-domain gan inversion for real image editing. In: European conference on computer vision. pp. 592-608. Springer (2020)
\ No newline at end of file
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/images.zip b/compositionalvisualgenerationwithcomposablediffusionmodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b74c93d3b89fa785425ce1306885abe6ca5fe2fb
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b1a20ef1a7110ed6a0552efdf81a8ee6c9feac8318b953f176938f739dbd3f68
+size 506752
diff --git a/compositionalvisualgenerationwithcomposablediffusionmodels/layout.json b/compositionalvisualgenerationwithcomposablediffusionmodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e35aca7e11862f732d6bb21838d8379f4793228c
--- /dev/null
+++ b/compositionalvisualgenerationwithcomposablediffusionmodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:38fc35116b9b3016a3ff56192facdf93fe9943124ea8b8db846a9b2585043f8b
+size 557555
diff --git a/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_content_list.json b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..629ca3bc165108180adc330c76755439a7eef18d
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f8f156351b5f6a368d968d74323d8d7a441fd9f47d248d8c361d9845520ec84a
+size 83606
diff --git a/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_model.json b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b51cad195d6d628f010f004c67cee2dfbae864ad
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:778e331b730256338cf1b8aca07ad7398ad478343ce02ff937f6ffcbc1835c4e
+size 108406
diff --git a/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_origin.pdf b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..337fd2b998ed1678540d95200699b5da052d6d61
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/330f394f-de8b-4739-adc1-d3592e67b444_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e1f5e7c8e4d05369cb91940a6b89cb0dd438bb955901330e68801fb8b8f149fd
+size 2696191
diff --git a/compoundprototypematchingforfewshotactionrecognition/full.md b/compoundprototypematchingforfewshotactionrecognition/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..12e9f46157bbc215f39061e1ec1ce84f949007f6
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/full.md
@@ -0,0 +1,322 @@
+# Compound Prototype Matching for Few-shot Action Recognition
+
+Yifei Huang $^{[0000-0001-8067-6227] \star \ddagger}$ , Lijin Yang $^{[0000-0003-3787-6658] \star}$ , and Yoichi Sato $^{[0000-0003-0097-4537]}$
+
+Institute of Industrial Science, the University of Tokyo, Tokyo, Japan {hyf,yang-lj,ysato}@iis.u-tokyo.ac.jp
+
+Abstract. Few-shot action recognition aims to recognize novel action classes using only a small number of labeled training samples. In this work, we propose a novel approach that first summarizes each video into compound prototypes consisting of a group of global prototypes and a group of focused prototypes, and then compares video similarity based on the prototypes. Each global prototype is encouraged to summarize a specific aspect from the entire video, e.g., the start/evolution of the action. Since no clear annotation is provided for the global prototypes, we use a group of focused prototypes to focus on certain timestamps in the video. We compare video similarity by matching the compound prototypes between the support and query videos. The global prototypes are directly matched to compare videos from the same perspective, e.g., to compare whether two actions start similarly. For the focused prototypes, since actions have various temporal variations in the videos, we apply bipartite matching to allow the comparison of actions with different temporal positions and shifts. Experiments demonstrate that our proposed method achieves state-of-the-art results on multiple benchmarks.
+
+Keywords: Few-shot action recognition, compound prototype, prototype matching.
+
+# 1 Introduction
+
+Difficulty in collecting large-scale data and labels promotes the research on few-shot learning. Built upon the success of few-shot learning for image understanding tasks [33,10,62,26,16,54,36,37,53], many begin to focus on the few-shot action recognition task [28]. Once realized, such techniques could greatly alleviate the cost of video labeling [20] and promote real-world applications where the labels in certain scenarios are hard to acquire [25].
+
+Most few-shot action recognition works determine the category of a query video using its similarity to the few labeled support videos. Many works [73,74,18] follow ProtoNet [47] to first learn a prototype for each video and compute the video similarity based on the similarity of the prototypes. To better consider the temporal dependencies in videos (e.g., temporal ordering and relation), recent
+
+works construct sub-sequence prototypes using different parts of the videos and calculate video similarity by matching the support-query prototypes [5,44].
+
+While temporal dependencies are considered, limitations still exist in previous methods. Firstly, without considering spatial information, previous methods cannot fully exploit the spatiotemporal relation in the videos for distinguishing actions like "put A on B" and "put A besides B" because they differ only in the relative position of the objects. Secondly, the sub-sequence prototypes come from fixed temporal locations, so that they cannot well handle the actions that happen at different speeds. Thirdly, it is computationally costly to exhaustively compute the similarity between all pairs of sub-sequence prototypes [44].
+
+To address the limitations and achieve more robust few-shot action recognition, we explore how to: (1) better generate prototypes that can robustly encode spatiotemporal relation in the videos, (2) enable the prototypes to flexibly encode the actions done with different lengths and speeds, and (3) match the prototypes between two videos without exhaustively comparing all prototype pairs.
+
+One straightforward way to address the first point is to use object features extracted from object bounding boxes [22]. However, we observed in our preliminary experiments only limited performance gain when previous methods [44,70] directly use them as additional inputs. In this work, we propose a multi-relation encoder to effectively encode the object features, by considering the spatiotemporal relation among objects across frames, the temporal relation between different frame-wise features, as well as the relation between object features and frame-wise features.
+
+For the second and third points, we propose to generate global prototypes that consider all frames in the input video. This is done by taking advantage of the self-attention mechanism of Transformers [51]. Since it is difficult to represent a wide variety of actions by using a single prototype, we instead use a group of prototypes to represent each action. We match the support-query similarity by fixed 1-to-1 matching, i.e., the $i$ -th prototype of the query video is always matched with the $i$ -th prototype of the support video. Thus, during training, each prototype will try to capture a certain aspect of the video. To avoid all prototypes to be the same, we apply a diversity loss when learning the prototypes, so that they are encouraged to capture different aspects of the action (e.g., one prototype captures the start of the action, and another prototype captures the action evolution).
+
+However, learning prototypes to represent different aspects of the action (e.g., the start/end of the action) is a difficult task even with annotation [9,40,41]. Thus, it is not sufficient to compute video similarity only by the global prototypes. To make the similarity measurement more reliable, we generate another group of focused prototypes, where each prototype is encouraged to focus on certain timestamps of the video. Since actions may happen in different parts of the videos at different speeds [34], it is not correct to compare the same timestamp between two videos. We therefore use bipartite matching to match the focused prototypes between the support and query videos, so that comparison of actions with different lengths and speeds can be done.
+
+Our method uses the compound of two groups of prototypes, which we call compound prototypes, for calculating video similarity. On multiple benchmark datasets, our method outperforms previous methods significantly when only one example is available, demonstrating the superiority of using our compound prototypes in similarity measurement.
+
+To summarize, our key contributions include:
+
+- A novel method for few-shot action recognition based on generating and matching compound prototypes.
+- Our method achieves state-of-the-art performance on multiple benchmark datasets [7,19,30], outperforming previous methods by a large margin.
+- A detailed ablation study showing the usefulness of leveraging object information for few-shot action recognition and demonstrating how the two groups of prototypes encode the video from complementary perspectives.
+
+# 2 Related Works
+
+Few-shot image classification methods can be broadly divided into three categories. The transfer-learning based methods [14,45,57] use pre-training and fine-tuning to increase the performance of deep backbone networks on few-shot learning. The second line of works focuses on rapidly learning an optimized classifier using limited training data [1,21,46,2,58,17,67]. The third direction is based on metric learning, whose goal is to learn more generalizable feature embeddings under a certain distance metric [29,47,52,27]. The key to metric-learning based methods is to generate robust representations of data under a certain metric, so that it may generalize to novel categories with few labeled samples. Our work falls into this school of research and focus on the more challenging video setting.
+
+Few-shot action recognition methods [50,34,43,24,3,74,42,75,61] mainly fall into the metric-learning framework. Many works follow the scheme of ProtoNet [47] to compute video similarity based on generated prototypes. For learning better prototypes, ProtoGAN [32] synthesizes additional feature, CMN [72,73] uses a multi-layer memory network, while ARN [69] uses jigsaws for self-supervision and enhances the video-level representation via spatial and temporal attention. There are also methods that perform pretraining with semantic labels [56,59,60] or use additional information such as depth [18] to augment video-level prototypes. Our method uses another form of additional information: the object bounding box from pretrained object detectors [22].
+
+The temporal variance of actions form a major challenge in few-shot action recognition task [34]. To better model temporal dependencies, recent researches put more focus on generating and matching sub-video level prototypes. OTAM [5] uses a generalized dynamic time warping technique [8] to monotonously match the prototypes between query and support videos. ITA-Net [70] first implicitly aggregates information for each frame using other frames, and conducts a 1-to-1 matching of all prototypes. However, these two methods use frame-wise prototypes, thus cannot well capture the higher-level temporal relation in multiple frames. Recently, TRX [44] constructs prototypes of different
+
+cardinalities for query and support videos, and calculate similarity by matching all prototype pairs. However, since TRX can only match prototypes with the same cardinality (e.g., three-frame prototypes matches with three-frame prototypes), it is hard to align the actions with different evolving speeds (e.g., one takes 2 frames while the other takes 4 frames). Also, the exhaustively matching of all pairs is computationally expensive.
+
+We summarize three main differences compared with previous works: (1) We encode spatiotemporal object information to form more robust prototypes. (2) We generate a compound of global and focused prototypes to represent the actions from diverse perspectives. (3) The two groups of prototypes are efficiently matched to robustly compute video similarity.
+
+Transformers [51] have recently acquired remarkable achievements in computer vision [6,38,13,15,68,64]. FEAT [65] represents early work that applies transformer in the few-shot learning task, and TRX [44] first introduces Transformer [15] into the few-shot action recognition task. Different from TRX, we apply a Transformer encoder-decoder to generate compound prototypes, and show that this is more effective in the few-shot action recognition scenario.
+
+# 3 Method
+
+# 3.1 Problem Setting
+
+In few-shot action recognition, a model aims to recognize an unlabeled video (query) into one of the target categories each with a limited number of labeled examples (support set) [5,44]. We follow the common practice [52,17] to use episodic training, where in each episode a $C$ -way $K$ -shot problem is sampled: the support set $\mathcal{S} = \{\mathbf{X}_s^j\}_{j=1}^{C \times K}$ is composed of $C \times K$ labeled videos from $C$ different classes where each class contains $K$ samples. The query set contains $N$ unlabeled videos $\mathcal{Q} = \{\mathbf{X}_q^i\}_{i=1}^N$ . The goal is to classify each video in the query set as one of the $C$ classes.
+
+# 3.2 Proposed Method
+
+We propose a new method for few-shot action recognition by generating and matching compound prototypes between query and support videos. As shown in Fig. 1, given the video input, a feature embedding network first extracts global (frame-wise) features $\mathbf{F}_g$ . To better model the actions involving multiple objects, we obtain object bounding boxes by a pretrained object detector [22], and extract object features $\mathbf{F}_o$ using the same embedding network. Then a multi-relation encoder uses $\mathbf{F}_g$ and $\mathbf{F}_o$ to output multi-relation features $\mathbf{F}_m$ containing spatiotemporal global-object relations. Then a compound prototype decoder generates global prototypes $\mathbf{P}_g$ and focused prototypes $\mathbf{P}_f$ for each video. During similarity calculation, we use fixed 1-to-1 matching on the global prototypes and bipartite matching on the focused prototypes, encouraging the similarity to be computed robustly from diverse perspectives. We introduce the details of each component below.
+
+
+Fig. 1. Illustration of our proposed method on a 3-way 1-shot problem. First, the videos are processed by an embedding network to acquire global (frame-level) features $\mathbf{F}_g$ and object features $\mathbf{F}_o$ . Features $\mathbf{F}_g$ and $\mathbf{F}_o$ are equipped with 1D and 3D positional encoding (PE), respectively, and then used by a multi-relation encoder (Sec. 3.2) to encode global-global, global-object and object-object information into a multi-relation feature $\mathbf{F}_m$ . Using $\mathbf{F}_m$ , a Transformer-based compound prototype decoder transforms the learnable tokens $\mathbf{T}_g, \mathbf{T}_f$ into compound prototypes that represent the input video (Sec. 3.2). The compound prototypes is consisted of several global prototypes $\mathbf{P}_g$ (green squares) and focused prototypes $\mathbf{P}_f$ (blue squares). They are applied with different loss and different matching strategies, so that each global prototype captures a certain aspect of the action summarized from the whole video, and each focused prototype focuses on a specific temporal location of the video. The final similarity score is calculated as the average similarity of all matched prototype pairs between support and query videos.
+
+Feature embedding For each input video $\mathbf{X} \in S \cup \mathcal{Q}$ , we sample $T$ frames following the sampling strategy of TSN [55]. We use an embedding network to acquire a global (frame-level) feature representation for each video $\mathbf{F}_g \in \mathbb{R}^{T \times d}$ , where $d$ is the feature dimension. Additionally, we extract object features via ROI-Align [22] using the predicted bounding boxes on each frame. We use only $B$ most confident boxes on each frame, forming object features $\mathbf{F}_o \in \mathbb{R}^{BT \times d}$ .
+
+Multi-relation encoder To better generate prototypes that are discriminative for actions involving multiple objects, we propose to use a multi-relation encoder to encode the spatiotemporal information from $\mathbf{F}_g$ and $\mathbf{F}_o$ . We specifically consider the following three relations: global-global (frame-wise) relation, global-object relation, object-object relation, and apply transformer [51] as the base architecture to allow relation modeling across frames. As shown in Fig. 1, the encoder consists of three relation encoding transformers (RETs). The global-global RET $(\mathrm{RET}_{gg})$ and the object-object RET $(\mathrm{RET}_{oo})$ are identical except the input. They take as input the global feature $\mathbf{F}_g$ and the object feature $\mathbf{F}_o$ respectively, and use the input to generate the query $\mathbf{Q}$ , key $\mathbf{K}$ and value $\mathbf{V}$ vectors for the transformer:
+
+$$
+\boldsymbol {F} _ {g g} = R E T _ {g g} (\boldsymbol {Q} = \boldsymbol {K} = \boldsymbol {V} = \boldsymbol {F} _ {g}) \tag {1}
+$$
+
+$$
+\boldsymbol {F} _ {o o} = R E T _ {o o} (\boldsymbol {Q} = \boldsymbol {K} = \boldsymbol {V} = \boldsymbol {F} _ {o}), \tag {2}
+$$
+
+The global-object RET $(\mathrm{RET}_{go})$ works differently, where it maps $\mathbf{F}_g$ as query vector, while $\mathbf{F}_o$ as key and value vectors:
+
+$$
+\boldsymbol {F} _ {g o} = R E T _ {g o} \left(\boldsymbol {Q} = \boldsymbol {F} _ {g}, \boldsymbol {K} = \boldsymbol {V} = \boldsymbol {F} _ {o}\right). \tag {3}
+$$
+
+The output size of each RET is the same as its input query vector. Thus, each of the $T$ frame would have $B + 2$ features with dimension $d$ . We concatenate the three outputs into a multi-relation feature $\mathbf{F}_m \in \mathbb{R}^{(B + 2)T \times d}$ .
+
+Positional encoding (PE) is shown to be effective in transformer-based architectures [51,39,38]. We also use PE but omit in the equations for simplicity. For $\pmb{F}_{g}$ we use 1D PE to encode the temporal location of each frame, and for $\pmb{F}_{o}$ we apply 3D PE, encoding both spatial and temporal location of each object.
+
+Compound prototype decoder The compound prototype decoder also follows the transformer architecture [51,49,11,6], so that the prototypes can be generated by considering feature of all frames via self-attention. As shown in Fig. 1, the input to the prototype decoder are two groups of learnable tokens $\pmb{T}_g \in \mathbb{R}^{m_g \times d}$ and $\pmb{T}_f \in \mathbb{R}^{m_f \times d}$ . A multi-head attention layer first encodes the tokens into $\hat{\pmb{T}}_g$ and $\hat{\pmb{T}}_f$ , then another multi-head attention layer transforms them into two groups of prototypes $P_g = \{p_{g,k}\}_{k=1}^{m_g} \in \mathbb{R}^{m_g \times d}$ and $P_f = \{p_{f,k}\}_{k=1}^{m_f} \in \mathbb{R}^{m_f \times d}$ . For simplicity, we omit the subscripts $g, f$ and all normalization layers, thus the equation can be written as:
+
+$$
+Q = \hat {T} W _ {Q}, \quad K = F _ {m} W _ {K}, \quad V = F _ {m} W _ {V}, \tag {4}
+$$
+
+where $\pmb{W}_Q, \pmb{W}_K, \pmb{W}_V \in \mathbb{R}^{d \times d}$ are linear projection weights, then we have
+
+$$
+\boldsymbol {A} = \operatorname {s o f t m a x} \left(\frac {\boldsymbol {Q} \boldsymbol {K} ^ {T}}{\sqrt {d}}\right), \quad \boldsymbol {P} = F F N (\boldsymbol {A} \boldsymbol {V}), \tag {5}
+$$
+
+where $\mathbf{A} \in \mathbb{R}^{m \times (B + 2)T}$ is the self-attention weights, and FFN denotes feed forward network.
+
+To encourage the prototypes to capture different aspects of the action, we apply constraints on the two groups of prototypes individually. For the global prototypes $P_g$ , we add a diversity loss to maximize their diversity:
+
+$$
+L _ {d i v} = \sum_ {i \neq j} \operatorname {s i m} \left(\boldsymbol {p} _ {g, i}, \boldsymbol {p} _ {g, j}\right), \tag {6}
+$$
+
+where $sim$ denotes the cosine similarity function.
+
+Since learning $P_{g}$ to robustly represent each aspect of the action (e.g., the start of the action) is difficult even with annotation [63,66]. To increase the overall robustness, for the focused prototypes $P_{f}$ , we instead add regularization on the self-attention weight $A_{f}$ so that different $p_{f}$ can focus on different temporal locations of the video:
+
+$$
+L _ {a t t} = \sum_ {i \neq j} \operatorname {s i m} \left(\boldsymbol {\alpha} _ {f, i}, \boldsymbol {\alpha} _ {f, j}\right). \tag {7}
+$$
+
+Here $\pmb{\alpha}_{f,i}\in \mathbb{R}^{(B + 2)T}$ denotes the $i$ -th row in $\pmb{A}_f$
+
+Compound Prototype Matching Cooperating with the compound prototypes, we use different matching strategies to calculate the overall similarity between two videos. As shown in Fig. 1, for the global prototypes $P_g$ , we match the query and support prototypes in a 1-to-1 manner, i.e., the $i$ -th prototype of the query video is always matched with the $i$ -th prototype of the support video. To calculate the global prototypes' overall similarity score between video $a$ and video $b$ , we average the similarity score of all the $m_g$ global prototypes:
+
+$$
+s _ {g} ^ {a, b} = \frac {1}{m _ {g}} \sum_ {k = 1} ^ {m _ {g}} \operatorname {s i m} \left(\boldsymbol {p} _ {g, k} ^ {a}, \boldsymbol {p} _ {g, k} ^ {b}\right). \tag {8}
+$$
+
+Thus, to maximize the similarity score of correct video pairs and minimize the similarity of incorrect video pairs during episodic training, each $\pmb{p}_g$ will try to encode a certain aspect of the action, e.g., the start of the action. This phenomenon is supported by our experiments in Sec. 4.
+
+For the focused prototypes $P_f$ , we apply a bipartite matching-based similarity measure. Since different actions may happen in different temporal positions in the videos, the bipartite matching enables the temporal alignment of actions, allowing the comparison between actions of different lengths and at different speeds. Formally speaking, for $P_f^a$ of video $a$ and $P_f^b$ of video $b$ , we find a bipartite matching between these two sets of prototypes by searching for the best permutation of $m_f$ elements with the highest cosine similarity using the Hungarian algorithm [31]. Denote $\sigma$ as the best permutation, the similarity score of $P_f^a$ and $P_f^b$ is calculated by:
+
+$$
+s _ {d} ^ {i, j} = \frac {1}{m _ {f}} \sum_ {k = 1} ^ {m _ {f}} \operatorname {s i m} \left(\boldsymbol {p} _ {f, k} ^ {a}, \boldsymbol {p} _ {f, \sigma (k)} ^ {b}\right). \tag {9}
+$$
+
+Finally, the similarity score is computed by a weighted average of $s_g$ and $s_f$ : $s^{a,b} = \lambda_1s_g^{a,b} + \lambda_2s_f^{a,b}$ . During training, this similarity score is directly regarded as logits for the cross-entropy loss $L_{ce}$ . The total loss function is a weighted sum of three losses: $L = w_{1}L_{ce} + w_{2}L_{div} + w_{3}L_{att}$ . During inference, we assign the label of the query video as the label of the most similar video in the support set.
+
+# 4 Experiments
+
+We conduct experiments on four public datasets. Kinetics [7] and Something-something V2 (SSv2) [19] are two most frequently used benchmarks for few-shot action recognition. These two datasets are both splitted as 64/12/24 classes for train/val/test. For SSv2, we use both the split from CMN [72] (SSv2°) and the split from OTAM [5] (SSv2#). Recently, Zhang et al. [69] proposed new splits for HMDB [30] and UCF [48] datasets. We also conduct experiments on these two datasets using the split from [69].
+
+Since our method's performance is competitive in both standard 1-shot 5-way setting and 5-shot 5-way setting, in this section we only demonstrate 1-shot
+
+results and place 5 shot results in the supplementary due to page limitation. Following previous works, we report the average result of 10,000 test episodes in the experiments.
+
+Baselines We compare our method with recent works reporting state-of-the-art performance, including MatchNet [52], CMN [73], OTAM [5], TRN [71], ARN [69], TRX [44], ITA-Net [70]. Following [74], we also compare with the few-shot image classification model FEAT [65] which is also based on transformers. Specifically, since no previous works used object detector in few-shot action recognition, for a fair comparison with previous works, we conduct experiments in two settings: (1) we give baseline methods the same input (both $\mathbf{F}_g$ and $\mathbf{F}_o$ ) as our method and compare the performance. We denote the baselines as "Baseline+" in this setting. (2) We discard the object detector in our method and use only $\mathbf{F}_g$ as input and $RET_{gg}$ as the encoder. We denote our method in this setting as "Ours".
+
+To enable previous methods to take object features as input, we choose to compare with methods TRX+, FEA $T+$ , and ITA-Net $^+$ because they also use transformer-based architectures like our method, thus no modification on the model architecture is needed. For completeness, we also compare MatchNet $^+$ and TRN $^+$ without transformer architecture. For these two methods, we reshape the object features $\pmb{F}_{o}$ to $\pmb{F}_{o}^{\prime} \in \mathbb{R}^{T \times Bd}$ as input. Since these two works are not designed to input the object features, we train an ensembled network, one with $\pmb{F}_{g}$ as input and the other with $\pmb{F}_{o}^{\prime}$ as input. We use the public implementation of TRX and implement ITA-Net by ourselves. More details about baseline implementation can be found in the supplementary material. Recently, several works [56,4,74] pretrain the backbone on the meta-training set and found this pretraining to be useful for few-shot action recognition. To compare with the majority of prior works, we do not follow this setting in our experiments.
+
+Implementation details We use ResNet-50 [23] pretrained on ImageNet [12] as the backbone of embedding network, and a fixed Mask-RCNN [22] trained on COCO dataset [35] is used as the bounding box extractor. We select $B = 3$ most confident object bounding boxes per frame. The pre-processing steps follow OTAM [5] where we also sample $T = 8$ frames with random crop during training and center crop during inference. The model and the backbone is optimized using SGD with an initial learning rate of 0.001 and decaying every 20 epochs by 0.1. The embedding network except its first BatchNorm layer is fine-tuned with 1/10 learning rate. The training is stopped when the loss on the validation set is greater than the average of the previous 5 epochs. Unless otherwise stated, we report result using $m_{g} = m_{f} = 8$ , $\lambda_{1} = \lambda_{2} = 0.5$ , $w_{1} = 1$ , $w_{2} = w_{3} = 0.1$ .
+
+# 4.1 Results
+
+Tab. 1 shows result comparison with baseline methods. In the upper block, our model slightly outperforms previous works even without using the object detector on 4 of the 5 dataset/splits. This suggests that compared with other
+
+Table 1. Results of 5-way 1-shot experiments on 5 dataset splits. Methods marked with * indicates results of our implementation with the original reported results shown in parenthesis. The bottom and upper block are results with and without using object features, respectively. For ITA-Net, result on SSv2° comes from Table 5 of [70].
+
+| Method | SSv2° | SSv2# | Kinetics | HMDB | UCF |
| MatchNet* [52] | 34.9 (31.3) | 35.1 | 54.6 (53.3) | 50.1 | 70.3 |
| CMN [73] | 36.2 | - | 60.5 | - | - |
| ARN [69] | - | - | 63.7 | 45.5 | 66.3 |
| OTAM [5] | - | 42.8 | 73.0 | - | - |
| TRN* [71,5] | 35.9 | 39.6 (38.6) | 68.6 (68.4) | 52.3 | 76.3 |
| FEAT* [65] | 38.4 | 45.5 | 73.0 | 56.1 | 75.8 |
| ITA-Net* [70] | 38.4 (38.6) | 46.1 | 72.6 | 56.5 | 76.0 |
| TRX* [44] | 37.1 (36.0) | 41.5 (42.0) | 64.6 (63.6) | 54.4 | 77.7 |
| Ours- | 38.9 | 49.3 | 73.3 | 60.1 | 71.4 |
| MatchNet+* | 35.6 | 36.5 | 57.6 | 52.8 | 72.8 |
| TRN+* | 38.1 | 41.3 | 71.4 | 55.3 | 79.7 |
| FEAT+* | 43.1 | 46.6 | 73.9 | 61.5 | 79.7 |
| ITA-Net+* | 43.7 | 48.9 | 74.4 | 61.6 | 79.5 |
| TRX+* | 39.4 | 44.2 | 71.8 | 60.1 | 81.2 |
| Ours | 57.1 | 59.6 | 81.0 | 80.3 | 79.0 |
+
+prototype generation methods, our proposed approach to generate and match the compound prototypes enables better similarity measurement for few-shot action recognition. From the comparison of baseline methods with their “+” variants, we can see that these methods cannot fully exploit the information brought by the object features. When object features are added as input, our full model significantly outperforms previous methods that use the same input. Compared with the performance of our method in the upper block, the object features significantly stimulates the potential of our proposed compound prototype matching scheme, by improving the accuracy on the SSv2 dataset for over $10\%$ , the Kinetics dataset for $7.7\%$ and the HMDB dataset for over $20\%$ . In the ablation study, we show even better performance can be achieved by carefully adjusting the number of prototypes $m_{g}$ and $m_{f}$ .
+
+Our method does not achieve state-of-the-art results on the UCF dataset. One reason is that classes in the UCF dataset can be easily distinguished only from appearance. This causes our multi-relation encoder to overfit. If we remove this encoder and directly use concatenation of object and global features as input to the compound prototype decoder, our method can achieve the state-of-the-art accuracy of 87.7. This reveals one limitation of our method, i.e., easy to overfit on simple datasets.
+
+# 4.2 Ablation Study
+
+Effect of object features While there exist previous studies that leverage additional information for few-shot action recognition [18], no work has invest
+
+Table 2. Results comparison of different methods when using/not using object information, and using/not using our proposed encoder.
+
+| Encoding | Prototype | SSv2° | SSv2# | Kinetics |
| Backbone only (w/o. object features) | None | 34.9 | 35.1 | 54.6 |
| ITA-Net | 38.4 | 45.5 | 72.6 |
| TRX | 37.1 | 41.5 | 64.6 |
| Ours | 37.9 | 48.5 | 72.5 |
| Our encoder (w/o. object features) | None | 35.3 | 37.2 | 59.4 |
| ITA-Net | 38.6 | 46.5 | 73.0 |
| TRX | 38.2 | 44.4 | 68.9 |
| Ours | 38.9 | 49.3 | 73.3 |
| Concat (w. object features) | None | 35.6 | 36.5 | 57.6 |
| ITA-Net+ | 43.7 | 48.9 | 74.4 |
| TRX+ | 39.4 | 44.2 | 71.8 |
| Ours | 42.1 | 49.1 | 79.2 |
| Our encoder (w. object features) | None | 39.1 | 42.5 | 58.4 |
| ITA-Net+ | 44.0 | 50.7 | 73.3 |
| TRX+ | 46.3 | 48.4 | 73.4 |
| Ours | 57.1 | 59.6 | 81.0 |
+
+Table 3. Results comparison of our model using different encoding relations with different number of global prototypes and focused prototypes.
+
+| Setting | Fgg | Fgo | Foo | SSv2# | Kinetics |
| mg=8,
+mf=8 | ✓ | × | × | 49.3 | 73.3 |
| × | ✓ | × | 47.3 | 69.1 |
| × | × | ✓ | 55.5 | 73.6 |
| ✓ | ✓ | × | 49.6 | 75.0 |
| ✓ | × | ✓ | 57.7 | 79.7 |
| × | ✓ | ✓ | 57.8 | 77.1 |
| ✓ | ✓ | ✓ | 59.6 | 81.0 |
| mg=16,
+mf=0 | ✓ | × | × | 38.9 | 65.5 |
| × | ✓ | × | 38.8 | 65.2 |
| × | × | ✓ | 38.5 | 64.0 |
| ✓ | ✓ | ✓ | 39.3 | 66.1 |
| mg=0,
+mf=16 | ✓ | × | × | 41.9 | 72.3 |
| × | ✓ | × | 34.4 | 73.7 |
| × | × | ✓ | 29.3 | 61.0 |
| ✓ | ✓ | ✓ | 44.0 | 76.7 |
+
+tigated the use of object features as in our method. One may argue that the performance improvement of our method only comes from the use of object features. However, in Tab. 1 we find that performance gain of previous methods is limited if object features are additionally used as input. Here, we show that a boost in performance only happens when object features, our multi-relation encoder, and our decoder are used together.
+
+We test the performance of multiple methods with and without using object information, and also with and without using our multi-relation encoder. In Tab. 2, the first block uses neither object feature nor our multi-relation encoder, and the second block uses our encoder but with only the global-global relation $RET_{gg}$ . From the comparison between these two blocks, we can see that our multi-relation encoder can improve the performance of all methods, but not significantly. In the third block of Tab. 2, we concatenate each frame-wise feature with its corresponding object features as input. The comparison between this block and the first block shows the improvement brought by object features: around $2 \sim 5$ percent on SSv2 dataset, and $2 \sim 6$ percent on Kinetics dataset. Finally, in the fourth block of Tab. 2, both object features and our multi-relation encoder are used. Comparing this block with the second and third blocks, all methods get more improvement. This shows that using our multi-relation encoder to consider multiple relations across frames can better leverage the information brought by the object features. Among all methods in the fourth block of Tab. 2, our method enjoys the most significant performance gain. This indicates that while the object features bring additional information, our method can best leverage this information to help the few-shot action recognition task.
+
+Impact of multi-relation feature encoding To see how does the multi-relation feature encoding contribute to the performance, we conduct ablation study of our method considering only subsets of $\{\pmb{F}_{gg},\pmb{F}_{go},\pmb{F}_{oo}\}$ . We also vary the number of global prototypes $m_{g}$ and focused prototypes $m_{f}$ to see the influence of feature encoding on each group of prototypes.
+
+Results can be seen in Tab. 3. From the experiments with $m_g = m_f = 8$ , the SSv2# dataset gets much improvement from the use of object-object feature $F_{oo}$ , while the Kinetics dataset benefits more from the global-global feature $F_{gg}$ . This is reasonable since SSv2 dataset includes more actions with multiple objects. From the experiments with $m_g = 16$ , the global prototypes seem to work equally well using the three encoded features on both datasets. The experiments with $m_f = 16$ suggest that focused prototypes work better with global-global relations. When using all three features (last row of each block), the comparison between different choices of $m_g$ and $m_f$ indicates that the two groups of prototypes capture complementary aspects of the action, since the performances got significantly improved when two groups of prototypes both present. A more detailed figure showing the accuracy difference of each action class can be found in the supplementary material.
+
+# 4.3 Analysis of compound prototypes
+
+The core of our proposed method is the generation and matching of compound prototypes. In this section we conduct extensive experiments to get a more comprehensive understanding of the two groups of prototypes.
+
+What aspect of the action does each prototype capture? We address this question by investigating the self-attention operation that generates the prototypes. From Equation 5, the self-attention weight $\alpha \in \mathbb{R}^{(B + 2)\times T}$ on each frame represents from which part of the video does each prototype gather its information. To better understand the prototypes, we visualize this attention in Fig. 2 using two 1-shot 2-way examples. In the visualization we average the $B + 2$ attention weights in each frame, forming $\tilde{\alpha}\in \mathbb{R}^T$ , and show this averaged value on each of the $T = 8$ frames. For clarity we only show 2 global prototypes and 2 focused prototypes in each video. We also show the video similarity scores and the similarity of matched prototypes at the bottom of the figure.
+
+The visualization is shown in Fig. 2. We first analyze the attention of each prototype. In all videos, the global prototype $\pmb{p}_{g,2}$ have high attention weights on the start of the action (not the start of the video), and $\pmb{p}_{g,6}$ pays more attention to the frames that contain appearance change compared with other frames (no hand existence). This is expected since $L_{div}$ forces each global prototype to be different, while the 1-to-1 matching encourages each global prototype to focus on similar aspects so that correct video similarity can be predicted. For the focused prototypes, $\pmb{p}_{f,1}$ usually gives high attention to the last few frames, and $\pmb{p}_{f,2}$ pays more attention on the middle frames. This is also expected since $L_{att}$ refrains the focused prototypes to attend on similar temporal locations, and
+
+
+(a) Query: pretend to take something from somewhere
+
+
+(b) Support: pretend to take something from somewhere
+
+
+(c) Support: opening something
+Fig. 2. Visualization of the self-attention weight of two global prototypes and two focused prototypes on each timestamp of the input. Attention weights higher than average (0.125) are marked in black. We can see the global prototypes capture a certain aspect of the action in the video, regardless of temporal location: $\pmb{p}_{g,2}$ - the start of the action; $\pmb{p}_{g,6}$ - the frames without hand. Meanwhile, the focused prototypes mainly attend on fixed timestamps of the video: $\pmb{p}_{f,1}$ - the end of the video; $\pmb{p}_{f,2}$ - the middle part of the video. Example to the left comes from the SSv2° dataset and the example to the right is from SSv2#. Video similarity scores $s$ and similarity scores of matched prototypes $\pmb{p}_* \sim \pmb{p}_*$ are shown at the bottom.
+
+
+(x) Query: Tipping something over
+
+
+(y) Support: Tipping something over
+
+
+(z) Support: Lifting up one end of something
+
+bipartite matching allows similar actions to be matched even when they are at different temporal locations of the videos. A similar phenomenon exists in the object detection task [6], where each object query focuses on detecting objects in a specific spatial location of the image.
+
+In the left example, both the prototype pairs $< \pmb{p}_{g,2}^{a}, \pmb{p}_{g,2}^{b} >$ and $< \pmb{p}_{g,6}^{a}, \pmb{p}_{g,6}^{b} >$ have high similarity scores (0.53 and 0.49 shown at the bottom of the left example). This indicates that video $a$ and $b$ have similar starts, and the intra-video appearance change is also similar. Thus the query action is correctly classified as "Pretending to take something from somewhere". In the right example, we can see the effectiveness of the focused prototypes. By Hungarian matching, $\pmb{p}_{f,1}^{x}$ is matched with $\pmb{p}_{f,2}^{y}$ . Since they both encode the frames where the hands just tip the objects over, these two prototypes give high similarities, enabling the query action of "Tipping something over" to be correctly recognized.
+
+A statistical analysis of self-attention weights can be found in Fig. 3 showing the average response of the first 4 global prototypes and the first 4 focused prototypes on all videos of the test set. As a result of the loss functions $L_{div}, L_{att}$ and the matching strategies, on both SSv2# and Kinetics datasets, $P_g$ (first 4 rows)
+
+
+Fig.3. Visualization of self-attention weights of $P_{s}$ and $P_{d}$ for all samples on the test set of $\mathrm{SSv2^{\sharp}}$ and Kinetics datasets.
+
+
+Fig. 4. Performance on the $\mathrm{SSv2^{\sharp}}$ and Kinetics datasets when changing the number of global/focused prototypes.
+
+
+
+have a more uniform attention distribution, while $\pmb{P_f}$ have obvious temporal regions of focus. The diversity of the prototypes ensures a robust representation of the videos, thus similarity between videos can be better computed during the few-shot learning process.
+
+How much does each group of prototype contribute? To find the answer, we test our method using different numbers of prototypes ( $m_g$ and $m_f$ ) and show the results in Fig. 4. Although the best combination of $m_g$ and $m_f$ are different for each dataset, the performance gets better when the number of prototypes increases, and after a certain threshold, the result saturates because of the overfitting on the training data. Best results on both $\mathrm{SSv2}^{\sharp}$ (62.0) and Kinetics (86.9) datasets are achieved when $m_f$ is larger than $m_g$ . Although $m_g = m_f = 8$ is not the optimal setting, we apply this setting in Sec. 4.1 and Sec. 4.2 since it is the most stable setting on all datasets. A method to automatically choose the number of prototypes is left for our future work.
+
+Also, we show the class accuracy improvement when our method uses both groups of prototypes compared with our method using only one group of prototype. In Fig. 5, orange bars denote the accuracy difference between the $m_g = m_f = 8$ setting and the $m_g = 16$ , $m_f = 0$ setting, which indicates the performance gain by introducing the focused prototypes. Blue bars, on the other hand, show the accuracy improvement brought by the global prototypes. We can see on the SSv2# dataset that when combining the two groups of prototypes, some hard classes like "pulling S out of S", "pulling S from left to right" and "pushing S from right to left" can be better distinguished. From the results of the two datasets, we observe the focused prototypes are more effective in the Kinetics dataset. This is because the Kinetics dataset focuses more on appearance, which can be better captured and compared by the focused prototypes.
+
+Will wrong bipartite matching destroy the temporal ordering of actions? Although we observe great performance gain brought by $P_{f}$ in Tab. 3 and Fig. 5, the bipartite matching will unavoidably produce some wrongly matched prototype pairs when creating the correct matchings. Our additional experi
+
+
+
+
+Fig. 5. Class accuracy improvement when our method uses $m_g = m_f = 8$ prototypes compared to: orange bars: $m_g = 16$ , $m_f = 0$ ; blue bars: $m_g = 0$ , $m_f = 16$ . S stands for the abbreviation of "something".
+
+ments in the supplementary show that filtering the matched prototypes with low similarity negatively affects the convergence of the model. One reason is that positional encoding implicitly encodes the temporal ordering of the frames within each prototype. During training, the similarity scores of all the wrong matching pairs are learned to be small and so that the final similarity score can be dominated by the similarity score of the correctly matched prototype pairs.
+
+# 5 Conclusion
+
+In this work, we introduce a novel method for few-shot action recognition by generating global and focused prototypes and compare video similarity based on the prototypes. When generating the prototypes, we encode spatiotemporal object relations to address the actions that involve multiple objects. The two groups of prototypes are encouraged to capture different aspects of the input by different loss functions and matching strategies. In our future work, we will explore a more flexible prototype matching strategy that can avoid the mismatch in the bipartite matching.
+
+Acknowledgement This work is supported by JSPS KAKENHI Grant Number JP22K17905, JP20H04205 and JST AIP Acceleration Research Grant Number JPMJCR20U1.
+
+# References
+
+1. Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M.W., Pfau, D., Schaul, T., Shillingford, B., De Freitas, N.: Learning to learn by gradient descent by gradient descent. In: NeurIPS (2016) 3
+2. Antoniou, A., Edwards, H., Storkey, A.: How to train your maml. ICML (2019) 3
+3. Bishay, M., Zoumpourlis, G., Patras, I.: Tarn: Temporal attentive relation network for few-shot and zero-shot action recognition. BMVC (2019) 3
+4. Cao, C., Li, Y., Lv, Q., Wang, P., Zhang, Y.: Few-shot action recognition with implicit temporal alignment and pair similarity optimization. CVIU (2021) 8
+5. Cao, K., Ji, J., Cao, Z., Chang, C.Y., Niebles, J.C.: Few-shot video classification via temporal alignment. In: CVPR (2020) 2, 3, 4, 7, 8, 9
+6. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: ECCV (2020) 4, 6, 12
+7. Carreira, J., Zisserman, A.: Quo vadis, action recognition? a new model and the kinetics dataset. In: CVPR (2017) 3, 7
+8. Chang, C.Y., Huang, D.A., Sui, Y., Fei-Fei, L., Niebles, J.C.: D3tw: Discriminative differentiable dynamic time warping for weakly supervised action alignment and segmentation. In: CVPR (2019) 3
+9. Chao, Y.W., Vijayanarasimhan, S., Seybold, B., Ross, D.A., Deng, J., Sukthankar, R.: Rethinking the faster r-cnn architecture for temporal action localization. In: CVPR (2018) 2
+0. Chowdhury, A., Jiang, M., Chaudhuri, S., Jermaine, C.: Few-shot image classification: Just use a library of pre-trained feature extractors and a simple classifier. In: ICCV (2021) 1
+1. Cong, Y., Liao, W., Ackermann, H., Rosenhahn, B., Yang, M.Y.: Spatial-temporal transformer for dynamic scene graph generation. In: ICCV (2021) 6
+2. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR (2009) 8
+3. Deng, J., Yang, Z., Chen, T., Zhou, W., Li, H.: Transvg: End-to-end visual grounding with transformers. ICCV (2021) 4
+4. Dhillon, G.S., Chaudhari, P., Ravichandran, A., Soatto, S.: A baseline for few-shot image classification. ICLR (2019) 3
+5. Doersch, C., Gupta, A., Zisserman, A.: Crosstransformers: spatially-aware few-shot transfer. NeurIPS (2020) 4
+6. Fan, Q., Zhuo, W., Tang, C.K., Tai, Y.W.: Few-shot object detection with attention-rpn and multi-relation detector. In: CVPR (2020) 1
+7. Finn, C., Abbeel, P., Levine, S.: Model-agnostic meta-learning for fast adaptation of deep networks. In: International Conference on Machine Learning. PMLR (2017) 3, 4
+8. Fu, Y., Zhang, L., Wang, J., Fu, Y., Jiang, Y.G.: Depth guided adaptive meta-fusion network for few-shot video recognition. In: ACM MM (2020) 1, 3, 9
+9. Goyal, R., Ebrahimi Kahou, S., Michalski, V., Materzynska, J., Westphal, S., et al.: "The" something something" video database for learning and evaluating visual common sense. In: ICCV (2017) 3, 7
+20. Grauman, K., Westbury, A., Byrne, E., et al.: Ego4d: Around the world in 3,000 hours of egocentric video. arXiv preprint arXiv:2110.07058 (2021) 1
+21. Gui, L.Y., Wang, Y.X., Ramanan, D., Moura, J.M.: Few-shot human motion prediction via meta-learning. In: ECCV (2018) 3
+
+22. He, K., Gkioxari, G., Dollár, P., Girshick, R.: Mask r-cnn. In: ICCV (2017) 2, 3, 4, 5, 8
+23. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016) 8
+24. Hong, J., Fisher, M., Gharbi, M., Fatahalian, K.: Video pose distillation for few-shot, fine-grained sports action recognition. In: ICCV (2021) 3
+25. Huang, Y., Cai, M., Li, Z., Sato, Y.: Predicting gaze in egocentric video by learning task-dependent attention transition. In: ECCV (2018) 1
+26. Kang, B., Liu, Z., Wang, X., Yu, F., Feng, J., Darrell, T.: Few-shot object detection via feature reweighting. In: ICCV (2019) 1
+27. Kang, D., Kwon, H., Min, J., Cho, M.: Relational embedding for few-shot classification. In: ICCV (2021) 3
+28. Kliper-Gross, O., Hassner, T., Wolf, L.: One shot similarity metric learning for action recognition. In: SIMBAD (2011) 1
+29. Koch, G., Zemel, R., Salakhutdinov, R., et al.: Siamese neural networks for one-shot image recognition. In: ICML (2015) 3
+30. Kuehne, H., Jhuang, H., Garrote, E., Poggio, T., Serre, T.: Hmdb: a large video database for human motion recognition. In: ICCV (2011) 3, 7
+31. Kuhn, H.W.: The hungarian method for the assignment problem. Naval research logistics quarterly (1955) 7
+32. Kumar Dwivedi, S., Gupta, V., Mitra, R., Ahmed, S., Jain, A.: Protagan: Towards few shot learning for action recognition. In: CVPRW (2019) 3
+33. Li, H., Eigen, D., Dodge, S., Zeiler, M., Wang, X.: Finding task-relevant features for few-shot learning by category traversal. In: CVPR (2019) 1
+34. Li, S., Liu, H., Qian, R., Li, Y., See, J., Fei, M., Yu, X., Lin, W.: Ta2n: Two-stage action alignment network for few-shot action recognition. arXiv preprint arXiv:2107.04782 (2021) 2, 3
+35. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dólar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: ECCV (2014) 8
+36. Liu, W., Zhang, C., Lin, G., Liu, F.: Crnet: Cross-reference networks for few-shot segmentation. In: CVPR (2020) 1
+37. Liu, Y., Zhang, X., Zhang, S., He, X.: Part-aware prototype network for few-shot semantic segmentation. In: ECCV (2020) 1
+38. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. ICCV (2021) 4, 6
+39. Lu, Z., He, S., Zhu, X., Zhang, L., Song, Y.Z., Xiang, T.: Simpler is better: Few-shot semantic segmentation with classifier weight transformer. In: ICCV (2021) 6
+40. Luo, Z., Guillory, D., Shi, B., Ke, W., Wan, F., Darrell, T., Xu, H.: Weakly-supervised action localization with expectation-maximization multi-instance learning. In: ECCV (2020) 2
+41. Ma, J., Gorti, S.K., Volkovs, M., Yu, G.: Weakly supervised action selection learning in video. In: CVPR (2021) 2
+42. Mishra, A., Verma, V.K., Reddy, M.S.K., Arulkumar, S., Rai, P., Mittal, A.: A generative approach to zero-shot and few-shot action recognition. In: WACV (2018) 3
+43. Patravali, J., Mittal, G., Yu, Y., Li, F., Chen, M.: Unsupervised few-shot action recognition via action-appearance aligned meta-adaptation. In: ICCV (2021) 3
+
+44. Perrett, T., Masullo, A., Burghardt, T., Mirmehdi, M., Damen, D.: Temporal-relational crosstransformers for few-shot action recognition. In: CVPR (2021) 2, 3, 4, 8, 9
+45. Qiao, S., Liu, C., Shen, W., Yuille, A.L.: Few-shot image recognition by predicting parameters from activations. In: CVPR (2018) 3
+46. Ravi, S., Larochelle, H.: Optimization as a model for few-shot learning. ICLR (2017) 3
+47. Snell, J., Swersky, K., Zemel, R.S.: Prototypical networks for few-shot learning. NeurIPS (2017) 1, 3
+48. Soomro, K., Zamir, A.R., Shah, M.: Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402 (2012) 7
+49. Sun, R., Li, Y., Zhang, T., Mao, Z., Wu, F., Zhang, Y.: Lesion-aware transformers for diabetic retinopathy grading. In: CVPR (2021) 6
+50. Thatipelli, A., Narayan, S., Khan, S., Anwer, R.M., Khan, F.S., Ghanem, B.: Spatio-temporal relation modeling for few-shot action recognition. arXiv preprint arXiv:2112.05132 (2021) 3
+51. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: NeurIPS (2017) 2, 4, 5, 6
+52. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. NeurIPS (2016) 3, 4, 8, 9
+53. Wang, H., Zhang, X., Hu, Y., Yang, Y., Cao, X., Zhen, X.: Few-shot semantic segmentation with democratic attention networks. In: ECCV (2020) 1
+54. Wang, K., Liew, J.H., Zou, Y., Zhou, D., Feng, J.: Panet: Few-shot image semantic segmentation with prototype alignment. In: ICCV (2019) 1
+55. Wang, L., Xiong, Y., Wang, Z., Qiao, Y., Lin, D., Tang, X., Van Gool, L.: Temporal segment networks: Towards good practices for deep action recognition. In: ECCV (2016) 5
+56. Wang, X., Ye, W., Qi, Z., Zhao, X., Wang, G., Shan, Y., Wang, H.: Semantic-guided relation propagation network for few-shot action recognition. In: ACM MM (2021) 3, 8
+57. Wang, X., Huang, T.E., Darrell, T., Gonzalez, J.E., Yu, F.: Frustratingly simple few-shot object detection. ICML (2020) 3
+58. Wei, X.S., Wang, P., Liu, L., Shen, C., Wu, J.: Piecewise classifier mappings: Learning fine-grained learners for novel categories with few examples. TIP (2019) 3
+59. Xian, Y., Korbar, B., Douze, M., Schiele, B., Akata, Z., Torresani, L.: Generalized many-way few-shot video classification. In: ECCV (2020) 3
+60. Xian, Y., Korbar, B., Douze, M., Torresani, L., Schiele, B., Akata, Z.: Generalized few-shot video classification with video retrieval and feature generation. TPAMI (2021) 3
+61. Xu, B., Ye, H., Zheng, Y., Wang, H., Luwang, T., Jiang, Y.G.: Dense dilated network for few shot action recognition. In: ICMR (2018) 3
+62. Xu, C., Fu, Y., Liu, C., Wang, C., Li, J., Huang, F., Zhang, L., Xue, X.: Learning dynamic alignment via meta-filter for few-shot learning. In: CVPR (2021) 1
+63. Xu, M., Zhao, C., Rojas, D.S., Thabet, A., Ghanem, B.: G-tad: Sub-graph localization for temporal action detection. In: CVPR (2020) 6
+64. Yang, J., Li, C., Zhang, P., Dai, X., Xiao, B., Yuan, L., Gao, J.: Focal self-attention for local-global interactions in vision transformers. NeurIPS (2021) 4
+65. Ye, H.J., Hu, H., Zhan, D.C., Sha, F.: Few-shot learning via embedding adaptation with set-to-set functions. In: CVPR. pp. 8808-8817 (2020) 4, 8, 9
+
+66. Zeng, R., Huang, W., Tan, M., Rong, Y., Zhao, P., Huang, J., Gan, C.: Graph convolutional networks for temporal action localization. In: ICCV (2019) 6
+67. Zhang, C., Cai, Y., Lin, G., Shen, C.: Deepemd: Few-shot image classification with differentiable earth mover's distance and structured classifiers. In: CVPR (2020) 3
+68. Zhang, C., Gupta, A., Zisserman, A.: Temporal query networks for fine-grained video understanding. In: CVPR (2021) 4
+69. Zhang, H., Zhang, L., Qi, X., Li, H., Torr, P.H., Koniusz, P.: Few-shot action recognition with permutation-invariant attention. In: ECCV (2020) 3, 7, 8, 9
+70. Zhang, S., Zhou, J., He, X.: Learning implicit temporal alignment for few-shot video classification. *IJCAI* (2021) 2, 3, 8, 9
+71. Zhou, B., Andonian, A., Oliva, A., Torralba, A.: Temporal relational reasoning in videos. In: ECCV (2018) 8, 9
+72. Zhu, L., Yang, Y.: Compound memory networks for few-shot video classification. In: ECCV (2018) 3, 7
+73. Zhu, L., Yang, Y.: Label independent memory for semi-supervised few-shot video classification. TPAMI (2020) 1, 3, 8, 9
+74. Zhu, X., Toisoul, A., Perez-Rua, J.M., Zhang, L., Martinez, B., Xiang, T.: Few-shot action recognition with prototype-centered attentive learning. BMVC (2021) 1, 3, 8
+75. Zhu, Z., Wang, L., Guo, S., Wu, G.: A closer look at few-shot video classification: A new baseline and benchmark. BMVC (2021) 3
\ No newline at end of file
diff --git a/compoundprototypematchingforfewshotactionrecognition/images.zip b/compoundprototypematchingforfewshotactionrecognition/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f35c3be06cb1fbcaf9392d377cd145b91a7aaba0
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3039846fa00b4116de9d2022e4f47e282b6b9792e3014e5e7ea0478875a7c9b0
+size 446112
diff --git a/compoundprototypematchingforfewshotactionrecognition/layout.json b/compoundprototypematchingforfewshotactionrecognition/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5b772e0e6d05cacf6b5aa13562cc0c08dc8d2788
--- /dev/null
+++ b/compoundprototypematchingforfewshotactionrecognition/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f15f0940829974d1238ba82f0a7bd8ebd203de79e137e60fc7e00ecd5c1c4293
+size 510359
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_content_list.json b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ffdff029b9da0dd2045d437c7a3865dabe70ff5b
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0250a154d71abfe80bda6ae2207b5c47dad76f88c3f7566851b46e93c14d1fbf
+size 80924
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_model.json b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..dbd99b0f9242c505851433b7341bade7f23ec711
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fe4b6a72a68f9ad81baae5b315df3b458e639be551cdd5ba3d0c45fbead18e34
+size 97543
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_origin.pdf b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c3c28d62c963c2f54b23b4fb652cdea8c4cc71f0
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/646c15b0-febd-4ae2-a73f-0b867dff21f7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0b7d6105d17fc53504acca32ffe43044179151582559905f50bab364e0c969e4
+size 5710811
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/full.md b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..de6fe8d6d581d9c57c815b7dde31412d839f3772
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/full.md
@@ -0,0 +1,258 @@
+# ConCL: Concept Contrastive Learning for Dense Prediction Pre-training in Pathology Images
+
+Jiawei Yang $^{1,2,\star}$ , Hanbo Chen $^{1,\star\star}$ , Yuan Liang $^{2}$ , Junzhou Huang $^{3}$ , Lei He $^{2}$ , and Jianhua Yao $^{1,\star\star}$
+
+Tencent AI Lab
+
+$^{2}$ University of California, Los Angeles
+
+3 University of Texas at Arlington
+
+jiawei118@ucla.edu
+
+Abstract Detecting and segmenting objects within whole slide images is essential in computational pathology workflow. Self-supervised learning (SSL) is appealing to such annotation-heavy tasks. Despite the extensive benchmarks in natural images for dense tasks, such studies are, unfortunately, absent in current works for pathology. Our paper intends to narrow this gap. We first benchmark representative SSL methods for dense prediction tasks in pathology images. Then, we propose concept contrastive learning (ConCL), an SSL framework for dense pre-training. We explore how ConCL performs with concepts provided by different sources and end up with proposing a simple dependency-free concept generating method that does not rely on external segmentation algorithms or saliency detection models. Extensive experiments demonstrate the superiority of ConCL over previous state-of-the-art SSL methods across different settings. Along our exploration, we distill several important and intriguing components contributing to the success of dense pre-training for pathology images. We hope this work could provide useful data points and encourage the community to conduct ConCL pre-training for problems of interest. Code is available at https://github.com/TencentAILabHealthcare/ConCL.
+
+Keywords: Pathology image analysis $\cdot$ Whole slide image $\cdot$ Self-supervised learning $\cdot$ Object detection $\cdot$ Instance segmentation $\cdot$ Pre-training
+
+# 1 Introduction
+
+Computational pathology is an emerging area in modern healthcare. More whole slide images (WSIs) are now analyzed by deep learning (DL) models [29]. To alleviate the heavy annotation burden required by DL models, reusing weights from pre-trained models has become a common practice. Besides transferring from fully-supervised models, recent attention has been attracted to self-supervised
+
+
+Figure 1: (a) Example pathology images with tissue class names. (b,c) Comparisons of pre-trained models by fine-tuning on the GlaS [28] and CRAG [9] datasets. The detector is Mask-RCNN [14] with a ResNet-18 backbone [15], and an FPN head[20]. Results are averaged over 5 independent runs.
+
+
+
+
+
+learning (SSL) methods [12,3,10]. They are annotation-free but can achieve comparable or even better performance when transferring.
+
+The breakthrough of SSL methods starts with contrastive learning [11,34,3,12,4], where the most popular task is instance discrimination [34]. It requires a model to discriminate among individual instances. To achieve that, it first defines some positive pairs and negative pairs. It then optimizes a model to maximize the representation similarity between positive pairs and minimize it between negative pairs. Later, more SSL methods based on cross-view prediction are proposed, e.g., [2,10,3,38]. However, these methods are optimized for image-level representations and might be sub-optimal for dense prediction tasks such as object detection and instance segmentation. This motivates works for detection-friendly pre-training methods, e.g., DenseCL [33], InsLoc [37], Self-EMD [22], SCRL [27], and more [16,30,35,36]. Despite many interests raised in the natural image domain for dense prediction problems, such studies, which are of important clinical and practical values, are absent in the pathology image domain. Our research is intended to bridge the gap between SSL in natural images and pathology images for dense prediction tasks, as well as to distill the key components to the success of dense pre-training in the pathology data.
+
+To that end, we start by presenting a general Concept Contrastive Learning (ConCL) framework. Rather than contrasting image-level representations [34,3,12], it contrasts "concepts" that mark different local (semantic) regions. ConCL is an abstraction of dense contrasting frameworks that can resemble most concurrent related works. We first benchmark current leading image-level SSL methods and a grid-level dense SSL method (i.e., DenseCL [33]) in two public datasets. We observe a considerable performance gap between DenseCL [33] and the others. These gaps indicate the importance of contrasting densely (grid-level) than roughly (image-level). Then, directed by the performance differences and the characteristics of pathology images, we gradually develop and improve ConCL via a series of explorations. Specifically, we explore: 1) what makes the success
+
+of dense prediction pre-training? 2) what kind of concepts are good for pathology images? The nature of having rich low-level patterns in pathology images (see Fig. 1-(a)) gives some surprising and intriguing results, e.g., a randomly initialized model can group meaningful concepts and help dense pre-training. Along the exploration, we distill several key components contributing to the transferring performance for dense tasks. At the end of exploration, the presented ConCL can surpass various state-of-the-art SSL methods by solid and consistent margins across different downstream datasets, detector architectures, fine-tuning schedules, and pre-training epochs. For example, as shown in Figure 1-(b), the 200-epoch pre-trained ConCL wins all the other methods but with $4 \times$ to $8 \times$ fewer epochs. To summarize, this paper makes the following contributions:
+
+- It makes one of the earliest attempts to systematically study and benchmark self-supervised learning methods for dense prediction problems in pathology images, which are of high practical and clinical interest but, unfortunately, absent in existing works. We hope this work could narrow the gap between studies in natural images and pathology images.
+- It presents ConCL, an SSL framework for dense pre-training. We show how ConCL performs with concepts provided by different sources and find that a randomly initialized model could learn semantic concepts and improve itself without expert-annotation or external algorithms while achieving competitive, if not the best, results.
+- It shows how important the dense pre-training is in pathology images for dense tasks and provides some intriguing observations that could contribute to other applications such as few-shot and semi-supervised segmentation and detection, or more, in pathology image analysis or beyond.
+
+We hope this work could provide useful data points and encourage the community to conduct ConCL pre-training for problems of interest.
+
+# 2 Related work
+
+Contrastive learning. The success of deep learning is mainly attributed to mining a large amount of data. When limited data is provided for specific tasks, an alternative is to transfer knowledge by re-using pre-trained models [8,13]. SSL methods learn good pre-trained models from label-free pretext tasks, e.g., colorization [39,40], denoising [31], and thus attract much attention. Recently, contrastive learning [12,4,3,24,34,2], a typical branch of SSL, has made significant progress in many fields, where instance discrimination [11,34,12,4,3] serves as a pretext task. It requires a model to discriminate among individual instances, i.e., image-level representations [34]. MoCo [12,4] and SimCLR[3] are two representatives. Specifically, they generate two views of the same image via random data augmentations (e.g., color jittering, random cropping) and mark them as a positive pair. Then, views from other different images are marked as negative instances or pairs. After that, they learn embeddings by maximizing the similarity between the representations of positive pairs while minimizing it between
+
+the representations of negative pairs. Later methods combine contrasting with clustering, e.g., SwAV[2] proposes to contrast views' cluster assignments, and PCL [19] contrasts instances with cluster prototypes.
+
+Dense prediction pre-training. Despite their success in transferring to classification tasks, good image-level representations do not necessarily result in better performance in dense prediction tasks. Therefore, recent efforts have been made for dense prediction pre-training. Related works are mostly concurrent [33,37,27,30,35,36,22,16]. Among them, DenseCL [33] learns the correspondence among pixels of a positive pair and optimizes a pairwise contrastive loss at a pixel level, yielding a dense contrasting behavior. Self-EMD [22] does dense predicting in a non-contrastive manner as in BYOL [10], i.e., predicting a grid-level feature vector from one view when given its counterpart from another (positive) view. SCRL [27] argues the importance of spatially consistent representations, so it maximizes the similarity of box region features in the intersected area. The most relevant works concurrent to ours are [16,30]. They also optimize contrastive loss over mask-averaged representations. Those masks are generated by external algorithms that are successful for natural images, e.g., Felzenszwalb-Huttenlocher algorithm [7], or models, e.g., MCG[1], BASNet[25], and DeepUSPS[23]. However, the success of such mask generators is unfortunately unverified in pathology images. In this paper, we provide some of their empirical results. Their different performances yield the disparity between natural and pathology images, from which we are motivated to propose a dependency-free concept mask generator. It directly bootstraps the structural concepts inherent in pathology images, learns from scratch, and has better potential.
+
+SSL in pathology images. Studying SSL methods in pathology images is still at an early stage. In addition to studies on natural images, SimCLR [3] is also studied and benchmarked for classification, regression, and segmentation tasks in pathology images [6]. Some domain-specific self-supervised pretext tasks, e.g., magnification prediction, JigMag prediction, and hematoxylin channel prediction, are proposed and studied [18]. However, despite interest raised in natural images for dense problems, existing works have not studied, to our knowledge, detection/segmentation-friendly SSL methods in pathology images. Our work aims to bridge this gap and provide our exploration roadmap toward better dense prediction performance for pathology images.
+
+# 3 Method
+
+# 3.1 Preliminary: Instance Contrastive Learning
+
+MoCo[12] abstracts the instance discrimination task as a dictionary look-up problem. Specifically, for each encoded query $q$ , there is a set of encoded keys $\{k_0, k_1, k_2, \ldots\}$ in a dictionary. The instance discrimination task is to pull closer $q$ and its matched positive key $k_+$ in the dictionary while spreading $q$ away from all
+
+
+Figure 2: ConCL overview. ConCL has three steps: (1) Given a query view $x_{q}$ and a key view $x_{k}$ , their union region is cropped as a reference view $x_{r}$ . ConCL obtains concept proposals by processing $x_{r}$ with a "concept generator." (2) For the shared concepts, ConCL computes their representations via masked average pooling (MAP). (3) ConCL optimizes concept contrastive loss (Eq. (2)), and ensembles the concept prototypes from the key encoder to the concept queue.
+
+other negative keys $k_{-}$ . When using the dot-product as similarity measurement, a form of contrastive loss function based on InfoNCE[24] becomes:
+
+$$
+L _ {q} = - \log \frac {\exp (q \cdot k _ {+} / \tau)}{\exp (q \cdot k _ {+} / \tau) + \sum_ {k _ {-}} \exp (q \cdot k _ {-} / \tau)} \tag {1}
+$$
+
+where $\tau$ is a temperature hyper-parameter [34]. Queries $q$ and keys $k$ are computed by a query encoder and a key encoder, respectively [12,4]. Formally, $q = h(\mathsf{GAP}(f_5(x_q)))$ , where $h$ is a MLP projection head as per [3]; $\mathsf{GAP}(\cdot)$ denotes global-average-pooling, and $f_{5}(x)$ represents the outputs from the stage-5 of a ResNet [15]. Keys $k$ are computed similarly using the key encoder. In MoCo [12], the negative keys are stored in a queue to avoid using large batches [3].
+
+# 3.2 Concept Contrastive Learning
+
+Instance contrastive methods [3,12,34] do well in discriminating among image-level instances, but dense prediction tasks usually require discriminating among local details, e.g., object instances or object parts. We abstract such local details, or say, fine-grained semantics as "concepts." A concept does not necessarily represent an object. Instead, any sub-region in an image could be a concept since it contains certain different semantics. From the perspective of dense prediction, it is desirable to build concept-sensitive representations. For example, one WSI patch usually contains multiple small objects, e.g., nucleus, glands, and multiple texture-like tissues, e.g., mucus [29,17]. To successfully detect and segment objects in such images, models need to learn more information from local details. To
+
+this end, we propose a simple but effective framework — **Concept Contrastive Learning** (ConCL). Figure 2 shows its overview, which we elaborate on below.
+
+Concept discrimination. We first define a pretext task named concept discrimination. Similar to instance discrimination [34,11], concept discrimination requires a model to discriminate among the representations of the same but augmented concepts and the representations of different concepts. We formulate concept discrimination by extending the instance-level queries and keys to concept-level. Specifically, given an encoded query concept $q^{c}$ and a set of encoded key concepts $\{k_0^c, k_1^c, k_2^c, \ldots\}$ , we derive concept contrastive loss as:
+
+$$
+L _ {c} = - \log \frac {\exp \left(q ^ {c} \cdot k _ {+} ^ {c} / \tau\right)}{\exp \left(q ^ {c} \cdot k _ {+} ^ {c} / \tau\right) + \sum_ {k _ {-} ^ {c}} \exp \left(q ^ {c} \cdot k _ {-} ^ {c} / \tau\right)} \tag {2}
+$$
+
+where $\tau$ is the same temperature parameter and $k_{-}^{c}$ are keys in the concept queue — the queue to store concept representations. This objective brings representations of different views of the same concept closer and spreads representations of views from different concepts apart.
+
+Concept mask proposal. We use masks to annotate fine-grained concepts explicitly. Assume a mask generator is given, as diagramed at the bottom of Figure 2; we first pass a reference view $x_{r}$ , defined as the circumscribed rectangle crop of the union of two views, into the mask generator to obtain a set of concept masks — $\mathcal{M}_r = \{m_i\}_{i=1}^K$ , where $K$ is the number of concepts. Since the reference view contains both the query view and the key view, their concept masks $\mathcal{M}_q$ and $\mathcal{M}_k$ are immediately obtained if we restore them in the reference view. Then, we derive concept representations in both views by masked average pooling (MAP) with resized concept masks. Specifically, we compute $q^{c} = h(\mathrm{MAP}(f_{5}(x_{q}), m_{c}))$ and $k^{c}$ similarly, where $\mathrm{MAP}(z, m) = \sum_{ij} m_{ij} \cdot z_{ij} / \sum_{ij} m_{ij}$ , and $z \in \mathbb{R}^{CHW}$ denotes feature maps, $m \in \{0,1\}^{HW}$ is a binary indicator for each concept. Here, only the shared concepts in both views are considered, i.e., $m_{c} \in \mathcal{M}_{q} \cap \mathcal{M}_{k}$ .
+
+Our analysis hereafter focuses on 1) What makes the success of dense prediction pre-training? 2) What kind of concepts are good for pathology images? Different answers to these two questions reveal the characteristics of pathology images and the disparity between natural and pathology images, as we explore in Section 4. Below, we first introduce the benchmark pipeline and setups.
+
+# 3.3 Benchmark Pipeline
+
+Despite the extensive benchmarks in natural images for dense tasks, to our knowledge, such studies are unfortunately absent in current works for pathology. Note that studying SSL methods in pathology images is still at an early stage. Most current works focus on employing image-level SSL methods for classification tasks. Orthogonal to theirs, we investigate a wider range of SSL methods for object detection and instance segmentation tasks, which are of high clinical value. We hope our work could provide useful data points for future work.
+
+Implementations. For implementation details, please refer to Appendix B. We briefly introduce the datasets here and elaborate on them in Appendix C:
+
+- Pre-training dataset. We use NCT-CRC-HE-100K[17] dataset, referred to as NCT, for pre-training. It contains 100,000 non-overlapping patches extracted from hematoxylin and eosin (H&E) stained colorectal cancer and normal tissues. All images are of size $224 \times 224$ at 0.5 MPP ( $20 \times$ magnification). We randomly choose $80\%$ of NCT to be the pre-training dataset.
+- Transferring dataset. We use two public datasets, the gland segmentation in pathology images challenge (GlaS) dataset [28] and the colorectal adenocarcinoma gland (CRAG) dataset [9], and follow their official train/test splits for evaluation. GlaS [28] collects images of $775 \times 522$ from H&E stained slides with object-instance-level annotation; the images include both malignant and benign glands. CRAG [9] collects 213 H&E stained images taken from 38 WSIs with a pixel resolution of $0.55\mu \mathrm{m}$ /pixel at $20 \times$ magnification. Images are mostly of size $1512 \times 1516$ with object-instance-level annotation.
+
+We study the performance of object detection and instance segmentation.
+
+Experimental setup. We pre-train all the methods on the NCT training set for 200 epochs. For ConCL pre-training, we warm up the model by optimizing instance contrastive loss (Eq. (1)) for the first 20 epochs and switch to concept contrastive loss (Eq. (2)). Then, we use the pre-trained backbones to initialize the detectors, fine-tune them on the training sets of transferring datasets, and test them in the corresponding test sets. Unless otherwise specified, we run all the transferring experiments 5 times and report the averaged performance.
+
+# 4 Towards Better Concepts: a Roadmap
+
+In this section, we first benchmark some popular state-of-the-art SSL methods for dense pathology tasks. Then, we start with DenseCL [33] and derive better concepts along the way, directed by the questions raised in the previous section.
+
+# 4.1 Benchmarking SSL methods for Dense Pathology Tasks
+
+Benchmark results. Table 1 (baselines and prior SSL arts) shows the transferring performance for GlaS dataset (left columns) and CRAG dataset (right columns), respectively. We report results using 200-epoch pre-trained models and a $1 \times$ fine-tuning schedule. On the GlaS dataset [28], we observe that the gap between training from randomly initialized models and training from supervised pre-trained models is relatively smaller compared to those in the natural image domain [5,4,10,3]. Nonetheless, state-of-the-art SSL methods all exceed supervised pre-training, meeting the same expectation as in natural images. Yet, on the CRAG dataset [9], most of the pre-trained models, including both the self-supervised ones and the supervised one, fail to achieve competitive performance
+
+| Category | Methods | GlaS | CRAG |
| Detect APbb | APbb75 | Segment APmk | APmk75 | Detect APbb | APbb75 | Segment APmk | APmk75 |
| Baselines | Rand. Init. | 49.8 | 57.3 | 52.1 | 60.7 | 51.1 | 57.0 | 50.6 | 57.3 |
| Supervised | 50.2 | 56.9 | 53.2 | 62.1 | 49.2 | 55.2 | 49.4 | 55.0 |
| Sec. 4.1 | SimCLR[3] | 50.7 | 56.9 | 53.6 | 62.7 | 49.2 | 54.8 | 49.1 | 54.7 |
| BYOL[10] | 50.9 | 57.7 | 53.9 | 62.6 | 49.9 | 55.8 | 49.3 | 55.3 |
| PCL-v2† [19] | 49.4 | 55.9 | 51.9 | 61.0 | 51.0 | 56.6 | 50.5 | 56.7 |
| Prior SSL arts | MoCo-v1[12] | 50.0 | 56.2 | 52.1 | 59.9 | 47.2 | 51.1 | 47.5 | 52.0 |
| MoCo-v2[4] | 52.3 | 60.0 | 55.3 | 65.0 | 50.0 | 55.7 | 50.3 | 56.8 |
| DenseCL[33] | 53.9 | 62.0 | 56.5 | 66.2 | 52.3 | 58.2 | 52.2 | 59.8 |
| Our differently instantiated ConCLs: |
| Sec. 4.2 | (1) g-ConCL(s=3) | 54.9 | 64.1 | 57.1 | 66.3 | 55.4 | 62.3 | 54.4 | 62.0 |
| (2) g-ConCL(s=5) | 55.4 | 65.2 | 57.4 | 67.2 | 55.5 | 62.7 | 54.6 | 62.2 |
| (3) g-ConCL(s=7) | 54.9 | 63.8 | 57.0 | 66.5 | 55.3 | 62.5 | 54.7 | 62.6 |
| Sec. 4.3 | (4) fh-ConCL(s=50) | 55.8 | 65.6 | 58.3 | 68.8 | 54.8 | 60.7 | 54.1 | 60.7 |
| Natural-image | (5) fh-ConCL(s=500) | 56.2 | 65.9 | 57.7 | 67.9 | 54.7 | 61.9 | 53.8 | 60.5 |
| priors concepts | (6) bas-ConCL | 56.1 | 66.1 | 58.1 | 68.1 | 54.2 | 61.1 | 53.4 | 60.8 |
| Sec. 4.4 | | | | | | | | | |
| Bootstrapped | (7) b-ConCL(f4) | 56.8 | 66.2 | 58.7 | 68.9 | 55.1 | 62.2 | 54.1 | 61.4 |
| concepts | (8) b-ConCL(f5) | 56.1 | 65.6 | 57.8 | 67.7 | 56.5 | 63.3 | 55.3 | 62.9 |
+
+Table 1: Main results of object detection and instance segmentation. $\mathrm{AP}^{bb}$ : bounding box mAP, $\mathrm{AP}^{mk}$ : mask mAP.
+
+compared to training from randomly initialized weights. The only exception is DenseCL [33], a dense contrasting method.
+
+Among the image-level SSL methods, MoCo-v2 [4] performs the best in GlaS and the second-best in CRAG. Enhanced by dense contrasting, DenseCL [33] achieves the best results in both datasets. It should be emphasized that DenseCL [33] gets $+1.6\mathrm{AP}^{bb}$ for GlaS by using grid-level contrasting. This demonstrates the importance of designing dense pre-training frameworks when transferring to dense tasks since all the stragglers are only optimized for image-level representations. Thus, we here conclude dense contrasting matters.
+
+# 4.2 Correspondence matters
+
+From the previous section, we find dense contrasting is favored in both natural and pathology images, where DenseCL [33] all achieves top performance. The next question is: can we improve the dense contrasting framework? To answer it, we first summarize the overall pipeline of DenseCL [33]. DenseCL computes the dense representations of two views without global average pooling, i.e., $f_{5}(x_{q}), f_{5}(x_{k})$ , and passes them to a dense projection head to obtain final grid features of size $\mathbb{R}^{128 \times 7 \times 7}$ . Then it sets the most similar (measured by cosine similarity) grids in two views as positive pairs. As such, the correspondence of positive pairs is learned. However, the reliability of learned correspondence remains questionable and would affect the quality of learned representations.
+
+
+Figure 3: Concept descriptors. (a) Tissue concept illustration. (b) Grid concepts (s: grid number). (c-d) FH concepts (s: scale). (e) Binary saliency concepts, obtained from BASNet [25]. (f-h) Clustering concepts ( $f_i$ : ResNet output stage). The image is resized to $448 \times 448$ for better visualization.
+
+To address that, we instantiate DenseCL [33] in ConCL by regarding the grid-prior as a form of concept, as shown in Figure 3-(b). We denote this ConCL instance as g-ConCL. Compared with DenseCL [33] (learned matching), ConCL naturally restores the positive correspondence from a reference view (precise matching Fig. $2 - x_{r}$ ). Table 1-(1-3) compares the original DenseCL [33] and ConCL-instantiated g-ConCL. The results indicate that g-ConCL with precise correspondence can boost DenseCL [33] by a large margin. Even with the simplest form of concepts, g-ConCL already has topped entries above it in Table 1. We believe other dense pre-training methods that learn the matching between grids, e.g., Self-EMD [22], should perform similarly to DenseCL [33], and g-ConCL could outperform them. Thus, we conclude that correspondence matters.
+
+# 4.3 Natural Image Priors in Pathology Images
+
+ConCL is a general framework for using masks as supervision to discriminate concepts. Some previous works in natural image [42,16,41,30,32] also combines masks with contrastive learning, where the masks are provided by ground truth annotation [42,32,16], or supervised/unsupervised pseudo-mask generation [16,41,30]. The mask generators can be graph-based (e.g., Felzenszwalb-Huttenlocher algorithm [7]), MCG [1], or other saliency detection models [25,23] trained on designated natural image datasets. However, those methods were originally proposed for nature images, and their success for pathology images remains unknown.
+
+Here we instantiate ConCL by using Felzenszwalb-Huttenlocher (FH) algorithm [7] and BASNet [25] as concept generators, dubbed as fh-ConCL and bas-ConCL, respectively. FH [7] is a conventional graph-based segmentation algorithm that relies on local neighborhoods, while BASNet [25] is a deep neural network pre-trained on a curated saliency detection dataset, which only contains daily natural objects. We use these two as representatives to study if these natural image priors win twice in both natural and pathology images.
+
+Specifically, we use the FH algorithm in the scikit-image package and set both "scale" and "size" hyper-parameters to $s$ . We use the pre-trained BASNet provided by [25]. Figure 3-(c-e) shows some examples. Table 1 reports the results.
+
+It is not surprising that the BASNet [25] cannot generate decent concept masks (Fig. 3-(e)) for pathology images since it is pre-trained on curated saliency detection datasets. What is surprising is that bas-ConCL does yield satisfactory
+
+results (Tab. 1-(6)). Similar observations are also found in fh-ConCLs (Tab. 1-(4,5)) that though the generated concept masks are coarse-grained, the resulted transferring performances are unexpectedly good. After inspecting more examples, we find that the generated masks maintain high coherence and integrity despite their coarse-grained nature. That said, each concept contains semantic-consistent objects or textures. For example, Figure 3-(d,e) can be seen as special cases of Figure 3-(a) that merge fine-grained semantics with coarse-grained ones. This property makes the major difference between fh-/bas-ConCLs and g-ConCLs, where the grid-concepts are less likely to have coherent semantics.
+
+Thus, we here conclude that coherence matters and natural image priors also work in pathology images, though they mostly provide coarse-grained concepts.
+
+# 4.4 Pathology Image Priors in Pathology Images
+
+Can we obtain concept masks away with natural image priors? External dependency is not always wanted and sometimes may fail to provide the desired masks (e.g., Fig. 3-(e)). We thus task ourselves to find a dependency-free concept proposal method. One of the key characteristics in pathology images is that they have rich low-level patterns and tissue structures. Can we use that prior instead?
+
+Figure 3-(f-h) shows the clustering visualization from intermediate feature maps generated by a 10-epoch warmed-up MoCo-v2 [4]. Thanks to the rich structural patterns in pathology images, we find that simply clustering over the feature maps provided by a barely trained model can already generate meaningful structural concept proposals. We thus build upon this "free lunch" and use a "bootstrap your own perception" mechanism that is similar to the "bootstrap your own latent" mechanism in BYOL [10]. ConCL generates concept proposals from the momentum key encoder's perception while simultaneously improving and refining it via the online query encoder, leading to a "bootstrapping" behavior. Thus, we denote such ConCL as bootstrapped-ConCL (b-ConCL). We provide an additional introduction to BYOL and "bootstrapping" in Appendix A.
+
+b-ConCL. The concept generator is now instantiated as a KMeans grouper. We first pass the reference view $x_{r}$ to the key encoder to obtain a reference feature map from ResNet stage- $i$ : $f_{i}(x_{r})\in \mathbb{R}^{CHW}$ . Then, we apply K-Means to group $K$ underlying concepts. b-ConCL relies on neither external segmentation algorithms nor designated saliency detection models for natural images.
+
+Our default setting is $K = 8$ , and clustering from $f_{4}$ or $f_{5}$ . We postpone the study of hyper-parameters, i.e., the number of clusters in KMeans, and the clustering stage $f_{i}$ to Section 5.2 and report the main results in Table 1-(7,8). We find b-ConCL tops other entries. Compared to MoCo-v2 [4], our direct baseline, b-ConCL outperforms it by $+4.5\mathrm{AP}^{bb}$ and $+3.1\mathrm{AP}^{mk}$ . Moreover, b-ConCL obtains more gains in terms of $\mathrm{AP}_{75}$ ( $+6.2\mathrm{AP}_{75}^{bb}$ , $+3.7\mathrm{AP}_{75}^{mk}$ ) compared to MoCo-v2 [4], which means it improves MoCo-v2 [4] by more accurate bounding box regression and instance mask prediction. This aligns with our motivation for ConCL since discriminating local concepts helps shape object borders.
+
+| Detector | Pretrain | GlaS Detection | CRAG Detection |
| APbb | APbb/75 | APbb | APbb/75 |
| MaskRCNN-C4 | Rand. Init. | 52.9 | 59.9 | 49.4 | 54.2 |
| Supervised | 49.1(-3.8) | 55.1(-4.8) | 46.1(-3.3) | 50.6(-2.3) |
| MoCo-v2 [4] | 53.6(+0.7) | 61.8(+1.9) | 48.3(-1.1) | 52.6(-1.6) |
| b-ConCL | 55.8(+2.9) | 63.6(+3.7) | 49.8(+0.4) | 54.3(+0.1) |
| MaskRCNN-FPN | Rand. Init. | 49.8 | 57.3 | 51.1 | 57.0 |
| Supervised | 50.2(+0.4) | 56.9(-0.4) | 49.2(-1.9) | 55.2(-1.8) |
| MoCo-v2 [4] | 52.3(+2.5) | 60.0(+2.7) | 50.0(-1.1) | 55.7(-1.3) |
| b-ConCL | 56.8(+7.0) | 66.2(+8.9) | 55.1(+4.0) | 62.2(+5.2) |
| RetinaNet | Rand. Init. | 46.4 | 51.0 | 45.2 | 47.6 |
| Supervised | 44.7(-1.7) | 48.4(-2.6) | 43.1(-2.1) | 44.8(-2.8) |
| MoCo-v2 [4] | 47.2(+0.8) | 50.9(-0.1) | 43.1(-2.1) | 43.8(-3.8) |
| b-ConCL | 52.6(+6.2) | 58.6(+7.6) | 48.4(+3.2) | 51.9(+4.3) |
+
+Table 2: Detection performance using different detectors. Results are averaged over 5 trials.
+
+Closing remarks. So far, we have included: i) dense contrasting matters; ii) correspondence matters; iii) coherence matters; iv) natural image priors, though they might only provide coarse-grained concepts, work in pathology images as well; and find v) a randomly initialized or barely trained convolutional neural network, thanks to the rich low-level patterns in pathology images and good network initialization, can generate good proposals that are dense, fine-grained and coherent, as shown in Figure 3. Though the coarse-grained concepts generated from natural image priors could also help tasks in our studied benchmarks, they might underperform when a fine-grained dense prediction task is given. We hope our closing remarks could be intriguing and guide future works in designing dense pre-training methods for pathology images and beyond.
+
+# 5 More Experiments
+
+In the previous section, we have explored how we can obtain concepts, what concepts are good, and find b-ConCL to be the best. We here conduct more experiments to study b-ConCL. Some visual comparisons are in Appendix D.
+
+# 5.1 Robustness to Transferring Settings
+
+Transferring with different detectors. Here we investigate the transferring performance with other detectors, i.e., Mask-RCNN-C4 (C4) [26] and RetinaNet [21]. RetinaNet is a single-stage detector. It uses ResNet-FPN backbone features as Mask-RCNN-FPN but directly generates predictions without region proposal [26]. C4 detector adopts a similar two-stage fashion as Mask-RCNN but uses the outputs of the 4-th residual block as backbone features and re-targets the 5-th block to be the detection head instead of building a new one. These three representative detectors evaluate pre-trained models under different detector architectures. Results together with Mask-RCNN-FPN's are shown in Table 2. b-ConCL performs the best with all three detectors in both datasets. Notably,
+
+training from scratch (Rand. Init.) is one of the top competitors when the C4 detector is used. We conjecture that the pre-trained models are possibly overfitted to their pretext tasks in their 5-th blocks and thus are harder to be tuned than a randomly initialized 5-th block. In CRAG detection, only b-ConCL pretrained models consistently outperform randomly initialized models. In addition, the most significant gap between MoCo-v2[4] and b-ConCL is found in the RetinaNet detector [21]. As also noted by [22], RetinaNet [21] is a single-stage detector, where the local representations from the backbone become more important than other two-stage detectors since results are directly predicted from them. b-ConCL is tasked to discriminate local concepts, and subsequently, the learned representations could be better than other pre-training methods here.
+
+Transferring with different schedules. To investigate if b-ConCL's lead could persist with longer fine-tuning, we fine-tune Mask-RCNN-FPN with $0.5 \times$ , $1 \times$ , $2 \times$ , $3 \times$ , and $5 \times$ schedules. Table 3 shows the results. b-ConCL maintains its noticeable gains in longer schedules in both datasets, e.g., b-ConCL achieves $56.2 \mathrm{mAP}$ with a $0.5 \times$ schedule, which is better than MoCo-v2 [4] with a $5 \times$ schedule but costs $10 \times$ less fine-tuning time. Similar observations are also found in CRAG, where the gap between b-ConCL and MoCo-v2 [4] becomes larger (see $\Delta$ row). Together, these results confirm b-ConCL's superiority across different fine-tuning schedules.
+
+# 5.2 Ablation Study
+
+In this section, we ablate the key factors in b-ConCL. Our default setting clusters $K = 8$ concepts from ResNet stage-4 ( $f_4(\cdot)$ ). Since b-ConCL is built on MoCo-v2 [4], we use it as our direct baseline for comparisons.
+
+Concept loss weight $\lambda$ . We here study the generalized concept contrastive loss: $L = (1 - \lambda)L_{q} + \lambda L_{c}$ , where $\lambda \in [0,1]$ is a concept loss weight parameter. It shows a natural way to combine concept contrastive loss with instance contrastive loss. We start by asking whether instance contrastive loss is indispensable during the training process of b-ConCL. We alter the concept loss
+
+| Method | GlaS dataset | CRAG dataset |
| Fine-tuning schedule | Fine-tuning schedule |
| 0.5× | 1× | 2× | 3× | 5× | 0.5× | 1× | 2× | 3× | 5× |
| Rand. Init. | 49.1 | 49.8 | 51.4 | 51.8 | 52.7 | 50.2 | 51.1 | 51.9 | 52.4 | 52.8 |
| Supervised | 48.6 | 50.2 | 51.4 | 52.7 | 54.0 | 50.0 | 49.2 | 50.5 | 50.1 | 50.3 |
| MoCo-v2[4] | 51.4 | 52.3 | 53.7 | 54.2 | 55.7 | 50.2 | 50.0 | 50.2 | 50.8 | 51.8 |
| b-ConCL | 56.2 | 56.8 | 57.7 | 58.3 | 59.0 | 54.8 | 55.1 | 55.4 | 55.6 | 56.0 |
| Δ | +4.8 | +4.5 | +4.0 | +4.1 | +3.3 | +4.6 | +5.1 | +5.2 | +4.8 | +4.2 |
+
+Table 3: Detection performance under different fine-tuning schedules. Results other than $1 \times$ schedule are averaged over 3 runs. $\Delta$ row shows b-ConCL's improvement over MoCo-v2. We report $\mathrm{AP}^{bb}$ here.
+
+| λ | GlaS | CRAG |
| APbb | APbb75 | APbb | APbb75 |
| 0.0 | 52.3 | 60.0 | 50.0 | 55.7 |
| 0.1 | 53.6 | 61.1 | 50.5 | 55.9 |
| 0.3 | 53.6 | 61.8 | 51.7 | 57.1 |
| 0.5 | 53.6 | 61.8 | 51.3 | 57.0 |
| 0.7 | 55.2 | 64.1 | 53.1 | 59.9 |
| 0.9 | 56.0 | 65.1 | 53.6 | 59.6 |
| 1.0 | 56.8 | 66.2 | 55.1 | 62.2 |
| 1.0\w. 56.1 | 66.2 | 54.0 | 60.6 |
+
+(a) Concept loss weight.
+
+| K | GlaS | CRAG |
| APbb | APbb75 | APbb | APbb75 |
| 1 | 52.3 | 60.0 | 50.0 | 55.7 |
| 2 | 54.5 | 64.1 | 52.9 | 60.1 |
| 4 | 55.6 | 64.7 | 53.4 | 59.7 |
| 6 | 56.3 | 65.1 | 53.7 | 60.2 |
| 8 | 56.8 | 66.2 | 55.1 | 62.2 |
| 10 | 57.0 | 66.0 | 55.1 | 61.0 |
| 12 | 57.4 | 66.2 | 54.2 | 60.1 |
| 16 | 55.7 | 65.3 | 54.5 | 61.3 |
+
+(b) Number of concepts.
+
+| K | GlaS | CRAG |
| APbb | APbb75 | APbb | APbb75 |
| None | 52.3 | 60.0 | 50.0 | 55.7 |
| f1(·) | 55.0 | 65.1 | 53.3 | 60.0 |
| f2(·) | 55.0 | 64.7 | 53.7 | 60.4 |
| f3(·) | 56.2 | 66.4 | 53.0 | 59.6 |
| f4(·) | 56.8 | 66.2 | 55.1 | 62.2 |
| f5(·) | 56.1 | 65.6 | 56.5 | 63.3 |
+
+(c) Clustering stage.
+
+| GlaS Detection |
| Pretrain | ResNet-18 | ResNet-50 |
| APbb | APbb75 | APbb | APbb75 |
| Rand. | 49.8 | 57.3 | 49.9 | 56.1 |
| Sup. | 50.2 | 56.9 | 47.9 | 54.2 |
| MoCo.v2 | 52.3 | 60.0 | 53.1 | 60.5 |
| b-ConCL | 56.8 | 66.2 | 57.0 | 65.9 |
+
+(d) Backbone capacities.
+
+Table 4: Ablation Study. We study the effect of different hyper-parameters to b-ConCL. Default settings are marked in gray and MoCo-v2 baselines are marked by gray. In (a), “\w.” means no warm-up.
+
+weight $\lambda$ , and Table 4a reports the results. We see a monotonically increasing performance as $\lambda$ increases in both datasets, which emphasizes the importance of concept loss. When no warm-up is used (last row in Tab. 4a), only a slight performance drop is observed, meaning that warm-up is not the key component of b-ConCL. Warming-up with instance loss (Eq. (2)) is a special case of b-ConCL, where at the early training stage, each instance is regarded as a concept, and we then gradually increase the number of concepts as training goes on. Thus, the overall findings in this ablation support b-ConCL's advance over MoCo-v2 [4].
+
+Number of concepts $K$ . Here, we investigate how the number of concepts clustered during pre-training affects performance in downstream tasks. We report the results of different $K$ in Table 4b. b-ConCL performs reasonably well when $K >= 4$ , with most of performance peaking at $K = 8$ . This demonstrates the robustness of b-ConCL to the choice of $K$ . Note that the best performance for the GlaS dataset is higher than our default setting and outperforms all entries in Table 1, showing the potential room for b-ConCL.
+
+Where to group $f_{i}(\cdot)$ . b-ConCL groups concepts from a model's intermediate feature maps. Our default setting uses feature maps from stage-4 of a ResNet [15], denoted as $f_{4}(\cdot)$ . We now ablate this choice in Table 4c. Clustering concepts
+
+from $f_{4}(\cdot)$ and $f_{5}(\cdot)$ works similarly well across two datasets. We choose $f_{4}(\cdot)$ as the default since it achieves top two performance in both datasets under both metrics. Besides, b-ConCL exceeds MoCo-v2 [4], whichever stage it groups concepts from. This again confirms the effectiveness and robustness of b-ConCL.
+
+Longer pre-training. We compare the pre-training efficiency of different SSL methods w.r.t. training epochs in Figure 1-(b,c) with the numerical results in Appendix D. Interestingly, we find SimCLR [3] and BYOL [10] fail to benefit from longer pre-training. This shows the disparity between pathology image data and natural image data. In the latter field, a monotonically increasing performance in downstream tasks is usually observed [16,12,10,2,3]. For MoCo-v1/v2 [12,4], DenseCL [33] and our b-ConCL, we observe the performance consistently improves as the pre-training epoch increases in GlaS dataset [28]. Note that the 200-epoch b-ConCL surpasses the 800-epoch MoCo-v2 [4] and DenseCL [33] by a large margin (Fig. 1-(b)). In the CRAG dataset, we observe all pre-training methods saturate and achieve the best performance in around 200-epoch and 400-epoch. Among them, b-ConCL is still the best (Fig. 1-(c)).
+
+Larger model capacity. Table 4d shows the results of using a larger backbone, ResNet-50. b-ConCL maintains its leading position. For consistency to the previous ablation, a $1 \times$ schedule is also used here, which could put ResNet-50 at a disadvantage since it has more parameters to tune in a relatively short schedule.
+
+# 6 Conclusion and Broader Impact
+
+In this work, we have benchmarked some of the current SSL methods for dense tasks in pathology images and presented the ConCL framework. Along our exploration, we have distilled several key components to the success of transferring to dense tasks: i) dense contrasting matters, ii) correspondence matters, iii) coherence matters, and more. Finally, we ended up with a dependency-free concept generator that directly bootstraps the underlying concepts inherent in the data and learns from scratch. It was shown to be robust and competitive.
+
+While our initial results are presented only for pre-training and fine-tuning, many applications could embrace ConCL. One example is to combine it with few-shot detection or segmentation, where clustering from feature arrays can be an approach for mining latent objects. Another example can be semi-supervised learning, where ConCL can be used as an additional branch for unlabeled data. Beyond pathology image analysis, we also hope ConCL would help in speech or tabular data, where little priors can be used. Unsupervised clustering in representation space is likely to be modality-agnostic. Learned by using contrastive learning and clustering, fine-grained "concepts" could also be mined from those data modalities.
+
+# References
+
+1. Arbeláez, P., Pont-Tuset, J., Barron, J.T., Marques, F., Malik, J.: Multiscale combinatorial grouping. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 328-335 (2014)
+2. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., Joulin, A.: Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882 (2020)
+3. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+4. Chen, X., Fan, H., Girshick, R., He, K.: Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297 (2020)
+5. Chen, X., He, K.: Exploring simple siamese representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15750-15758 (2021)
+6. Ciga, O., Xu, T., Martel, A.L.: Self supervised contrastive learning for digital histopathology. arXiv preprint arXiv:2011.13971 (2020)
+7. Felzenszwalb, P.F., Huttenlocher, D.P.: Efficient graph-based image segmentation. International journal of computer vision 59(2), 167-181 (2004)
+8. Girshick, R., Donahue, J., Darrell, T., Malik, J.: Rich feature hierarchies for accurate object detection and semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 580-587 (2014)
+9. Graham, S., Chen, H., Gamper, J., Dou, Q., Heng, P.A., Snead, D., Tsang, Y.W., Rajpoot, N.: Mild-net: Minimal information loss dilated network for gland instance segmentation in colon histology images. Medical image analysis 52, 199-211 (2019)
+0. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P.H., Buchatskaya, E., Doersch, C., Pires, B.A., Guo, Z.D., Azar, M.G., et al.: Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733 (2020)
+1. Hadsell, R., Chopra, S., LeCun, Y.: Dimensionality reduction by learning an invariant mapping. In: 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06). vol. 2, pp. 1735-1742. IEEE (2006)
+2. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+3. He, K., Girshick, R., Dollar, P.: Rethinking imagenet pre-training. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4918-4927 (2019)
+4. He, K., Gkioxari, G., Dollár, P., Girshick, R.: Mask r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 2961-2969 (2017)
+5. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+6. Henaff, O.J., Koppula, S., Alayrac, J.B., Oord, A.v.d., Vinyals, O., Carreira, J.: Efficient visual pretraining with contrastive detection. arXiv preprint arXiv:2103.10957 (2021)
+7. Kather, J.N., Halama, N., Marx, A.: 100,000 histological images of human colorectal cancer and healthy tissue (Apr 2018). https://doi.org/10.5281/zenodo.1214456, https://doi.org/10.5281/zenodo.1214456
+
+18. Koohbanani, N.A., Unnikrishnan, B., Khurram, S.A., Krishnaswamy, P., Rajpoot, N.: Self-path: Self-supervision for classification of pathology images with limited annotations. IEEE Transactions on Medical Imaging (2021)
+19. Li, J., Zhou, P., Xiong, C., Hoi, S.C.: Prototypical contrastive learning of unsupervised representations. arXiv preprint arXiv:2005.04966 (2020)
+20. Lin, T.Y., Dólar, P., Girshick, R., He, K., Hariharan, B., Belongie, S.: Feature pyramid networks for object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2117-2125 (2017)
+21. Lin, T.Y., Goyal, P., Girshick, R., He, K., Dollar, P.: Focal loss for dense object detection. In: Proceedings of the IEEE international conference on computer vision. pp. 2980-2988 (2017)
+22. Liu, S., Li, Z., Sun, J.: Self-emd: Self-supervised object detection without imagenet. arXiv preprint arXiv:2011.13677 (2020)
+23. Nguyen, D.T., Dax, M., Mummadi, C.K., Ngo, T.P.N., Nguyen, T.H.P., Lou, Z., Brox, T.: Deepusps: Deep robust unsupervised saliency prediction with self-supervision. arXiv preprint arXiv:1909.13055 (2019)
+24. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018)
+25. Qin, X., Zhang, Z., Huang, C., Gao, C., Dehghan, M., Jagersand, M.: Basnet: Boundary-aware salient object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7479-7489 (2019)
+26. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems 28, 91-99 (2015)
+27. Roh, B., Shin, W., Kim, I., Kim, S.: Spatially consistent representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1144-1153 (2021)
+28. Sirinukunwattana, K., Pluim, J.P., Chen, H., Qi, X., Heng, P.A., Guo, Y.B., Wang, L.Y., Matuszewski, B.J., Bruni, E., Sanchez, U., et al.: Gland segmentation in colon histology images: The glas challenge contest. Medical image analysis 35, 489-502 (2017)
+29. Srinidhi, C.L., Ciga, O., Martel, A.L.: Deep neural network models for computational histopathology: A survey. Medical Image Analysis 67, 101813 (2021)
+30. Van Gansbeke, W., Vandenhende, S., Georgoulis, S., Van Gool, L.: Unsupervised semantic segmentation by contrasting object mask proposals. arXiv preprint arXiv:2102.06191 (2021)
+31. Vincent, P., Larochelle, H., Bengio, Y., Manzagol, P.A.: Extracting and composing robust features with denoising autoencoders. In: Proceedings of the 25th international conference on Machine learning. pp. 1096-1103 (2008)
+32. Wang, W., Zhou, T., Yu, F., Dai, J., Konukoglu, E., Van Gool, L.: Exploring cross-image pixel contrast for semantic segmentation. arXiv preprint arXiv:2101.11939 (2021)
+33. Wang, X., Zhang, R., Shen, C., Kong, T., Li, L.: Dense contrastive learning for self-supervised visual pre-training. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3024-3033 (2021)
+34. Wu, Z., Xiong, Y., Yu, S.X., Lin, D.: Unsupervised feature learning via nonparametric instance discrimination. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3733-3742 (2018)
+35. Xie, E., Ding, J., Wang, W., Zhan, X., Xu, H., Sun, P., Li, Z., Luo, P.: Detco: Unsupervised contrastive learning for object detection. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 8392-8401 (2021)
+
+36. Xie, Z., Lin, Y., Zhang, Z., Cao, Y., Lin, S., Hu, H.: Propagate yourself: Exploring pixel-level consistency for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16684-16693 (2021)
+37. Yang, C., Wu, Z., Zhou, B., Lin, S.: Instance localization for self-supervised detection pretraining. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3987-3996 (2021)
+38. Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised learning via redundancy reduction. arXiv preprint arXiv:2103.03230 (2021)
+39. Zhang, R., Isola, P., Efros, A.A.: Colorful image colorization. In: European conference on computer vision. pp. 649-666. Springer (2016)
+40. Zhang, R., Isola, P., Efros, A.A.: Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1058-1067 (2017)
+41. Zhao, N., Wu, Z., Lau, R.W., Lin, S.: Distilling localization for self-supervised representation learning. arXiv preprint arXiv:2004.06638 (2020)
+42. Zhao, X., Vemulapalli, R., Mansfield, P.A., Gong, B., Green, B., Shapira, L., Wu, Y.: Contrastive learning for label efficient semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 10623-10633 (2021)
\ No newline at end of file
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/images.zip b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cd51d88fd92f76aaa1e8363666ec5bf04dab4f5a
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:45d6d6c590a485382bd71443cb0254f3a83b54d67747eeb47f53c0fae44f4e5e
+size 488183
diff --git a/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/layout.json b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c90635530e0e1c198f481281fc6e8b76869a97af
--- /dev/null
+++ b/conclconceptcontrastivelearningfordensepredictionpretraininginpathologyimages/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d45cba4383be6943c3153205354782283a0dbedd2b569b0670eed77f1889752f
+size 385980
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_content_list.json b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8a796301522d7dd815d4f56b7de7b28ed9f056b8
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c59840fd7ae4c2f3e6bdfd6d88edddff7d99df439ac08c197f1231be13f92965
+size 95230
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_model.json b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..60c327ac1033914313559d10a904d34f70e2cec0
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99260862743d95806d6ef363be2ec48e39343a3403c1b461efb813473db0b34c
+size 119248
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_origin.pdf b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f799e046eff84fd44e92a990df485bca626ad605
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/914b8df4-7e7c-42d1-ab4c-861ea294fa85_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94fa46e7a606a9a76c86cc6431754c340aa6d832e8f1c16948e5195eba2b5dfd
+size 2256114
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/full.md b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0b8096ad8dd5b34af7e282ef9ad9b9d997e1730b
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/full.md
@@ -0,0 +1,380 @@
+# Concurrent Subsidiary Supervision for Unsupervised Source-Free Domain Adaptation
+
+Jogendra Nath Kundu $^{1*}$ , Suvaansh Bhambri $^{1*}$ , Akshay Kulkarni $^{1*}$ , Hiran Sarkar $^{1}$ , Varun Jampani $^{2}$ , and R. Venkatesh Babu $^{1}$
+
+$^{1}$ Indian Institute of Science
+
+2 Google Research
+
+Abstract. The prime challenge in unsupervised domain adaptation (DA) is to mitigate the domain shift between the source and target domains. Prior DA works show that pretext tasks could be used to mitigate this domain shift by learning domain invariant representations. However, in practice, we find that most existing pretext tasks are ineffective against other established techniques. Thus, we theoretically analyze how and when a subsidiary pretext task could be leveraged to assist the goal task of a given DA problem and develop objective subsidiary task suitability criteria. Based on this criteria, we devise a novel process of sticker intervention and cast sticker classification as a supervised subsidiary DA problem concurrent to the goal task unsupervised DA. Our approach not only improves goal task adaptation performance, but also facilitates privacy-oriented source-free DA i.e. without concurrent source-target access. Experiments on the standard Office-31, Office-Home, DomainNet, and VisDA benchmarks demonstrate our superiority for both single-source and multi-source source-free DA. Our approach also complements existing non-source-free works, achieving leading performance.
+
+# 1 Introduction
+
+The prevalent trend in supervised deep learning systems is to assume that training and testing data follow the same distribution. However, such models often fail [6] when deployed in a new environment (target domain) due to the discrepancy in the training (source domain) and target distributions. A standard approach to deal with this problem of domain shift is Unsupervised Domain Adaptation (DA) [10,30], which aims to minimize the domain discrepancy [3] between source and target. The prime challenge in DA is to facilitate the effective utilization of the unlabeled samples while adapting to the target domain.
+
+Drawing motivation from self-supervised pretext task literature [35,13], recent DA works [5,31] have adopted subsidiary tasks as side-objectives to improve the adaptation performance. The intuition is that subsidiary task objectives enforce learning of domain-generic representations, leading to improved domain alignment [51] and consequently, better feature clustering for unlabeled target
+
+
+Fig. 1. We tackle A. unsupervised goal task DA by introducing B. a concurrent subsidiary supervised DA. C. Our theoretical insights reveal that subsidiary tasks having both higher TSM (X-axis) and DSM (Y-axis) are most suitable for concurrent goal-subsidiary adaptation (i.e. the shaded blue area). The proposed sticker-based tasks better suit concurrent goal-subsidiary DA among other self-supervised pretext tasks.
+
+[31]. We aim to design a similar framework but, contrary to prior works, we adopt a novel perspective of subsidiary supervised DA for the subsidiary task concurrent to unsupervised goal task DA. Specifically, the framework involves a shared backbone with a goal classifier and a subsidiary classifier (Fig. 1A, B).
+
+To better understand how subsidiary supervised DA objectives support goal task DA, we intend to theoretically analyze the proposed framework. While several subsidiary tasks are available in the literature, there has been little attention on identifying the desirable properties of a subsidiary task that would better aid the unsupervised DA. A recent self-supervised work [55] studied the effectiveness of pretraining with existing subsidiary tasks [35,13] on different downstream supervised settings such as fine-grained or medical image classification [37,56]. We argue that our intended theoretical analysis is necessary to understand the same for DA settings as DA presents a different set of challenges compared to downstream supervised learning paradigms.
+
+Thus, we attempt to answer two interconnected questions,
+
+1. How does subsidiary supervised DA help goal task unsupervised DA?
+2. What kind of subsidiary tasks better suit concurrent goal-subsidiary $DA$ ?
+
+For the first question, we uncover theoretical insights based on generalization bounds in DA [3,64]. These bounds define distribution shift or domain discrepancy between source and target as the worst discrepancy for a given hypothesis space. We analyze the effect of adding the subsidiary supervised DA problem on the hypothesis space of the shared backbone. Based on this, we find that a higher domain similarity between goal and subsidiary task samples leads to a lower domain discrepancy. This leads to better adaptation for concurrent goal-subsidiary DA w.r.t. naive goal DA. Further, we observe that a higher goal-subsidiary task similarity aids effective learning of both tasks with the shared backbone, which is crucial for subsidiary DA to positively impact the goal DA.
+
+For the second question, we first devise a subsidiary-domain similarity metric (DSM) and a subsidiary-task similarity metric (TSM) to measure the domain similarity and task similarity between any subsidiary task with a given goal task.
+
+Based on our theoretical insights, we propose a subsidiary task suitability criteria using both DSM and TSM to identify $DA$ -assistive subsidiary tasks. With this criteria, we evaluate the commonly used subsidiary tasks from the pretext task literature like rotation prediction [31], patch location [51], and jigsaw permutation prediction [5] in Fig. 1C. We observe that these existing tasks have significantly low DSM. On the other hand, dense output based tasks like colorization [22] or inpainting [38] severely lack in TSM as goal task is classification-based. Understanding these limitations, we devise a sticker-intervention that facilitates domain preservation (high DSM) and propose a range of sticker-based subsidiary tasks (Fig. 2). For general shape-based goal tasks, it turns out that sticker classification task has the best TSM among other sticker-based tasks. This yields higher adaptation performance thereby validating the proposed criteria.
+
+To evaluate our theoretical insights and the proposed concurrent subsidiary DA, we particularly focus on source-free DA regime [23,21,17]. In this, the source and target data are not concurrently accessible while model sharing is permitted. While this challenging
+
+Subsidiary tasks under sticker-intervention
+
+A. Sticker location
+
+
+Fig.2. Sticker intervention involves mixup of input with a masked sticker. We devise the following sticker-based tasks; A. locating the quadrant of the sticker, B. predicting sticker rotation, C. classifying sticker category.
+
+B. Sticker rotation
+
+
+
+C. Sticker classification
+
+
+
+
+
+$\left( {x - {2x}}\right) t - x{y}^{2} = \left( {x - {2x}}\right) {f}^{\prime }t$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+setting holds immense practical value by working within the data privacy regulations, we choose source-free DA as it can prominently highlight our advantages. The well-developed discrepancy minimization techniques, tailored to general DA scenarios, guide the adaptation more significantly than our proposed approach but cannot be used for source-free DA. Further, existing source-free works [26] rely heavily on pseudo-label based self-training on target data. Our proposed subsidiary supervised adaptation implicitly regularizes target-side self-training, leading to improved adaptation.
+
+To summarize, our main contributions are:
+
+- We introduce concurrent subsidiary supervised DA, for a subsidiary task, that not only improves unsupervised goal task DA but also facilitates source-free adaptation. We provide theoretical insights to analyze the impact of subsidiary DA on the domain discrepancy, and hence, the goal task DA.
+- Based on our insights, we devise a subsidiary DA suitability criteria to identify $DA$ -assistive subsidiary tasks that better aid the unsupervised goal task DA. We also propose novel sticker intervention based subsidiary tasks that demonstrate the efficacy of the criteria.
+- Our proposed approach achieves state-of-the-art performance on source-free single-source DA (SSDA) as well as source-free multi-source DA (MSDA) for image classification. The proposed approach also complements existing non-source-free works, achieving leading performance.
+
+# 2 Related Work
+
+Pretext tasks in self-supervised learning. Pretext tasks are used to learn deep feature representations from unlabeled data, in a self-supervised manner, for downstream tasks. There are several pretext tasks such as image inpainting [38], colorization [62,22,63], spatial context prediction [7], contrastive predictive coding [36], image rotation [13], and jigsaw puzzle solving [35]. Pretext tasks are commonly used for pre-training on unlabeled data followed by finetuning on labeled data. Conversely, we perform supervised DA for the pretext-like task along with the unsupervised goal task DA, resulting in a representation that aligns the domains while maintaining the goal task performance.
+
+Source-free DA. Recently, several methods have investigated source-free DA. USFDA [19] and FS [20] investigate universal DA [61] and open-set DA [46], in a source-free setting by synthesizing training samples to make the decision boundaries compact. SHOT [26,27], NRC [59] maximize mutual information and propose pseudo-labeling, using global structure to match target features to that of a fixed source classifier. To provide adaptation supervision, 3C-GAN [23] generates labeled target-style images from a GAN. Finally, SFDA [28], UR [49], and GtA [18] are semantic segmentation specific source-free DA techniques.
+
+Prefix task based DA. Several DA works have demonstrated the efficacy of learning meaningful representations using pretext tasks. Early works [11,12] used reconstruction as a pretext task to extract domain-invariant features. [4] captured both domain-specific and shared features by separating the feature space into domain-private and domain-shared spaces. [5] used jigsaw puzzles as a side-objective to tackle domain generalization. [51] proposed that adaptation can be accomplished by learning many self-supervision tasks at the same time. [16] suggested a cross-domain SSL strategy for adaptation with minimal source labels based on instance discrimination [57]. [15] recommended employing SSL pretext tasks like rotation prediction and patch placement prediction. [45] solved the challenge of universal domain adaptation by unsupervised clustering. [43] employed easy labels for synthetic images, such as the surface normal, depth, and instance contour, to train a network. [9] employed SSL pretext tasks like rotation prediction as part of their domain generalization technique.
+
+# 3 Approach
+
+In this section, we introduce required preliminaries (Sec. 3.1), followed by theoretical insights (Sec. 3.2) that motivate our training algorithm design (Sec. 3.4).
+
+# 3.1 Preliminaries
+
+3.1.1 Goal task unsupervised DA. For closed set DA problem, consider a labeled source dataset $\mathcal{D}_s = \{(x_s,y_s):x_s\in \mathcal{X},y_s\in \mathcal{C}_g\}$ where $\mathcal{X}$ is the input space and $\mathcal{C}_g$ denotes the label set for the goal task. $x_{s}$ is drawn from the marginal distribution $p_{s}$ . Let $\mathcal{D}_t = \{x_t:x_t\in \mathcal{X}\}$ be an unlabeled target dataset with
+
+$x_{t} \sim p_{t}$ . The goal is to assign labels for each target image $x_{t}$ . The usual approach [10,50,29] is to use a backbone feature extractor $h: \mathcal{X} \to \mathcal{Z}$ followed by a goal classifier $f_{g}: \mathcal{Z} \to \mathcal{C}_{g}$ (see Fig. 3A). The expected source risk with $h$ and an optimal labeling function $f_{S}: \mathcal{X} \to \mathcal{C}_{g}$ , is $\epsilon_{s}(h) = \mathbb{E}_{x \sim p_{s}}[\mathbb{1}(f_{g} \circ h(x) \neq f_{S}(x))]$ , where $(.)$ is an indicator function. Similarly, $\epsilon_{t}(h)$ is the target risk with optimal labeling function $f_{T}: \mathcal{X} \to \mathcal{C}_{g}$ . We restate the theoretical upper bound on target risk from [64]. For backbone hypothesis $h \in \mathcal{H}$ with $\mathcal{H}$ being the hypothesis space and a domain classifier $f_{d}: \mathcal{Z} \to \{0,1\}$ (0 for source, 1 for target),
+
+$$
+\begin{array}{l} \epsilon_ {t} (h) \leq \epsilon_ {s} (h) + d _ {\mathcal {H}} \left(p _ {s}, p _ {t}\right) + \lambda_ {g}; \\ \text {w h e r e}, \lambda_ {g} = \min \left\{\underset {p _ {s}} {\mathbb {E}} [ \mathbb {1} (f _ {S} (x) \neq f _ {T} (x)) ], \underset {p _ {t}} {\mathbb {E}} [ \mathbb {1} (f _ {S} (x) \neq f _ {T} (x)) ] \right\} \\ \text {a n d ,} d _ {\mathcal {H}} \left(p _ {s}, p _ {t}\right) = \sup _ {h \in \mathcal {H}} \left| \underset {x \sim p _ {s}} {\mathbb {E}} \left[ \mathbb {1} \left(f _ {d} \circ h (x) = 1\right) \right] - \underset {x \sim p _ {t}} {\mathbb {E}} \left[ \mathbb {1} \left(f _ {d} \circ h (x) = 1\right) \right] \right| \tag {1} \\ \end{array}
+$$
+
+Here, $d_{\mathcal{H}}$ is the $\mathcal{H}$ -divergence [3] that indicates the distribution shift or worst-case domain discrepancy between the two domains. $\lambda_g$ is a constant that represents the optimal cross-domain error of the labeling functions. Thus, the target risk $\epsilon_t(h)$ is upper bounded by these two terms along with the source risk $\epsilon_s(h)$ .
+
+3.1.2 Subsidiary supervised DA. Next, we introduce a subsidiary supervised DA problem concurrent to the goal task unsupervised DA. To this end, we aim to devise a subsidiary classification task with a new label set $\mathcal{C}_n$ . The label-set specific attributes are inflicted on $x \in \mathcal{X}$ via an intervention, to form supervised pairs. These pairs form labeled source, $(\pmb{x}_{s,n}, \pmb{y}_n) \in \mathcal{D}_{s,n}$ and labeled target, $(\pmb{x}_{t,n}, \pmb{y}_n) \in \mathcal{D}_{t,n}$ datasets. Here, the inputs $x_{s,n}$ and $x_{t,n}$ are drawn from marginal distributions $p_{s,n}$ and $p_{t,n}$ respectively. We also define the optimal labeling functions for source and target subsidiary task as $f_{S,n}: \mathcal{X} \to \mathcal{C}_n$ and $f_{T,n}: \mathcal{X} \to \mathcal{C}_n$ . Next, the prediction mapping involves the shared goal-task backbone $h$ followed by a subsidiary classifier $f_n: \mathcal{Z} \to \mathcal{C}_n$ (see Fig. 3A). Here, the source-subsidiary task error is $\epsilon_{s,n}(h) = \mathbb{E}_{x \sim p_{s,n}}[\mathbb{1}(f_n \circ h(x) \neq f_{S,n}(x))]$ . Similarly, $\epsilon_{t,n}(h)$ for target and $\lambda_n$ defined as in Eq. 1. Thus, generalization bounds for subsidiary DA with the same $\mathcal{H}$ is stated as,
+
+$$
+\epsilon_ {t, n} (h) \leq \epsilon_ {s, n} (h) + d _ {\mathcal {H}} \left(p _ {s, n}, p _ {t, n}\right) + \lambda_ {n} \tag {2}
+$$
+
+3.1.3 Metrics. We introduce two metrics that form the basis of our insights. a) Subsidiary-Domain Similarity Metric (DSM), $\gamma_{DSM}(.,.)$ . DSM measures the similarity between two domains as the inverse of the standard $\mathcal{A}$ -distance [3]. $\mathcal{A}$ -distance can be thought of as a proxy [10] for $\mathcal{H}$ -divergence.
+
+b) Subsidiary-Task Similarity Metric (TSM), $\gamma_{TSM}(.,.)$ . TSM measures the task similarity of a subsidiary task w.r.t. the goal task. TSM is computed using the standard linear evaluation protocol [47] borrowed from transfer learning and self-supervised literature. It is the performance of a subsidiary-task linear
+
+
+Fig. 3. A. Our method uses a shared backbone $h$ with goal classifier $f_{g}$ and subsidiary classifier $f_{n}$ . B. Hypothesis space analysis for only goal DA, only subsidiary DA and concurrent goal-subsidiary DA (Sec. 3.2.1). C. Sticker intervention.
+
+
+
+
+C. Sticker intervention
+
+classifier attached to a goal-task pretrained backbone feature extractor $h_{s,g}$ . Intuitively, it indicates the extent of compatibility between the two tasks.
+
+For a dataset pair of source-goal and source-subsidiary, i.e. $(\mathcal{D}_s,\mathcal{D}_{s,n})$
+
+$$
+\gamma_ {D S M} (\mathcal {D} _ {s}, \mathcal {D} _ {s, n}) = 1 - \frac {1}{2} d _ {\mathcal {A}} (\mathcal {D} _ {s}, \mathcal {D} _ {s, n}); \quad \gamma_ {T S M} (\mathcal {D} _ {s}, \mathcal {D} _ {s, n}) = 1 - \min _ {f _ {n}} \hat {\epsilon} _ {s, n} (h _ {s, g}) \tag {3}
+$$
+
+Here, $d_{\mathcal{A}}(.,.)$ denotes $\mathcal{A}$ -distance and $\hat{\epsilon}_{s,n}(.)$ denotes empirical error for subsidiary task on source data. Note that $0 \leq \hat{\epsilon}_{s,n}(h_{s,g}) \leq 1$ while $0 \leq d_{\mathcal{A}}(\mathcal{D}_1, \mathcal{D}_2) \leq 2$ .
+
+# 3.2 Theoretical insights
+
+We analyze the impact of solving subsidiary supervised DA on the goal task unsupervised DA. We first consider the combined bounds (combining Eq. 1, 2),
+
+$$
+\epsilon_ {t} (h) + \epsilon_ {t, n} (h) \leq \epsilon_ {s} (h) + \epsilon_ {s, n} (h) + d _ {\mathcal {H}} \left(p _ {s}, p _ {t}\right) + d _ {\mathcal {H}} \left(p _ {s, n}, p _ {t, n}\right) + \lambda_ {g} + \lambda_ {n} \tag {4}
+$$
+
+Among the six terms on the right side, the two $\lambda$ terms are constants as they do not involve the hypothesis $h$ or hypothesis space $\mathcal{H}$ . We analyze the source error duet, $\epsilon_s(h) + \epsilon_{s,n}(h)$ , and the domain discrepancy duet $d_{\mathcal{H}}(p_s,p_t) + d_{\mathcal{H}}(p_{s,n},p_{t,n})$ .
+
+3.2.1 Analyzing the domain discrepancy duet (Fig. 3B). We analyze w.r.t. the domain discrepancy duet considering three configurations:
+
+a) While performing only unsupervised goal task DA, the backbone optimization would operate on a limited hypothesis space $\mathcal{H}_g^{(uns)}\subset \mathcal{H}$ where $\mathcal{H}_g^{(uns)} = \{h\in \mathcal{H}:|\epsilon_t(h) - \epsilon_s(h)|\leq \zeta_g^{(uns)}\}$ . Here, $\zeta_g^{(uns)}$ is a threshold on the source-target error gap.
+b) While performing supervised adaptation only for subsidiary domain adaptation, the optimization would operate on a limited hypothesis space $\mathcal{H}_n^{(sup)}\subset \mathcal{H}$ i.e., $\mathcal{H}_n^{(sup)} = \{h\in \mathcal{H}:|\epsilon_{t,n}(h) - \epsilon_{s,n}(h)|\leq \zeta_n^{(sup)}\}$ . Here, $\zeta_n^{(sup)}$ is a threshold on the subsidiary-task source-target error gap.
+
+c) While concurrently performing a) unsupervised goal task DA and b) subsidiary supervised DA (i.e. the proposed approach), the optimization would operate on a limited hypothesis space $\mathcal{H}_{g,n} \subset \mathcal{H}$ . Specifically, $\mathcal{H}_{g,n} = \mathcal{H}_n^{(sup)} \cap \mathcal{H}_g^{(uns)}$ . This is because the backbone is shared between the two DA tasks and hence, would be limited to the intersection space.
+
+Different configurations lead to different $\mathcal{H}$ -spaces and consequently, different $\mathcal{H}$ -divergences. Comparing the $\mathcal{H}$ -divergences leads us to the following insight.
+
+Insight 1. ( $\mathcal{H}$ -divergence in concurrent goal DA and subsidiary DA) The backbone hypothesis space for concurrent unsupervised goal DA and subsidiary supervised DA, i.e. $\mathcal{H}_{g,n} = \mathcal{H}_n^{(\sup)} \cap \mathcal{H}_g^{(uns)}$ will yield a lower $\mathcal{H}$ -divergence than $\mathcal{H}_g^{(uns)}$ (hypothesis space for only unsupervised goal task DA), i.e.
+
+$$
+d _ {\mathcal {H} _ {g, n}} \left(p _ {s}, p _ {t}\right) \leq d _ {\mathcal {H} _ {g} ^ {(u n s)}} \left(p _ {s}, p _ {t}\right) \text {a n d} d _ {\mathcal {H} _ {g, n}} \left(p _ {s, n}, p _ {t, n}\right) \leq d _ {\mathcal {H} _ {g} ^ {(u n s)}} \left(p _ {s, n}, p _ {t, n}\right) \tag {5}
+$$
+
+Remarks. In Eq. 1, $d_{\mathcal{H}}(p_s,p_t)$ is the supremum over the hypothesis space $\mathcal{H}$ i.e. a worst-case measure. Since $\mathcal{H}_{g,n} \subset \mathcal{H}_g^{(uns)}$ , $\mathcal{H}_{g,n}$ would have a lower $\mathcal{H}$ -divergence as the worst-case hypothesis of $\mathcal{H}_g^{(uns)}$ may be absent in the subset $\mathcal{H}_{g,n}$ . This applies to both pairs, $(p_s,p_t)$ and $(p_{s,n},p_{t,n})$ . While a lower $\mathcal{H}$ -divergence duet leads to improved goal DA, the equality may hold when the worst hypothesis of $\mathcal{H}_g^{(uns)}$ remains in $\mathcal{H}_{g,n}$ . In such a case, concurrent DA would perform the same as naive goal DA. To this end, we put forward the following insight.
+
+Insight 2. (When is concurrent DA strictly better than naive DA?) A subsidiary task supports the strict inequality $d_{\mathcal{H}_{g,n}}(p_s, p_t) < d_{\mathcal{H}_g^{(uns)}}(p_s, p_t)$ if with at least $(1 - \delta)$ probability, the subsidiary-domain similarity $\gamma_{DSM}(\mathcal{D}_s, \mathcal{D}_{s,n})$ exceeds a threshold $\zeta_d$ by no less than $\xi$ ; $\mathbb{P}[\gamma_{DSM}(\mathcal{D}_s, \mathcal{D}_{s,n}) \geq \zeta_d - \xi] \geq 1 - \delta$ . Remarks. In other words, the strict inequalities in Eq. 5 would hold if the DSM $\gamma_{DSM}(.,.)$ exceeds a threshold $\zeta_d$ . The supports for this insight are twofold. First, a subsidiary task may heavily alter domain information [32], e.g. jigsaw shuffling [5]. Then, the backbone will be updated using out-of-domain samples which is undesirable as such samples are unlikely for inference. This will be avoided if Insight 2 is satisfied. Second, if DSM is high, we can approximate $p_s \approx p_{s,n}$ and $p_t \approx p_{t,n}$ . Thus, more samples from subsidiary task data will be available for training the backbone to be domain-invariant (as subsidiary task uses samples from both the domains) i.e. reducing $d_{\mathcal{H}}$ against the same in naive goal DA.
+
+3.2.2 Analyzing the source error duet. Now we analyze w.r.t. the source error duet of Eq. 4. While the $\mathcal{H}$ -divergence is lower for concurrent goal task DA and subsidiary supervised DA, a logical concern is that simultaneous minimization of errors, i.e. $\epsilon_s(h) + \epsilon_{s,n}(h)$ , for both tasks may be difficult with the shared backbone $h$ . Further, it may happen that simultaneous training for both tasks in target domain may hamper the goal task performance as it is unsupervised. In such cases, the subsidiary task would be ill-equipped to assist the goal task adaptation. To avoid these, we propose another empirical criterion as follows.
+
+Insight 3. (Goal and subsidiary task similarity for concurrent DA) Higher goal-subsidiary task similarity (TSM) aids effective minimization of both task errors with the shared backbone, which is crucial for subsidiary supervised DA to positively affect the goal task DA. The criterion is $\gamma_{TSM}(\mathcal{D}_s,\mathcal{D}_{s,n}) > \zeta_n$ . Remarks. Here, $\zeta_{n}$ is a threshold. The TSM $\gamma_{TSM}$ indicates the compatibility of goal task features to support the subsidiary task. Intuitively, a higher TSM implies more overlap in the discriminative features of the two tasks, which would allow better simultaneous minimization of both task errors.
+
+Based on Insight 1, concurrent subsidiary supervised DA and goal task DA yields a lower domain discrepancy. Further, based on Insight 2, a subsidiary task can be selected such that effective minimization of both source errors is possible simultaneously. Thus, using Eq. 1, we can infer that $\sup_{h\in \mathcal{H}_{g,n}}\epsilon_t(h)\leq \sup_{h\in \mathcal{H}_g^{(uns)}}\epsilon_t(h)$ i.e. a lower target error upper bound for our approach w.r.t. naive goal task DA. Now, we summarize the criteria (Insight 2, 3).
+
+Definition 1. (Subsidiary DA suitability criteria) A subsidiary task is termed DA-assistive i.e. suitable for subsidiary supervised DA if the sum of DSM $\gamma_{DSM}$ and TSM $\gamma_{TSM}$ exceeds a threshold $\zeta$ ,
+
+$$
+\gamma_ {D S M} \left(\mathcal {D} _ {s}, \mathcal {D} _ {s, n}\right) + \gamma_ {T S M} \left(\mathcal {D} _ {s}, \mathcal {D} _ {s, n}\right) > \zeta \tag {6}
+$$
+
+Remarks. In other words, a subsidiary task which is domain-preserving and has high task similarity w.r.t. the goal task is DA-assistive i.e. suitable for subsidiary supervised DA to aid the goal task DA. We employ this criteria empirically for a diverse set of subsidiary tasks (shown in Fig. 1C). Next, we describe the motivation for our proposed sticker intervention and corresponding subsidiary tasks as well as training algorithms tailored for source-free DA.
+
+# 3.3 Sticker intervention based subsidiary task design
+
+While one may consider pretext tasks from the self-supervised learning literature as candidates for subsidiary DA, almost all such tasks fail to satisfy subsidiary DA suitability criteria in Eq. 6. For instance, dense output based tasks such as colorization [62,22], inpainting [38], etc. exhibit markedly low task similarity (TSM) against the non-dense goal tasks. Further, the input intervention for certain pretext tasks such as jigsaw [5], patch-location[51], rotation [31,15], significantly alter the domain information leading to low domain similarity (DSM).
+
+Insight 4. (Sticker-intervention based tasks well suit subsidiary DA) Sticker intervention is the process of pasting a sticker $x_{n}$ (i.e., a symbol with random texture and scale) on a given image sample $x_{s} \in \mathcal{D}_{s}$ to obtain a stickered sample, i.e. $x_{s,n} = \mathcal{T}(x_s,x_n) \in \mathcal{D}_{s,n}$ . Following this, the subsidiary task could be defined as the classification of some sticker attribute (e.g. shape, location, or orientation). Such a formalization provides effective control to maximize $\gamma_{DSM}(\mathcal{D}_s,\mathcal{D}_{s,n})$ and $\gamma_{TSM}(\mathcal{D}_s,\mathcal{D}_{s,n})$ , in line with our suitability criteria.
+
+Remarks. The sticker intervention (Fig. 3C) facilitates domain preservation while simultaneously supporting a range of subsidiary tasks. Since the proposed sticker intervention alters only a local area of the sample, the original content is
+
+not suppressed which in turn preserves the domain information, implying high DSM. Following this, one can ablate over a range of sticker-based tasks in order to select a suitable subsidiary task based on the given goal task. Below, we discuss some possible subsidiary tasks under the sticker intervention.
+
+a) Sticker location (Fig. 2A). We draw motivation from patch-location [51], where the task is to classify the quadrant to which a patch-input belongs. With sticker intervened images, the task is to classify the quadrant with the sticker. Our use of whole images as input is more domain-preserving than patch-input.
+b) Sticker rotation (Fig. 2B). Motivated by the image rotation task [31], we propose sticker rotation task where the rotation of the sticker has to be classified $(0^{\circ}, 90^{\circ}, 180^{\circ}$ and $270^{\circ}$ rotations possible). Note that our sticker rotation does not affect the domain information while rotating the entire image does.
+c) Sticker classification (Fig. 2C). While the discriminative features in the previous two tasks were location and rotation, we propose sticker classification task with primary discriminative features as shape. In other words, the task is to classify the sticker shape (i.e., the symbol) given a stickered sample.
+
+# 3.4 Training algorithm design under source-free constraints
+
+For the standard DA setting with concurrent access to source and target data [10,50], the subsidiary supervised DA can be implemented simply by optimizing the subsidiary classification loss simultaneously for source and target. This would yield a lower domain discrepancy as discussed in Sec. 3.2. However, in the more practical source-free setting [23,19] where concurrent source-target access is prohibited, this simple approach would not be possible. We believe the improvements will be prominent in source-free DA based on the following insight:
+
+Insight 5. (Subsidiary DA better suits challenging source-free DA). Existing source-free DA works heavily rely on pseudo-label or clustering based self-training on unlabeled target with no obvious alternative. The proposed subsidiary supervised adaptation helps to implicitly regularize the target-side self-training, leading to improved adaptation performance. The subsidiary DA not only aids goal DA as a result of high DSM but also preserves the goal task inductive bias as a result of high TSM, while adhering to the source-free constraints.
+
+Remarks. The source-free setting presents new challenges which highlight the advantages of our proposed method more prominently. This is because, the performance in non-source-free DA is strongly influenced by well-developed discrepancy minimization techniques. However, these techniques cannot be leveraged in a source-free setting due to their requirement of concurrent source-target data access. Thus, we primarily operate in the source-free regime to evaluate our theoretical insights and the proposed concurrent subsidiary supervised DA problem.
+
+We perform the training in three steps. First two steps involve pre-training of goal task and subsidiary task respectively with source data. The final step involves adapting both tasks to target domain. For clarity, we first summarize available and intervened datasets required for training and their notations.
+
+Datasets. The goal task source data is denoted by $(x_{s},y_{s})\in \mathcal{D}_{s}$ while the corresponding unlabeled target is denoted by $x_{t}\in \mathcal{D}_{t}$ . The interveneded stickered-
+
+
+A. Source-side training
+
+
+
+
+B. Target-side training
+Fig. 4. A. Source-side training involves goal pre-training (Sec. 3.4.1) and sticker pretraining (Sec. 3.4.2). B. Target-side training involves concurrent goal-task unsupervised DA and sticker-task supervised DA (Sec. 3.4.3).
+
+source data, coupled with both goal and sticker task labels, is denoted by $(x_{s,n},y_s,y_n)\in \mathcal{D}_{s,n}$ . The corresponding stickered-target data, with only subsidiary sticker task labels, is denoted by $(x_{t,n},y_n)\in \mathcal{D}_{t,n}$ . We introduce a pseudo-OOS (out-of-source) dataset, $\mathcal{D}_s^{(od)}$ further in this section.
+
+3.4.1 Goal task source pre-training (Fig. 4A). We train the backbone $h$ and goal classifier $f_{g}$ with source data $\mathcal{D}_s$ and stickered-source data $\mathcal{D}_{s,n}$ :
+
+$$
+\min _ {\theta_ {h}, \theta_ {f g} (x, y) \in \mathcal {D} _ {s} \cup \mathcal {D} _ {s, n}} \mathbb {E} [ \mathcal {L} _ {s, g} ]; \quad \mathcal {L} _ {s, g} = \mathcal {L} _ {c e} (f _ {g} \circ h (x), y) \tag {7}
+$$
+
+Here, $\theta_h$ and $\theta_{f_g}$ are the parameters of $h$ and $f_g$ , $\mathcal{L}_{ce}$ is the cross-entropy loss, $y$ is the goal task label, and expectation is implemented by sampling mini-batches.
+
+3.4.2 Sticker task source pre-training (Fig. 4A). We pretrain the sticker classifier $f_{n}$ while inculcating the ability to reject samples out of the source distribution. Specifically, $f_{n}$ predicts a $(|\mathcal{C}_n| + 1)$ -sized vector and is trained to classify out-of-source (OOS) samples to the $(|\mathcal{C}_n| + 1)^{\mathrm{th}}$ class.
+
+Insight 6. The OOS node in the sticker classifier implicitly behaves as a domain discriminator from adversarial alignment methods. Minimizing the OOS probability only for the target data aligns the target with the source.
+
+Remarks. In source training, the OOS objective forces the sticker classifier to discriminate between source and OOS samples. This is done with the intuition that OOS samples simulate the role of target samples in adversarial alignment methods. This domain discriminatory knowledge will support future source-free target alignment. Concretely, the shared backbone can be adapted to the target, by minimizing OOS probability for target samples, as source knowledge is preserved by freezing $f_{g}$ . Thus, we require OOS data to prepare $f_{n}$ for adaptation.
+
+Obtaining the OOS dataset. A naive approach is to use a dataset unrelated to the goal task label set. Conversely, we devise a pseudo-OOS dataset using only already available source samples. Mitsuzumi et al. [32] show that, beyond a
+
+Table 1. Single-Source Domain Adaptation (SSDA) on Office-Home benchmarks. SF indicates source-free adaptation.
+
+| Method | SF | Office-Home |
| Ar+Cl | Ar+Pr | Ar+Rw | Cl+Ar | Cl+Pr | Cl+Rw | Pr+Ar | Pr+Cl | Pr+Rw | Rw+Ar | Rw+Cl | Rw+Pr | Avg |
| FixBi [33] | ✗ | 58.1 | 77.3 | 80.4 | 67.7 | 79.5 | 78.1 | 65.8 | 57.9 | 81.7 | 76.4 | 62.9 | 86.7 | 72.7 |
| SENTRY[41] | ✗ | 61.8 | 77.4 | 80.1 | 66.3 | 71.6 | 74.7 | 66.8 | 63.0 | 80.9 | 74.0 | 66.3 | 84.1 | 72.2 |
| SCDA [24] | ✗ | 60.7 | 76.4 | 82.8 | 69.8 | 77.5 | 78.4 | 68.9 | 59.0 | 82.7 | 74.9 | 61.8 | 84.5 | 73.1 |
| SHOT [26] | ✓ | 57.1 | 78.1 | 81.5 | 68.0 | 78.2 | 78.1 | 67.4 | 54.9 | 82.2 | 73.3 | 58.8 | 84.3 | 71.8 |
| A2Net [58] | ✓ | 58.4 | 79.0 | 82.4 | 67.5 | 79.3 | 78.9 | 68.0 | 56.2 | 82.9 | 74.1 | 60.5 | 85.0 | 72.8 |
| GSFDA [60] | ✓ | 57.9 | 78.6 | 81.0 | 66.7 | 77.2 | 77.2 | 65.6 | 56.0 | 82.2 | 72.0 | 57.8 | 83.4 | 71.3 |
| CPGA [42] | ✓ | 59.3 | 78.1 | 79.8 | 65.4 | 75.5 | 76.4 | 65.7 | 58.0 | 81.0 | 72.0 | 64.4 | 83.3 | 71.6 |
| NRC [59] | ✓ | 57.7 | 80.3 | 82.0 | 68.1 | 79.8 | 78.6 | 65.3 | 56.4 | 83.0 | 71.0 | 58.6 | 85.6 | 72.2 |
| SHOT++[27] | ✓ | 57.9 | 79.7 | 82.5 | 68.5 | 79.6 | 79.3 | 68.5 | 57.0 | 83.0 | 73.7 | 60.7 | 84.9 | 73.0 |
| Ours | ✓ | 61.0 | 80.4 | 82.5 | 69.1 | 79.9 | 79.5 | 69.1 | 57.8 | 82.7 | 74.5 | 65.1 | 86.4 | 74.0 |
+
+certain grid size, shuffling grid patches makes the domain unrecognizable. Hence, we generate a pseudo-OOS dataset by shuffling grid patches of source images.
+
+We also add stickers to shuffled images, at random, to further instill differences between source and pseudo-OOS (see Suppl). Formally, $(x_{s}^{(od)},y_{s}^{(od)})\in$ $\mathcal{D}_s^{(od)}$ where $y_{s}^{(od)}$ denotes OOS category i.e. $(|\mathcal{C}_n| + 1)^{\mathrm{th}}$ category of $f_{n}$
+
+We train only the sticker classifier $f_{n}$ , keeping backbone $h$ and goal classifier $f_{g}$ frozen, using cross-entropy loss $\mathcal{L}_{ce}$ . With $\mathcal{L}_{s,n} = \mathcal{L}_{ce}(f_n\circ h(x_{s,n}),y_n)$ , the overall objective for stickered source data $\mathcal{D}_{s,n}$ and pseudo-OOS data $\mathcal{D}_s^{(od)}$ is,
+
+$$
+\min _ {\theta_ {f _ {n}}} \mathbb {E} _ {\mathcal {D} _ {s, n}} \left[ \mathcal {L} _ {s, n} \right] + \mathbb {E} _ {\mathcal {D} _ {s} ^ {(o d)}} \left[ \mathcal {L} _ {s} ^ {(o d)} \right]; \quad \text {w h e r e} \mathcal {L} _ {s} ^ {(o d)} = \mathcal {L} _ {c e} \left(f _ {n} \circ h \left(x _ {s} ^ {(o d)}\right), y _ {s} ^ {(o d)}\right) \tag {8}
+$$
+
+3.4.3 Source-free target adaptation (Fig. 4B). For unsupervised goal task adaptation, we use the general self training loss $\mathcal{L}_{st}$ and diversity loss $\mathcal{L}_{div}$ [26]. See Suppl. for more details. The goal task objective is given in Eq. 9 (left),
+
+$$
+\min _ {\theta_ {h}} \underset {\mathcal {D} _ {t} \cup \mathcal {D} _ {t, n}} {\mathbb {E}} [ \mathcal {L} _ {s t} + \mathcal {L} _ {d i v} ]; \text {a n d} \min _ {\left(\theta_ {h}, \theta_ {f _ {n}}\right)} \underset {\mathcal {D} _ {t, n}} {\mathbb {E}} [ \mathcal {L} _ {t, n} ]; \mathcal {L} _ {t, n} = \mathcal {L} _ {c e} \left(f _ {n} \circ h \left(x _ {t, n}\right), y _ {n}\right) \tag {9}
+$$
+
+The goal classifier $f_{g}$ is frozen to preserve its inductive bias and only the backbone $h$ is updated for both original and stickered samples in Eq. 9 (left).
+
+For subsidiary supervised sticker adaptation, we use a simple cross-entropy loss with sticker labels. We implicitly minimize OOS probability by maximizing label class probability. We observe that this works well and explicit minimization of OOS probability is not required. As per Insight 6, out-of-target (OOT) samples are not required. Further, using OOT samples to update the backbone could be undesirable as discussed under Insight 2. The objective is given in Eq. 9 (right). Both backbone $h$ and sticker classifier $f_{n}$ are updated as the task is supervised.
+
+Table 2. Multi-Source Domain Adaptation (MSDA) on DomainNet and Office-Home. We outperform source-free (denoted by SF) prior arts despite not using domain labels.
+
+| Method | SF | w/o Domain Labels | DomainNet | Office-Home |
| →C | →I | →P | →Q | →R | →S | Avg | →Ar | →Cl | →Pr | →Rw | Avg |
| WAMDA [1] | X | X | 59.3 | 21.8 | 52.1 | 9.5 | 65.0 | 47.7 | 42.6 | 71.9 | 61.4 | 84.1 | 82.3 | 74.9 |
| SImpAl50 [53] | X | X | 66.4 | 26.5 | 56.6 | 18.9 | 68.0 | 55.5 | 48.6 | 70.8 | 56.3 | 80.2 | 81.5 | 72.2 |
| CMSDA [48] | X | X | 70.9 | 26.5 | 57.5 | 21.3 | 68.1 | 59.4 | 50.4 | 71.5 | 67.7 | 84.1 | 82.9 | 76.6 |
| DRT [25] | X | X | 71.0 | 31.6 | 61.0 | 12.3 | 71.4 | 60.7 | 51.3 | - | - | - | - | - |
| STEM [34] | X | X | 72.0 | 28.2 | 61.5 | 25.7 | 72.6 | 60.2 | 53.4 | - | - | - | - | - |
| Source-combine | X | ✓ | 57.0 | 23.4 | 54.1 | 14.6 | 67.2 | 50.3 | 44.4 | 58.0 | 57.3 | 74.2 | 77.9 | 66.9 |
| SHOT [26]-Ens | ✓ | X | 58.6 | 25.2 | 55.3 | 15.3 | 70.5 | 52.4 | 46.2 | 72.2 | 59.3 | 82.8 | 82.9 | 74.3 |
| DECISION [2] | ✓ | X | 61.5 | 21.6 | 54.6 | 18.9 | 67.5 | 51.0 | 45.9 | 74.5 | 59.4 | 84.4 | 83.6 | 75.5 |
| SHOT++ [27] | ✓ | X | - | - | - | - | - | - | - | 73.1 | 61.3 | 84.3 | 84.0 | 75.7 |
| CAiDA [8] | ✓ | X | - | - | - | - | - | - | - | 75.2 | 60.5 | 84.7 | 84.2 | 76.2 |
| NRC [59] | ✓ | ✓ | 65.8 | 24.1 | 56.0 | 16.0 | 69.2 | 53.4 | 47.4 | 70.6 | 60.0 | 84.6 | 83.5 | 74.7 |
| Ours | ✓ | ✓ | 70.3 | 25.7 | 57.3 | 17.1 | 69.9 | 57.1 | 49.6 | 75.1 | 64.1 | 86.6 | 84.4 | 77.6 |
+
+# 4 Experiments
+
+We provide the implementation details of our experiments and thoroughly evaluate our approach w.r.t. state-of-the-art prior works across multiple settings. Unless mentioned, Ours implies sticker classification as the subsidiary task.
+
+# 4.1 Experimental setup
+
+Datasets. We evaluate on four standard DA benchmarks; Office-31 [44], Office-Home [54], VisDA [40], and DomainNet [39]. See Suppl. for more details.
+
+Implementation details. We use a ResNet-101 [14] backbone for VisDA, and ResNet-50 for other benchmarks. We employ the same network design as SHOT [26]. For the subsidiary classifier, we use the same architecture after ResLayer-3. The number of sticker classes is 10. See Suppl. for more details.
+
+# 4.2 Discussion
+
+a) Single Source Domain Adaptation (SSDA). We compare with prior source-free SSDA works in Table 1 on Office-Home. We achieve state-of-the-art results exceeding the source-free SHOT++ and non-source-free SCDA [24] by $1\%$ and $0.9\%$ respectively. See Suppl. for Office-31 and VisDA results.
+b) Multi Source Domain Adaptation (MSDA). In Table 2, we compare with the source-only baseline (source-combine) and source-free works. Even without domain labels, our approach achieves state-of-the-art results, even w.r.t. non-source-free works on Office-Home $(+1\%)$ . On DomainNet, we outperform source-free works $(+2.2\%)$ with comparable results to non-source-free works.
+c) Evaluating the subsidiary DA suitability criteria. We empirically evaluate DSM and TSM for our sticker-based tasks as well as existing tasks from self-supervised literature in Fig. 5A, 5B. Compared to patch location [51] and image rotation [31], sticker location and sticker rotation tasks exhibit higher
+
+
+Fig. 5. We observe higher A. domain similarity (DSM) and B. task similarity (TSM) for our sticker-based tasks compared to existing subsidiary tasks like patch-location and image-rotation. This correlates with the better MSDA performance of sticker-based tasks on Office-Home and validates our criteria (Definition 1). C. Faster and improved convergence w.r.t. prior source-free works on both SSDA and MSDA for Office-Home.
+
+
+
+
+
+DSM and thus, are more suitable with better adaptation performance (Table 3). However, sticker classification task is the most suitable due to its higher TSM as shape is the primary discriminative features, same as in goal task. We observe a positive correlation between DA performance and both DSM and TSM, which empirically verifies our suitability criteria. In Table 3, we also compare dense output based tasks like colorization and inpainting, which give marginal gains.
+
+d) Faster and improved convergence. Fig. 5C illustrates our better and faster convergence w.r.t. source-free prior arts for both SSDA and MSDA. The hypothesis space for concurrent subsidiary supervised DA and unsupervised goal task DA, $\mathcal{H}_{g,n}$ , is a subset of the hypothesis space for only unsupervised goal task DA, $\mathcal{H}_g^{(uns)}$ . Thus, we achieve faster convergence. Further, as per Insight 1, lower domain discrepancy leads to lower target error i.e. improved convergence.
+
+e) Compatibility with non-source-free DA. In Table 4, we evaluate the compatibility of concurrent subsidiary supervised DA with existing non-source-free SSDA techniques [10,30,52]. MSDA results are obtained by combining the multiple sources for each target. Compared to the original reported results, all four perform better
+
+with our proposed subsidiary DA. Note that our non-source-free variant outperforms these results (#7 in Table 5).
+
+Table 3. Subsidiary task comparisons on Office-Home for source-free DA. Here, baseline is same as #3 in Table 5.
+
+| Method | SSDA | MSDA |
| Baseline (B) | 66.2 | 74.3 |
| B + inpainting | 66.3 | 74.5 |
| B + colorization | 66.8 | 74.7 |
| B + jigsaw | 67.0 | 74.8 |
| B + patch-loc | 67.6 | 75.0 |
| B + rotation | 67.9 | 75.4 |
| B + sticker-loc | 68.8 | 75.5 |
| B + sticker-rot | 69.0 | 75.7 |
| B + sticker-clsf | 69.7 | 76.2 |
+
+# 4.2.1 Ablation Study. Below, we discuss a thorough ablation study.
+
+a) Effect of subsidiary supervised DA and OOS node. In Table 5, we compare the baseline i.e. only unsupervised goal task DA (#3) with the addition of only OOS classifier (#4). Here, a binary classifier is used for OOS detection. We
+
+Table 4. Evaluating compatibility of subsidiary DA with non-source-free DA works on OfficeHome. SSDA and MSDA indicate single-source and multi-source DA.
+
+| Method | Office-Home |
| SSDA | MSDA |
| CDAN [30] | 65.8 | 69.4 |
| + Subsidiary-DA | 67.1 | 71.2 |
| SRDC [52] | 71.3 | 73.1 |
| + Subsidiary-DA | 71.9 | 75.2 |
| FixBi [33] | 72.7 | - |
| + Subsidiary-DA | 73.7 | - |
| CMSDA [48] | - | 76.6 |
| + Subsidiary-DA | - | 78.1 |
+
+Table 5. Ablation analysis. Here, sticker- $w$ -OOS-clsf denotes learning with all the proposed components unlike in only-OOS-clsf (all losses except $\mathcal{L}_{s,n},\mathcal{L}_{t,n}$ ) and only-sticker-clsf (all losses except $\mathcal{L}_s^{(od)}$ ). SF denotes source-free constraint.
+
+| # Variation | SF | Office-Home |
| SSDA | MSDA |
| 1. Source-only baseline | - | 60.2 | 66.9 |
| 2. + sticker-w-OOS-clsf | - | 61.9 | 71.4 |
| 3. Adaptation baseline (B) | ✓ | 66.2 | 74.3 |
| 4. B + only-OOS-clsf | ✓ | 67.0 | 74.9 |
| 5. B + only-sticker-clsf | ✓ | 69.7 | 76.2 |
| 6. B + sticker-w-OOS-clsf | ✓ | 73.1 | 77.6 |
| 7. B + sticker-w-OOS-clsf | ✗ | 74.5 | 78.3 |
+
+observe gains of $0.8\%$ and $0.6\%$ for SSDA and MSDA respectively. This indicates that only OOS helps, but subsidiary classifier is essential for further improvements. Next, we compare the baseline (#3) with concurrent goal-subsidiary DA without using OOS (#5). We observe an improvement of $3.5\%$ and $1.9\%$ for SSDA and MSDA. Adding the OOS objective to the subsidiary supervised DA (#6 vs. #4) improves the source-target alignment as explained in Insight 6, resulting in improvements of $3.1\%$ and $1.4\%$ for SSDA and MSDA.
+
+b) Subsidiary-goal task similarity. As per Insight 3, higher goal-subsidiary task similarity is important for effective learning of both tasks. Thus, in Table 5, we compare the source-only baseline (#1) with only subsidiary supervised DA without goal task target adaptation (#2). We observe gains of $1.7\%$ and $1.3\%$ for SSDA and MSDA respectively. This illustrates the positive correlation between sticker classification and goal task even when target goal losses are not used.
+
+# 5 Conclusion
+
+In this work, we introduced concurrent subsidiary supervised DA for a pretext-like task to aid the unsupervised goal task DA. We provide theoretical insights to analyze the effect of subsidiary supervised DA on the domain discrepancy and consequently on the goal task adaptation. Based on the insights, we introduce a subsidiary DA suitability criteria to determine DA-assistive subsidiary tasks that improve the goal task DA performance. We also propose a novel sticker intervention based pretext task that follows our criteria. The proposed approach outperforms prior state-of-the-art source-free SSDA and MSDA works on four standard benchmarks, establishing the usefulness of our approach.
+
+Acknowledgments. This work was supported by MeitY (Ministry of Electronics and Information Technology) project (No. 4(16)2019-ITEA), Govt. of India and a research grant by Google.
+
+# References
+
+1. Aggarwal, S., Kundu, J.N., Babu, R.V., Chakraborty, A.: WAMDA: Weighted alignment of sources for multi-source domain adaptation. In: BMVC (2020) 12
+2. Ahmed, S.M., Raychaudhuri, D.S., Paul, S., Oymak, S., Roy-Chowdhury, A.K.: Unsupervised multi-source domain adaptation without access to source data. In: CVPR (2021) 12
+3. Ben-David, S., Blitzer, J., Crammer, K., Pereira, F.: Analysis of representations for domain adaptation. In: NeurIPS (2006) 1, 2, 5
+4. Bousmalis, K., Silberman, N., Dohan, D., Erhan, D., Krishnan, D.: Unsupervised pixel-level domain adaptation with generative adversarial networks. In: CVPR (2017) 4
+5. Carlucci, F.M., D'Innocente, A., Bucci, S., Caputo, B., Tommasi, T.: Domain generalization by solving jigsaw puzzles. In: CVPR (2019) 1, 3, 4, 7, 8
+6. Chen, Y.H., Chen, W.Y., Chen, Y.T., Tsai, B.C., Frank Wang, Y.C., Sun, M.: No more discrimination: Cross city adaptation of road scene segmenters. In: ICCV (2017) 1
+7. Doersch, C., Gupta, A., Efros, A.A.: Unsupervised visual representation learning by context prediction. In: ICCV (2015) 4
+8. Dong, J., Fang, Z., Liu, A., Sun, G., Liu, T.: Confident anchor-induced multi-source free domain adaptation. In: NeurIPS (2021) 12
+9. Feng, Z., Xu, C., Tao, D.: Self-supervised representation learning from multidomain data. In: ICCV (2019) 4
+10. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. The Journal of Machine Learning Research 17(1), 2096-2030 (2016) 1, 5, 9, 13
+11. Ghifary, M., Kleijn, W.B., Zhang, M., Balduzzi, D.: Domain generalization for object recognition with multi-task autoencoders. In: ICCV (2015) 4
+12. Ghifary, M., Kleijn, W.B., Zhang, M., Balduzzi, D., Li, W.: Deep reconstruction-classification networks for unsupervised domain adaptation. In: ECCV (2016) 4
+13. Gidaris, S., Singh, P., Komodakis, N.: Unsupervised representation learning by predicting image rotations. In: ICLR (2018) 1, 2, 4
+14. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016) 12
+15. Jiaolong, X., Liang, X., López, A.M.: Self-supervised domain adaptation for computer vision tasks. IEEE Access 7, 156694-156706 (2019) 4, 8
+16. Kim, D., Saito, K., Oh, T.H., Plummer, B.A., Sclaroff, S., Saenko, K.: CDS: Cross-domain self-supervised pre-training. In: ICCV (2021) 4
+17. Kundu, J.N., Kulkarni, A., Bhambri, S., Mehta, D., Kulkarni, S., Jampani, V., Babu, R.V.: Balancing discriminability and transferability for source-free domain adaptation. In: ICML (2022) 3
+18. Kundu, J.N., Kulkarni, A., Singh, A., Jampani, V., Babu, R.V.: Generalize then adapt: Source-free domain adaptive semantic segmentation. In: ICCV (2021) 4
+19. Kundu, J.N., Venkat, N., M V, R., Babu, R.V.: Universal source-free domain adaptation. In: CVPR (2020) 4, 9
+20. Kundu, J.N., Venkat, N., Revanur, A., V, R.M., Babu, R.V.: Towards inheritable models for open-set domain adaptation. In: CVPR (2020) 4
+21. Kundu, J.N., Venkatesh, R.M., Venkat, N., Revanur, A., Babu, R.V.: Class incremental domain adaptation. In: ECCV (2020) 3
+
+22. Larsson, G., Maire, M., Shakhnarovich, G.: Colorization as a proxy task for visual understanding. In: CVPR (2017) 3, 4, 8
+23. Li, R., Jiao, Q., Cao, W., Wong, H.S., Wu, S.: Model adaptation: Unsupervised domain adaptation without source data. In: CVPR (2020) 3, 4, 9
+24. Li, S., Xie, M., Lv, F., Liu, C.H., Liang, J., Qin, C., Li, W.: Semantic concentration for domain adaptation. In: ICCV (2021) 11, 12
+25. Li, Y., Yuan, L., Chen, Y., Wang, P., Vasconcelos, N.: Dynamic transfer for multi-source domain adaptation. In: CVPR (2021) 12
+26. Liang, J., Hu, D., Feng, J.: Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In: ICML (2020) 3, 4, 11, 12
+27. Liang, J., Hu, D., Wang, Y., He, R., Feng, J.: Source data-absent unsupervised domain adaptation through hypothesis transfer and labeling transfer. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021) 4, 11, 12
+28. Liu, Y., Zhang, W., Wang, J.: Source-free domain adaptation for semantic segmentation. In: CVPR (2021) 4
+29. Long, M., Cao, Y., Wang, J., Jordan, M.: Learning transferable features with deep adaptation networks. In: ICML (2015) 5
+30. Long, M., Cao, Z., Wang, J., Jordan, M.I.: Conditional adversarial domain adaptation. In: NeurIPS (2017) 1, 13, 14
+31. Mishra, S., Saenko, K., Saligrama, V.: Surprisingly simple semi-supervised domain adaptation with pretraining and consistency. In: BMVC (2021) 1, 2, 3, 8, 9, 12
+32. Mitsuzumi, Y., Irie, G., Ikami, D., Shibata, T.: Generalized domain adaptation. In: CVPR (2021) 7, 10
+33. Na, J., Jung, H., Chang, H.J., Hwang, W.: FixBi: Bridging domain spaces for unsupervised domain adaptation. In: CVPR (2021) 11, 14
+34. Nguyen, V.A., Nguyen, T., Le, T., Tran, Q.H., Phung, D.: STEM: An approach to multi-source domain adaptation with guarantees. In: ICCV (2021) 12
+35. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: ECCV (2016) 1, 2, 4
+36. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018) 4
+37. Parkhi, O.M., Vedaldi, A., Zisserman, A., Jawahar, C.V.: Cats and dogs. In: CVPR (2012) 2
+38. Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., Efros, A.A.: Context encoders: Feature learning by inpainting. In: CVPR (2016) 3, 4, 8
+39. Peng, X., Bai, Q., Xia, X., Huang, Z., Saenko, K., Wang, B.: Moment matching for multi-source domain adaptation. In: ICCV (2019) 12
+40. Peng, X., Usman, B., Kaushik, N., Hoffman, J., Wang, D., Saenko, K.: VisDA: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924 (2017) 12
+41. Prabhu, V., Khare, S., Kartik, D., Hoffman, J.: SENTRY: Selective entropy optimization via committee consistency for unsupervised domain adaptation. In: ICCV (2021) 11
+42. Qiu, Z., Zhang, Y., Lin, H., Niu, S., Liu, Y., Du, Q., Tan, M.: Source-free domain adaptation via avatar prototype generation and adaptation. In: IJCAI (2021) 11
+43. Ren, Z., Lee, Y.J.: Cross-domain self-supervised multi-task feature learning using synthetic imagery. In: CVPR (2018) 4
+44. Saenko, K., Kulis, B., Fritz, M., Darrell, T.: Adapting visual category models to new domains. In: ECCV (2010) 12
+45. Saito, K., Kim, D., Sclaroff, S., Saenko, K.: Universal domain adaptation through self supervision. In: NeurIPS (2020) 4
+
+46. Saito, K., Yamamoto, S., Ushiku, Y., Harada, T.: Open set domain adaptation by backpropagation. In: ECCV (2018) 4
+47. Salman, H., Ilyas, A., Engstrom, L., Kapoor, A., Madry, A.: Do adversarially robust imagenet models transfer better? In: NeurIPS (2020) 5
+48. Scalbert, M., Vakalopoulou, M., Couzini'e-Devy, F.: Multi-source domain adaptation via supervised contrastive learning and confident consistency regularization. In: BMVC (2021) 12, 14
+49. Sivaprasad, P.T., Fleuret, F.: Uncertainty reduction for model adaptation in semantic segmentation. In: CVPR (2021) 4
+50. Sun, B., Saenko, K.: Deep CORAL: Correlation alignment for deep domain adaptation. In: ECCV (2016) 5, 9
+51. Sun, Y., Tzeng, E., Darrell, T., Efros, A.A.: Unsupervised domain adaptation through self-supervision. arXiv preprint arXiv:1909.11825 (2019) 1, 3, 4, 8, 9, 12
+52. Tang, H., Chen, K., Jia, K.: Unsupervised domain adaptation via structurally regularized deep clustering. In: CVPR (2020) 13, 14
+53. Venkat, N., Kundu, J.N., Singh, D.K., Revanur, A., Babu, R.V.: Your classifier can secretly suffice multi-source domain adaptation. In: NeurIPS (2020) 12
+54. Venkateswara, H., Eusebio, J., Chakraborty, S., Panchanathan, S.: Deep hashing network for unsupervised domain adaptation. In: CVPR (2017) 12
+55. Wallace, B., Hariharan, B.: Extending and analyzing self-supervised learning across domains. In: ECCV (2020) 2
+56. Wang, X., Peng, Y., Lu, L., Lu, Z., Bagheri, M., Summers, R.: ChestX-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In: CVPR (2017) 2
+57. Wu, Z., Xiong, Y., Yu, S.X., Lin, D.: Unsupervised feature learning via non-parametric instance discrimination. In: CVPR (2018) 4
+58. Xia, H., Zhao, H., Ding, Z.: Adaptive adversarial network for source-free domain adaptation. In: ICCV (2021) 11
+59. Yang, S., Wang, Y., van de Weijer, J., Herranz, L., Jui, S.: Exploiting the intrinsic neighborhood structure for source-free domain adaptation. In: NeurIPS (2021) 4, 11, 12
+60. Yang, S., Wang, Y., van de Weijer, J., Herranz, L., Jui, S.: Generalized source-free domain adaptation. In: ICCV (2021) 11
+61. You, K., Long, M., Cao, Z., Wang, J., Jordan, M.I.: Universal domain adaptation. In: CVPR (2019) 4
+62. Zhang, R., Isola, P., Efros, A.A.: Colorful image colorization. In: ECCV (2016) 4, 8
+63. Zhang, R., Isola, P., Efros, A.A.: Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In: CVPR (2017) 4
+64. Zhao, H., Combes, R.T.D., Zhang, K., Gordon, G.: On learning invariant representations for domain adaptation. In: ICML (2019) 2, 5
\ No newline at end of file
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/images.zip b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..feeed9515023dd037469a95a8157109ff71bbe09
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4a5732542aff81390fc5fa0e55dac5da678f71d9d530f1797132e12f5d10a161
+size 493696
diff --git a/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/layout.json b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..842ce37bd2fe3b862c19136774daefee0bbfeff8
--- /dev/null
+++ b/concurrentsubsidiarysupervisionforunsupervisedsourcefreedomainadaptation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7707686617f8b63991dfb68844e8b979db7d7085e8f4880006214f8445d85b1d
+size 556479
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_content_list.json b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8d49a5fc5eb48f9806b2160251bc2d4295b3b424
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d8040d1c93c0ec4d98d8d81855f66023c9c02eb8b2ada1450abe64ca3d14aa4f
+size 88851
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_model.json b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..19c21da5dcdab1b34a0bd0c4a211ef9e667d83b9
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54c4d1eb11fd9554b7864194ccc70c2c38f978fc23bdb138319cf93c68089988
+size 112722
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_origin.pdf b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..edb8a2a5c6d9a4e362c614b5e00c1594828c388a
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/ee19af33-8186-41de-ab0e-fb5353f6f31f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3bc4d90d8f472bc4fe81e067dfbf22aa767fa6fb85f4f85e3d2da53c5f482d0
+size 7599971
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/full.md b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..ca074939f36cfdcb78317779565f6039e66a7ab2
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/full.md
@@ -0,0 +1,315 @@
+# Conditional-Flow NeRF: Accurate 3D Modelling with Reliable Uncertainty Quantification
+
+Jianxiong Shen1, Antonio Agudo1, Francesc Moreno-Noguer1, and Adria Ruiz2
+
+$^{1}$ Institut de Robòtica i Informàtica Industrial, CSIC-UPC, Barcelona, Spain
+ $^{2}$ Seedtag, Spain
+
+Abstract. A critical limitation of current methods based on Neural Radiance Fields (NeRF) is that they are unable to quantify the uncertainty associated with the learned appearance and geometry of the scene. This information is paramount in real applications such as medical diagnosis or autonomous driving where, to reduce potentially catastrophic failures, the confidence on the model outputs must be included into the decision-making process. In this context, we introduce Conditional-Flow NeRF (CF-NeRF), a novel probabilistic framework to incorporate uncertainty quantification into NeRF-based approaches. For this purpose, our method learns a distribution over all possible radiance fields modelling the scene which is used to quantify the uncertainty associated with the modelled scene. In contrast to previous approaches enforcing strong constraints over the radiance field distribution, CF-NeRF learns it in a flexible and fully data-driven manner by coupling Latent Variable Modelling and Conditional Normalizing Flows. This strategy allows to obtain reliable uncertainty estimation while preserving model expressivity. Compared to previous state-of-the-art methods proposed for uncertainty quantification in NeRF, our experiments show that the proposed method achieves significantly lower prediction errors and more reliable uncertainty values for synthetic novel view and depth-map estimation.
+
+Keywords: 3D, scene representation, uncertainty quantification
+
+# 1 Introduction
+
+Neural fields [62] have recently gained a lot of attention given its ability to encode implicit representations of complex 3D scenes using deep neural networks. Additionally, they have been shown very effective in addressing multiple problems such as 3D reconstruction [32,39], scene rendering [27,31] or human body representation [38,50]. Among different methods built upon this framework [41,5,55], Neural Radiance Fields (NeRF) [33] has obtained impressive results in generating photo-realistic views of 3D scenes and solving downstream tasks such as depth estimation [61], scene editing [26,15] or pose prediction [65,56].
+
+Despite its increasing popularity, a critical limitation of NeRF holding back its application to real-world problems has been recently pointed out by [53]. Concretely, current NeRF-based methods are not able to quantify the uncertainty
+
+
+RGB GT
+
+
+RGBPred.
+
+
+RGB Uncertainty
+
+
+Depth GT
+Fig.1. Ground Truth (Left), Predictions (Center) and Uncertainty Maps (Right) obtained by our proposed CF-NeRF in novel view synthesis and depth-map estimation.
+
+
+DepthPred.
+
+
+Depth Uncertainty
+
+associated with the model estimates. This information is crucial in several scenarios such as robotics [28,22], medical diagnosis [52] or autonomous driving [8] where, to reduce potentially catastrophic failures, the confidence on the model outputs must be included into the decision-making process.
+
+To address this limitation, recent works [31,53] have explored different strategies to incorporate uncertainty quantification into NeRF. Remarkably, Stochastic NeRF [53] (S-NeRF) has recently obtained state-of-the-art results by employing a probabilistic model to learn a simple distribution over radiance fields. However, in order to make this problem tractable, S-NeRF makes strong assumptions over the aforementioned distribution, thus limiting model expressivity and leading to sub-optimal results for complex 3D scenes.
+
+In this context, we propose Conditional-Flow NeRF (CF-NeRF), a novel probabilistic framework to incorporate uncertainty quantification without sacrificing model flexibility. As a result, our approach enables both effective 3D modelling and reliable uncertainty estimates (see Fig. 1). In the following, we summarise the main technical contributions of our method:
+
+Modelling Radiance-Density Distributions with Normalizing Flows: In contrast to S-NeRF where the radiance and density in the scene are assumed to follow simple distributions (see Fig. 2(c-Top)), our method learns them in a flexible and fully data-driven manner using conditional normalizing flows [64]. This allows CF-NeRF to learn arbitrarily complex radiance and density distributions (see Fig. 2(c-Bottom)) which have the capacity to model scenes with complex geometry and appearance.
+
+Latent Variable Modelling for Radiance Fields Distributions: Motivated by De Finetti's Theorem [17], CF-NeRF incorporates a global latent variable in order to efficiently model the joint distribution over the radiance-density vari
+
+
+S-NeRF
+
+
+
+
+
+
+
+
+Oms
+(a) RGB image
+Fig. 2. Comparison between our CF-NeRF and the previous state-of-the-art method S-NeRF [53] on (a) RGB images and (b) depth-maps. S-NeRF generates noisy results due to the strong assumptions made over the radiance field distribution. In contrast, CF-NeRF renders more realistic and smooth synthetic views. (c) Illustration of the radiance distributions that can be modelled by S-NeRF and CF-NeRF. While the first is only able to represent distributions with a simple form, CF-NeRF can model arbitrary complex distributions by using Conditional Normalizing Flows.
+
+
+
+
+(b) depth
+(c) distribution assumption
+
+
+
+ables for all the spatial locations in the scene. This contrasts with the approach followed by S-NeRF, where these variables are considered independent for different 3D coordinates. Intuitively, the independence assumption violates the fact that changes in the density and radiance between adjacent locations are usually smooth. As a consequence, S-NeRF tends to generate low-quality and noisy predictions (see Fig. 2(a,b)-Top). In contrast, the global latent variable used in CF-NeRF allows to efficiently model the complex joint distribution of these variables, leading to spatially-smooth uncertainty estimates and more realistic results (Fig. 2(a,b)-Bottom).
+
+In our experiments, we evaluate CF-NeRF over different benchmark datasets containing scenes with increasing complexity. Our qualitative and quantitative results show that our method obtains significantly better uncertainty estimations for rendered views and predicted depth maps compared to S-NeRF and other previous methods for uncertainty quantification. Additionally, CF-NeRF provides better image quality and depth estimation precision. These results confirm that our method is able to incorporate uncertainty quantification into NeRF without sacrificing model expressivity.
+
+# 2 Related Work
+
+Neural Radiance Fields. NeRF [33] has become a popular approach for 3D scene modelling due to its simplicity and its impressive performance on several
+
+tasks. By using a sparse collection of 2D views, NeRF learns a deep neural network encoding a representation of the 3D scene. This network is composed of a set of fully-connected layers that output the volume density and emitted radiance for any input 3D spatial location and 2D viewing direction in the scene. Subsequently, novel views are generated by applying volumetric rendering [16] to the estimated density and radiance values obtained by the network. Recently, several extensions [68,42,36,19,70,54,58,51,66] over NeRF have been proposed. For instance, different works have focused on accelerating NeRF training [25,57,48] or modelling dynamic scenes [44,10,47,23,40]. Despite the advances achieved at different levels, the application of current NeRF-based methods in real scenarios is still limited since they are unable to quantify the uncertainty associated with the rendered views or estimated geometry. Our proposed CF-NeRF explicitly addresses this problem and can be easily combined with most of current NeRF-based approaches.
+
+Uncertainty Estimation in Deep Learning. Uncertainty estimation has been extensively studied in deep learning [13,7,30,59,12] and have been applied to different computer vision tasks [46,3,63]. Early works proposed to use Bayesian Neural Networks (BNN) [34,35] to estimate the uncertainty of both network weights and outputs by approximating their marginal distributions. However, training BNNs is typically difficult and computationally expensive. As a consequence, their use in large deep neural networks is limited. More recently, efficient strategies have been proposed to incorporate uncertainty estimation into deep neural networks [49,6]. Among them, MC-Dropout [11] and Deep Ensembles [20] are two of the most popular approaches given that they are agnostic to the specific network architecture [1,14,2,24]. More concretely, MC-Dropout adds stochastic dropout during inference into the intermediate network layers. By doing multiple forward passes over the same input with different dropout configurations, the variance over the obtained set of outputs is used as the output uncertainty. On the other hand, Deep Ensembles applies a similar strategy by computing a set of outputs from multiple neural networks that are independently trained using different parameters initializations. In contrast to MC-Dropout and Deep Ensembles, however, we do not train independent networks to generate the samples. Instead, CF-NeRF explicitly encodes the distribution of the radiance fields into a single probabilistic model.
+
+Uncertainty Estimation in NeRF. Recently, some works [31,53] have attempted to incorporate uncertainty estimation into Neural Radiance Fields. NeRF-in-the-Wild (NeRF-W) [31] modelled uncertainty at pixel-level in order to detect potential transient objects such as cars or pedestrians in modelled scenes. For this purpose, NeRF-W employs a neural network to estimate an uncertainty value for each 3D spatial location. Subsequently, it computes a confidence score for each pixel in a rendered image by using an alpha-compositing strategy similar to the one used to estimate the pixel color in original NeRF. However, this approach is not theoretically grounded since there is no intuitive justification to apply the volume rendering process over uncertainty values. Additionally, NeRF-W is not able to evaluate the confidence associated with estimated depth. On the
+
+other hand, S-NeRF [53] has achieved state-of-the-art performance in quantifying the uncertainty of novel rendered views and depth-maps. Instead of learning a single radiance field as in original NeRF [33], S-NeRF models a distribution over all the possible radiance fields explaining the scene. During inference, this distribution is used to sample multiple color or depth predictions and compute a confidence score based on their associated variance. However, S-NeRF imposes strong constraints over the radiance field distribution and, as a consequence, this limits its ability to model scenes with complex appearance and geometry. In contrast, the proposed CF-NeRF combines a conditional normalizing flow and latent variable modelling to learn arbitrary complex radiance fields distributions without any prior assumption.
+
+Complex Distribution Modelling with Normalizing Flows. Normalizing Flows (NF) have been extensively used to model complex distributions with unknown explicit forms. For this purpose, NF uses a sequence of invertible functions to transform samples from a simple known distribution to variables following an arbitrary probability density function. Additionally, the change-of-variables formula can be used to compute the likelihood of different samples according to the transformed distribution. Given its flexibility, Normalizing Flows have been used in several 3D modelling tasks. For instance, [64,45] introduced different flow-based generative models to model 3D point cloud distributions and sample from them. More recently, [37] used a normalizing flow in order to avoid color shifts at unseen viewpoints in the context of NeRF. To the best of our knowledge, our proposed CF-NeRF is the first approach employing Normalizing Flows in order to learn radiance fields distributions for 3D scene modelling.
+
+# 3 Deterministic and Stochastic Neural Radiance Fields
+
+Deterministic Neural Radiance Fields. Standard NeRF [33] represents a 3D volumetric scene as $\mathcal{F} = \{(\mathbf{r}(\mathbf{x},\mathbf{d}),\alpha (\mathbf{x})): \mathbf{x}\in \mathbb{R}^3,\mathbf{d}\in \mathbb{R}^2\}$ , where $\mathcal{F}$ is a set containing the volume density $\alpha (\mathbf{x})\in \mathbb{R}^{+}$ and RGB radiance $\mathbf{r}(\mathbf{x},\mathbf{d})\in \mathbb{R}^3$ from all the spatial locations $\mathbf{x}$ and view directions $\mathbf{d}$ in the scene.
+
+In order to implicitly model the infinite set $\mathcal{F}$ , NeRF employs a neural network $f_{\theta}(\mathbf{x},\mathbf{d})$ with parameters $\theta$ which outputs the density $\alpha$ and radiance $\mathbf{r}$ for any given input location-view pair $\{\mathbf{x},\mathbf{d}\}$ . Using this network, NeRF is able to estimate the color $\mathbf{c}(\mathbf{x}_o,\mathbf{d})$ for any given pixel defined by a 3D camera position $\mathbf{x}_o$ and view direction $\mathbf{d}$ using the volumetric rendering function:
+
+$$
+\mathbf {c} (\mathbf {x} _ {o}, \mathbf {d}) = \int_ {t _ {n}} ^ {t _ {f}} T (t) \alpha (\mathbf {x} _ {t}) \mathbf {r} (\mathbf {x} _ {t}, \mathbf {d}) d t, \mathrm {w h e r e} T (t) = \exp (- \int_ {t _ {n}} ^ {t} \alpha (\mathbf {x} _ {s}) d s), \quad (1)
+$$
+
+and where $\mathbf{x}_t = \mathbf{x}_o + t\mathbf{d}$ corresponds to 3D locations along a ray with direction $\mathbf{d}$ originated at the camera origin and intersecting with the pixel at $\mathbf{x}_o$ .
+
+During training, NeRF optimizes the network parameters $\pmb{\theta}$ using Eq. (1) by leveraging Maximum Likelihood Estimation (MLE) over a training set $\mathcal{T}$ containing ground-truth images depicting views of the scene captured from different
+
+camera positions. More details about NeRF and its learning procedure can be found in the original paper [33].
+
+Stochastic Neural Radiance Fields. Deterministic NeRF is not able to provide information about the underlying uncertainty associated with the rendered views or estimated depth maps. The reason is that the network $f_{\theta}(\mathbf{x}, \mathbf{d})$ is trained using Maximum Likelihood Estimation and thus, the learning process performs a single point estimate over all the plausible radiance fields $\mathcal{F}$ given the training set $\mathcal{T}$ . As a consequence, model predictions are deterministic and it is not possible to sample multiple outputs to compute their associated variance.
+
+To address this limitation, S-NeRF [53] employs Bayesian Learning to model the posterior distribution $p_{\theta}(\mathcal{F}|\mathcal{T})$ over all the plausible radiance fields explaining the scene given the training set. In this manner, uncertainty estimations can be obtained during inference by computing the variance over multiple predictions obtained from different radiance fields $\mathcal{F}$ sampled from this distribution.
+
+In order to make this problem tractable, S-NeRF uses Variational Inference to approximate the posterior $p_{\theta}(\mathcal{F}|\mathcal{T})$ with a parametric distribution $q_{\theta}(\mathcal{F})$ implemented by a deep neural network. However, S-NeRF imposes two limiting constraints over $q_{\theta}(\mathcal{F})$ . Firstly, it models the radiance $\mathbf{r}$ and density $\alpha$ for each location-view pair in the scene as independent variables. In particular, the probability of a radiance field given $\mathcal{T}$ is modelled with a fully-factorized distribution:
+
+$$
+q _ {\boldsymbol {\theta}} (\mathcal {F}) = \prod_ {\mathbf {x} \in \mathbb {R} ^ {3}} \prod_ {\mathbf {d} \in \mathbb {R} ^ {2}} q _ {\boldsymbol {\theta}} (\mathbf {r} | \mathbf {x}, \mathbf {d}) q _ {\boldsymbol {\theta}} (\alpha | \mathbf {x}). \tag {2}
+$$
+
+Whereas this conditional-independence assumption simplifies the optimization process, it ignores the fact that radiance and density values in adjacent spatial locations are usually correlated. As a consequence, S-NeRF tends to render noisy and low-quality images and depth maps (see Fig. 2).
+
+# 4 Conditional Flow-based Neural Radiance Fields
+
+Our proposed Conditional Flow-based Neural Radiance Fields incorporates uncertainty estimation by using a similar strategy than S-NeRF. In particular, CF-NeRF learns a parametric distribution $q_{\theta}(\mathcal{F})$ approximating the posterior distribution $p(\mathcal{F}|\mathcal{T})$ over all the possible radiance fields given the training views. Different from S-NeRF, however, our method does not assume a simple and fully-factorized distribution for $q_{\theta}(\mathcal{F})$ , but it relies on Conditional Normalizing Flows and Latent Variable Modelling to preserve model expressivity. In the following, we discuss the technical details of our approach (Sec. 4.1), the optimizing process following S-NeRF (Sec. 4.2) and inference procedure used to compute the uncertainty associated with novel rendered views and depth maps (Sec. 4.3).
+
+# 4.1 Modelling Flexible Radiance Field Distributions with CF-NeRF
+
+Radiance Field distribution with Global Latent Variable. As discussed in Sec. 3, S-NeRF formulation assumes that radiance and density variables at
+
+
+Fig. 3. (Left) We use two Conditional Normalizing Flow (CNF) to sample radiance and density values from distributions $q_{\theta}(\mathbf{r}|\mathbf{x}, \mathbf{d}, \mathbf{z})$ and $q_{\theta}(\alpha|\mathbf{x}, \mathbf{z})$ , respectively. Each CNF computes a transformation of a sample from the latent distribution $q_{\psi}(\mathbf{z})$ conditioned to an embedding $\mathbf{h}$ . This embedding which is computed by an MLP with the location-view pair $(\mathbf{x}, \mathbf{d})$ as input. (Right) Each CNF is composed by a sequence of invertible transformation functions $f_{1:K}$ conditioned on $\mathbf{h}$ .
+
+
+
+each spatial location in the field follows a fully-factorized distribution (Eq. (2)). As a consequence, they are forced to be independent from each other. This simplification was motivated by the fact that modelling the joint distribution over the infinite set of radiance and density variables in the field $\mathcal{F}$ is not trivial. To address this problem, our proposed CF-NeRF leverages De Finetti's representation theorem [17]. In particular, the theorem states that any joint distribution over sets of exchangeable variables can be written as a fully-factorized distribution conditioned on a global latent variable. Based on this observation, we define the approximate posterior $q_{\theta}(\mathcal{F})$ :
+
+$$
+q _ {\boldsymbol {\theta}} (\mathcal {F}) = \int_ {\mathbf {z}} q _ {\vartheta} (\mathbf {z}) q _ {\boldsymbol {\theta}} (\mathcal {F} | \mathbf {z}) d \mathbf {z} = \int_ {\mathbf {z}} q _ {\vartheta} (\mathbf {z}) \prod_ {\mathbf {x} \in \mathbb {R} ^ {3}} \prod_ {\mathbf {d} \in \mathbb {R} ^ {2}} q _ {\boldsymbol {\theta}} (\mathbf {r} | \mathbf {x}, \mathbf {d}, \mathbf {z}) q _ {\boldsymbol {\theta}} (\alpha | \mathbf {x}, \mathbf {z}) d \mathbf {z}, \tag {3}
+$$
+
+where the latent variable $\mathbf{z}$ is sampled from a Gaussian prior $q_{\vartheta}(\mathbf{z}) = \{\mu_z,\sigma_z\}$ with learned mean and variance. In this manner, all the 3D spatial-locations $\mathbf{x}$ and viewing-directions $\mathbf{d}$ generated from the same shared latent variable $\mathbf{z}$ and thus, they are conditionally dependent between them. This approach allows CF-NeRF to efficiently model the distribution over the radiance-density variables in the radiance field without any independence assumption. It is also worth mentioning that De Fineti's theorem has been also used in previous works learning joint distributions over sets for 3D point cloud modelling [18].
+
+Radiance-Density Conditional Flows. Given that the radiance-density distributions can be highly complicated for complex scenes, modelling them with variants of Gaussian distributions as in Stochastic NeRF can lead to sub-optimal results. For this reason, CF-NeRF models $q_{\theta}(\mathbf{r}|\mathbf{x}, \mathbf{d}, \mathbf{z})$ and $q_{\theta}(\alpha|\mathbf{x}, \mathbf{z})$ using a Conditional Normalizing Flow (CNF) [4]. This allows to learn arbitrarily complex distributions in a fully data-driven manner without any prior assumption.
+
+For any input location-direction pair $(\mathbf{x},\mathbf{d})$ , we use a sequence of $K$ CNFs that transform the global latent variable $\mathbf{z}$ into samples from the radiance $\mathbf{r}$ or density $\alpha$ distribution $q_{\theta}(\mathbf{r}|\mathbf{x},\mathbf{d},\mathbf{z})$ or $q_{\theta}(\alpha |\mathbf{x},\mathbf{z})$ . More formally, each flow is defined as an invertible parametric function $\mathbf{z}_k = f_k(\mathbf{z}_{k - 1},\mathbf{x},\mathbf{d})$ , where $f_{k}$ maps
+
+
+(a) Sampling Global Prior
+(b) Distribution Modelling by CNF
+(c) Rendering and Optimization
+Fig. 4. Illustration of our pipeline for the inference and computation of the log-likelihood on the pixel color. (a) We sample a set of variables $\mathbf{z}$ from the global latent distribution. (b) Given each spatial location $\mathbf{x}$ along a camera ray with viewing direction $\mathbf{d}$ , we can generate a set of density and radiance values by passing each $\mathbf{z}$ variable through our proposed CNF. (c) These values can be represented as a set of different density-radiance trajectories along the ray corresponding to each $\mathbf{z}$ , followed by volume rendering techniques to composite each trajectory into a RGB value. Finally, these RGB values are used to compute the log-likelihood for the pixel color and also estimate the model prediction and its associated uncertainty using their mean and variance during inference.
+
+a random variable $\mathbf{z}_{k-1}$ into another one $\mathbf{z}_k$ with a more complex distribution. Note that the each flow $f_k$ is conditioned on the location and view direction $(\mathbf{x}, \mathbf{d})$ . Finally, $\mathbf{z}_K$ is followed by a Sigmoid and Softplus activation functions for radiance and density samples, respectively. This process is detailed in Fig. 3.
+
+Using the introduced CNF, radiance and density probabilities $q_{\theta}(\mathbf{r}|\mathbf{x}, \mathbf{d}, \mathbf{z})$ and $q_{\theta}(\alpha|\mathbf{x}, \mathbf{z})$ can be computed with the change-of-variables formula typically used in normalizing flows as:
+
+$$
+q _ {\boldsymbol {\theta}} (\mathbf {r} | \mathbf {x}, \mathbf {d}, \mathbf {z}) = q _ {\vartheta} (\mathbf {z}) \left| \det \frac {\partial \mathbf {z}}{\partial \mathbf {r}} \right| = q _ {\vartheta} (\mathbf {z}) \left| \det \frac {\partial \mathbf {r}}{\partial \mathbf {z} _ {K}} \right| ^ {- 1} \prod_ {k = 1} ^ {K} \left| \det \frac {\partial \mathbf {z} _ {k}}{\partial \mathbf {z} _ {k - 1}} \right| ^ {- 1}, \tag {4}
+$$
+
+where $|\operatorname{det}(\partial \mathbf{z}_k / \partial \mathbf{z}_{k-1})|$ measures the Jacobian determinant of the transformation function $f_k$ . Note that $q_{\pmb{\theta}}(\alpha | \mathbf{x}, \mathbf{z})$ can be computed in a similar manner.
+
+# 4.2 Optimizing Conditional-Flow NeRF
+
+We adopt a Variational Bayesian approach to learn the parameters of the posterior distribution $q_{\theta}(\mathcal{F})$ defined in Eq. (3). Note that the optimized $\theta$ corresponds to the parameters of the CNFs defined in the previous section. More formally, we solve an optimization problem where we minimize the Kullback-Leibler (KL) divergence between $q_{\theta}(\mathcal{F})$ and the true posterior distribution $p(\mathcal{F}|\mathcal{T})$ of radiance fields given the training set:
+
+$$
+\begin{array}{l} \min _ {\boldsymbol {\theta}} \mathbb {K L} (q _ {\boldsymbol {\theta}} (\mathcal {F}) | | p (\mathcal {F} | \mathcal {T})) \\ = \min _ {\boldsymbol {\theta}} - \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathcal {F})} \log p (\mathcal {T} | \mathcal {F}) + \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathcal {F})} \log q _ {\boldsymbol {\theta}} (\mathcal {F}) - \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathcal {F})} \log p (\mathcal {F}). \tag {5} \\ \end{array}
+$$
+
+The first term in Eq. (5) measures the expected log-likelihood of the training set $\mathcal{T}$ over the distribution of radiance fields $q_{\theta}(\mathcal{F})$ . The second term indicates the negative Entropy of the approximated posterior. Intuitively, maximizing the Entropy term allows uncertainty estimation by preventing the optimized distribution to degenerate into a deterministic function where all the probability is assigned into a single radiance field $\mathcal{F}$ . Finally, the third term corresponds to the cross-entropy between $q_{\theta}(\mathcal{F})$ and a prior over radiance fields $p(\mathcal{F})$ . Given that it is hard to choose a proper prior in this case, we assume $p(\mathcal{F})$ to follow uniform distribution and thus, this term can be ignored during optimization. In the following, we detail how the first two terms are computed during training.
+
+Computing the log-likelihood. Assuming that the training set $\mathcal{T}$ is composed by $N$ triplets $\{\mathbf{C}_n,\mathbf{x}_n^o,\mathbf{d}_n\}$ representing the color, camera origin and view direction of a given pixel in a training image, the log-likelihood term in Eq. (5) is equivalent to: $\frac{1}{N}\sum_{n = 1}^{N}\log p(\mathbf{C}_n|\mathcal{F})$ . In order to compute an individual $p(\mathbf{C}_n|\mathcal{F})$ we use the following procedure.
+
+Firstly, we sample a set of variables $\mathbf{z}^{1:K}$ from the global latent distribution $q_{\vartheta}(\mathbf{z})$ . Secondly, given a training triplet $\{\mathbf{C},\mathbf{x}^o,\mathbf{d}\}$ and a set of 3D spatial locations along a ray defined by $\mathbf{x}_t = \mathbf{x}_o + t\mathbf{d}$ , we sample a set of density and radiance values $\{\alpha^{1:K}\}_{t_n:t_f}$ and $\{\mathbf{r}^{1:K}\}_{t_n:t_f}$ by using the Conditional Flow introduced in Sec. 4.1. In particular, we perform a forward pass over the flow with inputs $\mathbf{z}^k$ conditioned to $\mathbf{x}_t^*$ for all $t$ . Subsequently, a set of $K$ color estimates $\hat{\mathbf{C}}_{1:K}$ are obtained by using, for every $k$ , the volume rendering formula in Eq. (1) over the sampled radiance and density values $\{\alpha^k\}_{t_n:t_f}$ and $\{\mathbf{r}^k\}_{t_n:t_f}$ , respectively. Finally, with the set of obtained color estimations $\hat{\mathbf{C}}_{1:K}$ , we use a non-parametric kernel density estimator as in [53] to approximate the log-likelihood $\log p(\mathbf{C}|\mathcal{F})$ of the pixel color. An illustration of this procedure is shown in Fig. 4.
+
+Computing the Entropy term. In order to compute the entropy term in Eq. (5), we use a Monte Carlo approximation with $M$ samples as:
+
+$$
+\begin{array}{l} \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathcal {F})} \log q _ {\boldsymbol {\theta}} (\mathcal {F}) = \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathbf {z})} \prod_ {\mathbf {x} \in \mathbb {R} ^ {3}} \prod_ {\mathbf {d} \in \mathbb {R} ^ {2}} \log q _ {\boldsymbol {\theta}} (\mathbf {r} | \mathbf {x}, \mathbf {d}, \mathbf {z}) + \mathbb {E} _ {q _ {\boldsymbol {\theta}} (\mathbf {z} ^ {\alpha})} \prod_ {\mathbf {x} \in \mathbb {R} ^ {3}} \prod_ {\mathbf {d} \in \mathbb {R} ^ {2}} \log q _ {\boldsymbol {\theta}} (\alpha | \mathbf {x}, \mathbf {z}) \\ \sim \frac {1}{M} \sum_ {m = 1} ^ {M} \left(\log q _ {\boldsymbol {\theta}} \left(\mathbf {r} _ {m} \mid \mathbf {x} _ {m}, \mathbf {d} _ {m}, \mathbf {z} _ {m}\right) + \log q _ {\boldsymbol {\theta}} \left(\alpha_ {m} \mid \mathbf {x} _ {m}, \mathbf {z} _ {m}\right)\right), \tag {6} \\ \end{array}
+$$
+
+where $\mathbf{z}_m$ are obtained from the latent variable distribution $q_{\boldsymbol{\theta}}(\mathbf{z})$ and $\{\mathbf{x}_m, \mathbf{d}_m\}$ are possible 3D locations and view directions in the scene which are randomly sampled. Finally, $\alpha_m$ and $\mathbf{r}_m$ are density and radiance values obtained by applying our conditional flow with inputs $(\mathbf{z}_m, \mathbf{x}_m, \mathbf{d}_m)$ . Their probabilities $q_{\boldsymbol{\theta}}(\alpha_m | \mathbf{x}_m, \mathbf{z}_m)$ and $q_{\boldsymbol{\theta}}(\mathbf{r}_m | \mathbf{x}_m, \mathbf{d}_m, \mathbf{z}_m)$ can be computed by using Eq. (4).
+
+# 4.3 Inference and Uncertainty Estimation
+
+CF-NeRF allows us to quantify the uncertainty associated with rendered images and depth-maps. As described in Sec. 4.2, given any camera pose, we can obtain
+
+a set of color estimates $\hat{\mathbf{C}}_{1:K}$ for every pixel in a rendered image. These estimates are obtained by sampling a set of random variables $\mathbf{z}_{1:K}$ from latent distribution $q_{\vartheta}(\mathbf{z})$ and applying CF-NeRF. Finally, the mean and variance of the pixel colors over the K samples are treated as the predicted color and its associated uncertainty, respectively. For depth-map generation, we sample a sequence of density values $\{\alpha_k\}_{t_n:t_f}$ along a camera ray and we compute the expected termination depth of the ray as in [33]. In this way, we obtain a set of depth-values $d_{1:K}$ for each pixel in the depth-map for the rendered image. As in the case of the RGB color, its mean and variance correspond to the estimated depth and its associated uncertainty.
+
+# 5 Experiments
+
+Datasets. We conduct a set of exhaustive experiments over two benchmark databases typically used to evaluate NeRF-based approaches: the LLFF dataset from the original NeRF paper [33] and the Light Field LF dataset [68,67]. The first is composed of 8 relatively simple scenes with multiple-view forward-facing images. On the other hand, from the LF dataset we use 4 scenes: Africa, Basket, Statue and Torch. The evaluation over the LF scenes is motivated by the fact that they have a longer depth range compared to the ones in LLFF and, typically, they present more complicated geometries and appearance. As a consequence, the evaluation over LLFF gives more insights into the ability of NeRF-based methods to model complex 3D scenes. Same as [53], we use a sparse number of scene views $(4\sim 5)$ for training and the last adjacent views for testing. As discussed in the cited paper, training in an extremely low-data regime is a challenging task and provides an ideal setup to evaluate the ability of the compared methods to quantify the uncertainty associated with the model predictions. While the ground truth of depth is not available in the original datasets, we compute pseudo ground truth by using the method in [61] trained on all the available views per scene.
+
+Baselines. We compare our method with the state-of-the-art S-NeRF [53], NeRF-W [31] and two other methods, Deep-Ensembles(D.E.) [20] and MC-Dropout(Drop.) [11], which are generic approaches for uncertainty quantification in deep learning. For NeRF-W, we remove the latent embedding component of their approach and keep only the uncertainty estimation layers. For Deep-Ensembles, we train 3 different NeRF models in the ensemble in order to have a similar computational cost during training and testing compared to the rest of compared methods. In the case of MC-Dropout, we manually add one dropout layer after each odd layer in the network to sample multiple outputs using random dropout configurations. The described setup and hyper-parameters for the different baselines is the same previously employed in S-NeRF [53].
+
+Implementations details. In order to implement CF-NeRF and the different baselines, we inherit the same network architecture and hyper-parameters than the one employed in the original $\mathrm{NeRF}^3$ implementation. In CF-NeRF,
+
+Table 1. Quality and uncertainty quantification metrics on rendered images over the LLFF dataset. Best results are shown in bold with second best underlined.
+
+ | quality metrics | uncertainty metrics |
| PSNR↑ | SSIM↑ | LPIPS↓ | AUSE | RMSE↓ | AUSE MAE↓ |
| D.E. [20] | 22.32 | 0.788 | 0.236 | 0.0254 | 0.0122 | 1.98 |
| Drop. [11] | 21.90 | 0.758 | 0.248 | 0.0316 | 0.0162 | 1.69 |
| NeRF-W [31] | 20.19 | 0.706 | 0.291 | 0.0268 | 0.0113 | 2.31 |
| S-NeRF [53] | 20.27 | 0.738 | 0.229 | 0.0248 | 0.0101 | 0.95 |
| CF-NeRF | 21.96 | 0.790 | 0.201 | 0.0177 | 0.0078 | 0.57 |
+
+we use this architecture to compute the conditional part given $\mathbf{x}$ and $\mathbf{d}$ . Since CF-NeRF uses an additional normalizing flow following this network, we add additional layers for the rest of baselines so that they have a similar computational complexity than our method. See the supplementary material for more details on hyper-parameters of our conditional normalizing flow.
+
+Metrics. In our experiments, we address two different tasks using the compared methods: novel view synthesis and depth-map estimation. In particular, we evaluate the quality of generated images/depth-maps and the reliability of the quantified uncertainty using the following metrics:
+
+Quality metrics: We use standard metrics in the literature. Specifically, we report PSNR, SSIM [60], and LPIPS [69] for generated synthetic views. On the other hand, we compute RMSE, MAE and $\delta$ -threshold [9] to evaluate the quality of the generated depth-maps.
+
+Uncertainty Quantification: To evaluate the reliability of the uncertainty estimated by each model we report two widely used metrics for this purpose. Firstly, we use the negative log likelihood (NLL) which is a proper scoring rule [21,29] and has been previously used to evaluate the quality of model uncertainty [53]. Secondly, we evaluate the compared methods using sparsification curves [46,3,43]. Concretely, given an error metric (e.g. RMSE), we obtain two lists by sorting the values of all the pixels according to their uncertainty and the computed error. By removing the top $t\% (t = 1 \sim 100)$ of the errors in each vector and repeatedly computing the average of the last subset, we can obtain the sparsification curve and the oracle curve respectively. The area between is the AUSE, which evaluates how much the uncertainty is correlated with the error.
+
+# 5.1 Results over LLFF dataset
+
+Following a similar experimental setup than [53], we firstly evaluate the performance of the compared methods on the simple scenes in the LLFF dataset. All the views in each scene are captured in a restricted setting where all cameras are forward-facing towards a plane, which allows to use Normalized Device Coordinates (NDC) to bound all coordinates to a very small range(0-1). In Table 1, we report the performance of the different evaluated metrics averaged over all the scenes. As can be seen, S-NeRF achieves the second best performance in terms of uncertainty quantification with quality metrics comparable to the rest of baselines. These results are consistent with the results reported in their original
+
+Table 2. Quality and uncertainty quantification metrics on rendered images over LF dataset. Best results are shown in bold with second best underlined.
+
+| Scene Type | Methods | Quality Metrics | Uncertainty Metrics | Scene Type | Quality Metrics | Uncertainty Metrics |
| PSNR↑ | SSIM↑ | LPIPS↓ | AUSE RMSE↓ | AUSE MAE↓ | NLL↓ | PSNR↑ | SSIM↑ | LPIPS↓ | AUSE RMSE↓ | AUSE MAE↓ | NLL↓ |
| Basket | D.E. [20] | 25.93 | 0.87 | 0.17 | 0.206 | 0.161 | 1.26 | | 23.14 | 0.78 | 0.32 | 0.385 | 0.304 | 2.19 |
| Drop. [11] | 24.00 | 0.80 | 0.30 | 0.324 | 0.286 | 1.35 | | 22.13 | 0.72 | 0.42 | 0.396 | 0.339 | 1.69 |
| NeRF-W [31] | 19.81 | 0.73 | 0.31 | 0.333 | 0.161 | 2.23 | Afria | 21.14 | 0.71 | 0.42 | 0.121 | 0.089 | 1.41 |
| S-NeRF [53] | 23.56 | 0.80 | 0.23 | 0.098 | 0.089 | 0.26 | | 20.83 | 0.73 | 0.35 | 0.209 | 0.161 | 0.56 |
| CF-NeRF | 26.39 | 0.89 | 0.11 | 0.039 | 0.018 | -0.90 | | 23.84 | 0.83 | 0.23 | 0.077 | 0.054 | -0.25 |
| Statue | D.E. [20] | 24.57 | 0.85 | 0.21 | 0.307 | 0.214 | 1.53 | | 21.49 | 0.73 | 0.43 | 0.153 | 0.101 | 1.80 |
| Drop. [11] | 23.91 | 0.82 | 0.28 | 0.297 | 0.232 | 1.09 | | 19.23 | 0.62 | 0.59 | 0.226 | 0.154 | 3.09 |
| NeRF-W [31] | 19.89 | 0.73 | 0.41 | 0.099 | 0.071 | 3.03 | Torch | 15.59 | 0.56 | 0.69 | 0.132 | 0.131 | 1.52 |
| S-NeRF [53] | 13.24 | 0.55 | 0.59 | 0.475 | 0.714 | 4.56 | | 13.12 | 0.33 | 1.02 | 0.321 | 0.454 | 2.29 |
| CF-NeRF | 24.54 | 0.87 | 0.16 | 0.040 | 0.019 | -0.83 | | 23.95 | 0.86 | 0.17 | 0.047 | 0.015 | -0.86 |
+
+Table 3. Quality and uncertainty quantification metrics on depth estimation over the LF dataset. All the results are computed from disparity values which are reciprocal to depth. Best results are shown in bold with second best underlined.
+
+| Scene Type | Methods | Quality Metrics | Uncertainty Metrics | Scene Type | Quality Metrics | Uncertainty Metrics |
| RMSE↓ | MAE↓ | δ3↑ | AUSE RMSE↓ | AUSE MAE↓ | NLL↓ | RMSE↓ | MAE↓ | δ3↑ | AUSE RMSE↓ | AUSE MAE↓ | NLL↓ |
| Basket | D.E. [20] | 0.221 | 0.132 | 0.66 | 0.480 | 0.232 | 7.88 | | 0.085 | 0.039 | 0.90 | 0.218 | 0.110 | 3.61 |
| Drop. [11] | 0.241 | 0.153 | 0.43 | 0.297 | 0.157 | 10.96 | | 0.216 | 0.141 | 0.31 | 0.544 | 0.503 | 10.36 |
| NeRF-W [31] | 0.214 | 0.179 | 0.41 | - | - | - | Africa | 0.127 | 0.079 | 0.77 | - | - | - |
| S-NeRF [53] | 0.417 | 0.401 | 0.23 | 0.305 | 0.312 | 8.75 | | 0.239 | 0.155 | 0.36 | 0.234 | 0.252 | 6.55 |
| CF-NeRF | 0.166 | 0.099 | 0.80 | 0.101 | 0.052 | 6.76 | | 0.074 | 0.039 | 0.93 | 0.105 | 0.090 | 2.05 |
| Statue | D.E. [20] | 0.162 | 0.118 | 0.73 | 0.115 | 0.056 | 7.78 | | 0.132 | 0.071 | 0.71 | 0.226 | 0.131 | 5.76 |
| Drop. [11] | 0.197 | 0.128 | 0.59 | 0.164 | 0.109 | 10.89 | | 0.263 | 0.173 | 0.06 | 0.982 | 0.809 | 10.84 |
| NeRF-W [31] | 0.276 | 0.218 | 0.55 | - | - | - | Torch | 0.271 | 0.241 | 0.17 | - | - | - |
| S-NeRF [53] | 0.751 | 0.709 | 0.26 | 0.353 | 0.386 | 11.51 | | 0.274 | 0.236 | 0.14 | 0.770 | 1.013 | 8.75 |
| CF-NeRF | 0.122 | 0.098 | 0.73 | 0.069 | 0.053 | 7.38 | | 0.110 | 0.061 | 0.78 | 0.164 | 0.089 | 4.15 |
+
+paper and demonstrate that the expressivity of S-NeRF on these simple scenes is not severely limited by the imposed strong assumptions over the radiance field distribution. Nonetheless, our CF-NeRF still achieves a significant improvement over most of the metrics, showing the advantages of modelling the radiance field distribution using the proposed latent variable modelling and CNFs.
+
+# 5.2 Results over LF dataset
+
+To further test the performance of different approaches on larger scenes with more complex appearances and geometries, we evaluate the different methods on the LF dataset. All images in these scenes have a large depth range and are randomly captured towards the target. As a consequence, coordinates cannot be normalized with NDC.
+
+Quantitative results. Results over rendered RGB images and estimated depthmaps for all the scenes and evaluated metrics are shown in Table 2 and Table 3, respectively. As can be seen, S-NeRF obtains poor performance in terms of quality and uncertainty estimation. This clearly shows that the imposed assumptions over the radiance fields distribution are sub-optimal in complex scenes and lead to inaccurate model predictions and unreliable uncertainty estimations. In contrast, our CF-NeRF outperforms all the previous approaches by large margins
+
+
+Fig. 5. Qualitative comparison between our CF-NeRF and other baselines over generated images(Top) and depth-maps(Bottom). The model prediction, its computed error with the Ground-Truth and its associated uncertainty estimation are shown respectively in each row. Larger values are shown in yellow while purple and black indicate smaller values of predicted error and uncertainty. NeRF-W is not able to generate multiple depth samples and hence cannot produce uncertainty for depth-maps. Among all these approaches, our CF-NeRF is the only approach that is able to generate both accurately rendered views and depth estimations and visually intuitive uncertainty maps which are highly correlated with the true prediction error. Refer to the supplementary materials for more visualized results.
+
+across all the scenes and metrics both on image rendering and depth-maps estimation tasks. The better results obtained by our method can be explained because the use of latent variable modelling and conditional normalizing flows allows to learn arbitrarily complex radiance field distributions, which are necessary to model scenes with complicated appearance and geometry. This partly explains that our method achieves better performance, particularly an average $69\%$ improvement compared to the second best method Deep-Ensembles on LPIPS, which measures the perceptual similarity at the image level. On the other hand, the performance of Deep-Ensembles and MC-Dropout is largely limited by the number of the trained models or dropout samples, which cannot be increased infinitely in practical cases. In contrast, the explicitly encoding of the radiance field distribution into a single probabilistic model with CF-NeRF allows to use a higher-number of samples in a more efficient manner.
+
+Qualitative results. In order to give more insights into the advantages of our proposed CF-NeRF, Fig. 5 shows qualitative results obtained by the compared methods on an example testing view of the LF dataset. By looking at the estimated uncertainty for RGB images, we can observe that NeRF-W obtains a higher prediction error which, additionally, is not correlated with the uncertainty estimates. On the other hand, Deep Ensembles and MC-Dropout render images with a lower predictive error compared to NeRF-W. As can be observed, however, their estimated uncertainties are noticeably not correlated with their errors. Interestingly, S-NeRF seems to obtain uncertainty estimates where the values are more correlated with the predictive error. However, the quality of the rendered image is poor, obviously shown in the background. In contrast, our CF-NeRF is the only method able to render both high-quality images and uncertainty estimates that better correlate with the prediction error.
+
+By looking at the results for generated depth-maps, we can see that our method also obtains the most accurate depth estimates, followed by Deep Ensembles. Nonetheless, the latter generates depth maps with obvious errors in the background. Regarding the uncertainty estimation, we can observe a high correlation between the predicted error and the estimated uncertainty maps generated by our CF-NeRF. This contrasts with the rest methods which estimate low confidence values in the background of the scene inconsistent with their low prediction errors on this specific area. In conclusion, our results demonstrate the ability of our proposed method to provide both reliable uncertainty estimates and accurate model predictions.
+
+# 6 Conclusion
+
+We have presented CF-NeRF, a novel probabilistic model to address the problem of uncertainty quantification in 3D modelling using Neural Radiance Fields. In contrast to previous works employing models with limited expressivity, our method couples Latent Variable Modelling and Conditional Normalizing Flows in order to learn complex radiance fields distributions in a flexible and fully data-driven manner. In our experimental results, we show that this strategy allows CF-NeRF to obtain significantly better results than state-of-the-art approaches, particularly on scenes with complicated appearance and geometry. Finally, it is also worth mentioning that our proposed framework can be easily combined with other NeRF-based architectures in order to provide them with uncertainty quantification capabilities.
+
+# Acknowledgements
+
+This work is supported partly by the Chinese Scholarship Council (CSC) under grant (201906120031), by the Spanish government under project MoHuCo PID2020-120049RB-I00 and the Chistera project IPALM PCI2019-103386. We also thank Nvidia for hardware donation under the GPU grant program.
+
+# References
+
+1. Aralikatti, R., Margam, D., Sharma, T., Thanda, A., Venkatesan, S.: Global snr estimation of speech signals using entropy and uncertainty estimates from dropout networks. In: INTERSPEECH (2018)
+2. Ashukha, A., Lyzhov, A., Molchanov, D., Vetrov, D.P.: Pitfalls of in-domain uncertainty estimation and assembling in deep learning. In: ICLR (2020)
+3. Bae, G., Budvytis, I., Cipolla, R.: Estimating and exploiting the aleatoric uncertainty in surface normal estimation. In: ICCV (2021)
+4. van den Berg, R., Hasenclever, L., Tomczak, J., Welling, M.: Sylvester normalizing flows for variational inference. In: proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI) (2018)
+5. Bi, S., Xu, Z., Sunkavalli, K., Havsan, M., Hold-Geoffroy, Y., Kriegman, D.J., Ramamoorthi, R.: Deep reflectance volumes: Relightable reconstructions from multi-view photometric images. In: ECCV (2020)
+6. Blundell, C., Cornebise, J., Kavukcuoglu, K., Wierstra, D.: Weight uncertainty in neural networks. In: ICML (2015)
+7. Brachmann, E., Michel, F., Krull, A., Yang, M.Y., Gumhold, S., Rother, C.: Uncertainty-driven 6d pose estimation of objects and scenes from a single rgb image. In: CVPR (2016)
+8. Djuric, N., Radosavljevic, V., Cui, H., Nguyen, T., Chou, F.C., Lin, T.H., Singh, N., Schneider, J.G.: Uncertainty-aware short-term motion prediction of traffic actors for autonomous driving. In: WACV (2020)
+9. Eigen, D., Puhrsch, C., Fergus, R.: Depth map prediction from a single image using a multi-scale deep network. In: NIPS (2014)
+0. Gafni, G., Thies, J., Zollhöfer, M., Nießner, M.: Dynamic neural radiance fields for monocular 4D facial avatar reconstruction. In: CVPR (2021)
+1. Gal, Y., Ghahramani, Z.: Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In: ICML (2016)
+2. Geifman, Y., Uziel, G., El-Yaniv, R.: Bias-reduced uncertainty estimation for deep neural classifiers. In: ICLR (2019)
+3. Hendrycks, D., Mazeika, M., Kadavath, S., Song, D.X.: Using self-supervised learning can improve model robustness and uncertainty. In: NeurIPS (2019)
+4. Hernández, S., Vergara, D., Valdenegro-Toro, M., Jorquera, F.: Improving predictive uncertainty estimation using dropout-hamiltonian monte carlo. Soft Computing 24, 4307-4322 (2020)
+5. Jiakai, Z., Xinhang, L., Xinyi, Y., Fuqiang, Z., Yanshun, Z., Minye, W., Yingliang, Z., Lan, X., Jingyi, Y.: Editable free-viewpoint video using a layered neural representation. In: ACM SIGGRAPH (2021)
+6. Kajiya, J., von herzen, B.: Ray tracing volume densities. ACM SIGGRAPH Computer Graphics 18, 165-174 (1984)
+7. Kirsch, W.: An elementary proof of de Finetti's theorem. Statistics & Probability Letters 151(C), 84-88 (2019)
+8. Klokov, R., Boyer, E., Verbeek, J.J.: Discrete point flow networks for efficient point cloud generation. In: ECCV (2020)
+9. Kosiorek, A.R., Strathmann, H., Zoran, D., Moreno, P., Schneider, R., Mokr'a, S., Rezende, D.J.: Nerf-vae: A geometry aware 3d scene generative model. In: ICML (2021)
+20. Lakshminarayanan, B., Pritzel, A., Blundell, C.: Simple and scalable predictive uncertainty estimation using deep ensembles. In: NIPS (2017)
+
+21. Lakshminarayanan, B., Pritzel, A., Blundell, C.: Simple and scalable predictive uncertainty estimation using deep ensembles. In: Adv. Neural Inform. Process. Syst. (2017)
+22. Li, Y., Li, S., Sitzmann, V., Agrawal, P., Torralba, A.: 3d neural scene representations for visuomotor control. In: CoRL (2021)
+23. Li, Z., Niklaus, S., Snavely, N., Wang, O.: Neural scene flow fields for space-time view synthesis of dynamic scenes. In: CVPR (2021)
+24. Liu, J., Paisley, J.W., Kioumourtzoglou, M.A., Coull, B.: Accurate uncertainty estimation and decomposition in ensemble learning. In: NeurIPS (2019)
+25. Liu, L., Gu, J., Lin, K.Z., Chua, T.S., Theobalt, C.: Neural sparse voxel fields. In: NeurIPS (2020)
+26. Liu, S., Zhang, X., Zhang, Z., Zhang, R., Zhu, J.Y., Russell, B.: Editing conditional radiance fields. In: ICCV (2021)
+27. Lombardi, S., Simon, T., Saragih, J., Schwartz, G., Lehrmann, A., Sheikh, Y.: Neural volumes: Learning dynamic renderable volumes from images. ACM Trans. Graph. 38(4), 65:1-65:14 (Jul 2019)
+28. Long, K., Qian, C., Cortes, J., Atanasov, N.: Learning barrier functions with memory for robust safe navigation. IEEE Robotics and Automation Letters 6(3), 1-1 (2021)
+29. Loquercio, A., Segu, M., Scaramuzza, D.: A general framework for uncertainty estimation in deep learning. IEEE Robotics and Automation Letters 5(2), 3153-3160 (Apr 2020)
+30. Malinin, A., Gales, M.J.F.: Predictive uncertainty estimation via prior networks. In: NeurIPS (2018)
+31. Martin-Brualla, R., Radwan, N., Sajjadi, M.S.M., Barron, J.T., Dosovitskiy, A., Duckworth, D.: NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections. In: CVPR (2021)
+32. Mescheder, L., Oechsle, M., Niemeyer, M., Nowozin, S., Geiger, A.: Occupancy Networks: Learning 3d reconstruction in function space. In: CVPR (2019)
+33. Mildenhall, B., Srinivasan, P.P., Tancik, M., Barron, J.T., Ramamoorthi, R., Ng, R.: Nerf: Representing scenes as neural radiance fields for view synthesis. In: ECCV (2020)
+34. Neal, R.M.: Bayesian Learning for Neural Networks. Springer New York, NY (1995)
+35. Neapolitan, R.E.: Learning bayesian networks. In: Proceedings of the 13th ACM SIGKDD international conference on Knowledge discovery and data mining(KDD) (2007)
+36. Neff, T., Stadlbauer, P., Parger, M., Kurz, A., Mueller, J.H., Chaitanya, C.R.A., Kaplanyan, A., Steinberger, M.: Donerf: Towards real-time rendering of compact neural radiance fields using depth oracle networks. Computer Graphics Forum 40(4), 45-59 (2021)
+37. Niemeyer, M., Barron, J.T., Mildenhall, B., Sajjadi, M.S.M., Geiger, A., Radwan, N.: Regnerf: Regularizing neural radiance fields for view synthesis from sparse inputs. ArXiv abs/2112.00724 (2021)
+38. Niemeyer, M., Mescheder, L., Oechsle, M., Geiger, A.: Occupancy flow: 4d reconstruction by learning particle dynamics. In: ICCV (2019)
+39. Park, J.J., Florence, P., Straub, J., Newcombe, R.A., Lovegrove, S.: DeepSDF: Learning continuous signed distance functions for shape representation. In: CVPR (2019)
+40. Park, K., Sinha, U., Barron, J.T., Bouaziz, S., Goldman, D.B., Seitz, S.M., Martin-Brualla, R.: Nerfies: Deformable neural radiance fields. ICCV (2021)
+
+41. Peng, L.W., Shamsuddin, S.M.: 3d object reconstruction and representation using neural networks. In: Proceedings of the 2nd International Conference on Computer Graphics and Interactive Techniques in Australasia and South East Asia (2004)
+42. Peng, S., Dong, J., Wang, Q., Zhang, S.W., Shuai, Q., Bao, H., Zhou, X.: Animatable neural radiance fields for human body modeling. In: CVPR (2021)
+43. Poggi, M., Aleotti, F., Tosi, F., Mattoccia, S.: On the uncertainty of self-supervised monocular depth estimation. In: CVPR (2020)
+44. Pumarola, A., Corona, E., Pons-Moll, G., Moreno-Noguer, F.: D-NeRF: Neural radiance fields for dynamic scenes. In: CVPR (2021)
+45. Pumarola, A., Popov, S., Moreno-Noguer, F., Ferrari, V.: C-flow: Conditional generative flow models for images and 3d point clouds. In: CVPR (2020)
+46. Qu, C., Liu, W., Taylor, C.J.: Bayesian deep basis fitting for depth completion with uncertainty. In: ICCV (2021)
+47. Raj, A., Zollhoefer, M., Simon, T., Saragih, J., Saito, S., Hays, J., Lombardi, S.: PVA: Pixel-aligned volumetric avatars. In: CVPR (2021)
+48. Rebain, D., Jiang, W., Yazdani, S., Li, K., Yi, K.M., Tagliasacchi, A.: Derf: Decomposed radiance fields. In: CVPR (2020)
+49. Ritter, H., Botev, A., Barber, D.: A scalable laplace approximation for neural networks. In: ICLR (2018)
+50. Saito, S., Yang, J., Ma, Q., Black, M.J.: SCANimate: Weakly supervised learning of skinned clothed avatar networks. In: CVPR (2021)
+51. Schwarz, K., Liao, Y., Niemeyer, M., Geiger, A.: Graf: Generative radiance fields for 3d-aware image synthesis. In: NIPS (2020)
+52. Shamsi, A., Asgharnezhad, H., Jokandan, S.S., Khosravi, A., Kebria, P.M., Nahavandi, D., Nahavandi, S., Srinivasan, D.: An uncertainty-aware transfer learning-based framework for Covid-19 diagnosis. IEEE Transactions on Neural Networks and Learning Systems 32, 1408-1417 (2021)
+53. Shen, J., Ruiz, A., Agudo, A., Moreno-Noguer, F.: Stochastic neural radiance fields: Quantifying uncertainty in implicit 3d representations. In: 3DV (2021)
+54. Sitzmann, V., Martel, J.N.P., Bergman, A.W., Lindell, D.B., Wetzstein, G.: Implicit neural representations with periodic activation functions. In: NIPS (2020)
+55. Sitzmann, V., Zollhöfer, M., Wetzstein, G.: Scene representation networks: Continuous 3d-structure-aware neural scene representations. In: NIPS (2019)
+56. Su, S.Y., Yu, F., Zollhöfer, M., Rhodin, H.: A-nerf: Articulated neural radiance fields for learning human shape, appearance, and pose. In: NIPS (2021)
+57. Tancik, M., Mildenhall, B., Wang, T., Schmidt, D., Srinivasan, P.P., Barron, J.T., Ng, R.: Learned initializations for optimizing coordinate-based neural representations. In: CVPR (2021)
+58. Tancik, M., Srinivasan, P.P., Mildenhall, B., Fridovich-Keil, S., Raghavan, N., Singhal, U., Ramamoorthi, R., Barron, J.T., Ng, R.: Fourier features let networks learn high frequency functions in low dimensional domains. In: NIPS (2020)
+59. Teye, M., Azizpour, H., Smith, K.: Bayesian uncertainty estimation for batch normalized deep networks. In: ICML (2018)
+60. Wang, Z., Simoncelli, E., Bovik, A.: Multiscale structural similarity for image quality assessment. In: The Thrity-Seventh Asilomar Conference on Signals, Systems Computers, 2003. vol. 2, pp. 1398-1402 Vol.2 (2003)
+61. Wei, Y., Liu, S., Rao, Y., Zhao, W., Lu, J., Zhou, J.: Nerfingmvs: Guided optimization of neural radiance fields for indoor multi-view stereo. In: ICCV (2021)
+62. Xie, Y., Takikawa, T., Saito, S., Litany, O., Yan, S., Khan, N., Tombari, F., Tompkin, J., Sitzmann, V., Sridhar, S.: Neural fields in visual computing and beyond (2021)
+
+63. Xu, H., Zhou, Z., Wang, Y., Kang, W., Sun, B., Li, H., Qiao, Y.: Digging into uncertainty in self-supervised multi-view stereo. In: ICCV (2021)
+64. Yang, G., Huang, X., Hao, Z., Liu, M.Y., Belongie, S.J., Hariharan, B.: Pointflow: 3d point cloud generation with continuous normalizing flows. In: ICCV (2019)
+65. Yen-Chen, L., Florence, P., Barron, J.T., Rodriguez, A., Isola, P., Lin, T.Y.: iNeRF: Inverting neural radiance fields for pose estimation. In: IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (2021)
+66. Yu, A., Ye, V., Tancik, M., Kanazawa, A.: pixelnerf: Neural radiance fields from one or few images. In: CVPR (2021)
+67. Yücer, K., Sorkine-Hornung, A., Wang, O., Sorkine-Hornung, O.: Efficient 3d object segmentation from densely sampled light fields with applications to 3d reconstruction. ACM Trans. Graph. 35(3) (2016)
+68. Zhang, K., Riegler, G., Snavely, N., Koltun, V.: Nerf++: Analyzing and improving neural radiance fields. ArXiv abs/2010.07492 (2020)
+69. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR (2018)
+70. Zhu, L., Mousavian, A., Xiang, Y., Mazhar, H., van Eenbergen, J., Debnath, S., Fox, D.: Rgb-d local implicit function for depth completion of transparent objects. In: CVPR (2021)
\ No newline at end of file
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/images.zip b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..439b4abf165cd89a00385f63e8f9dff26675d39b
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c09fdf8a5fcc842a2db56bfe4135757c839dff6ad7298be872c825d1b1ae2d1c
+size 546776
diff --git a/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/layout.json b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c5a0bc9c8fbc286f87255bc77274b369a1e4da23
--- /dev/null
+++ b/conditionalflownerfaccurate3dmodellingwithreliableuncertaintyquantification/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a31b54aa2991cf4a32e7292de64752bdf5df15807500b808da7bb7c14cefa09
+size 476534
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_content_list.json b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..171d260802ab78a0f1a0b726a691227bd19cba3c
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f61c486c63fde6f7f4f56597700dcf3b21cfaadcac6ff17cdc2e65d2c8afb52c
+size 78892
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_model.json b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..55ff7ddb8c7bcf68997230a6a03c8992087825e9
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:897eac859790efae8430e6bea912b5bb431dd551bdea4c5af794c1e6256d7b5b
+size 96659
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_origin.pdf b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..bf506141abbdbd2114431b0442926f56a756b844
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/8c2c337d-79b1-4f7a-91a9-6a96e46eb39e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2c38bd3920956c4e2678b4082b7c04c9de37c78bace32d0d28b639e6e5208d1
+size 3895237
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/full.md b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..601f5179c5964081932e05d436cec8bec7933c68
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/full.md
@@ -0,0 +1,276 @@
+# Conditional Stroke Recovery for Fine-Grained Sketch-Based Image Retrieval
+
+Zhixin Ling, Zhen Xing, Jian Zhou, and Xiangdong Zhou
+
+Fudan University, Shanghai, China {20212010005,zxing20,19212010009,xdzhou}@fudan.edu.cn
+
+Abstract. The key to Fine-Grained Sketch Based Image Retrieval (FG-SBIR) is to establish fine-grained correspondence between sketches and images. Since sketches only consist of abstract strokes, stroke recognition ability plays an important role in FG-SBIR. However, existing works usually ignore the unique feature of sketches and treat images and sketches equally. Targeting at this problem, we propose Conditional Stroke Recovery (CSR) to enhance stroke recognition ability for FG-SBIR, in which we introduce an auxiliary task that requires the network recover the strokes using the paired image as condition. In this way, the network learns better to match the strokes with corresponding image elements. To complete the auxiliary task, we propose an unsupervised stroke disorder algorithm, which does well in stroke extraction and sketch augmentation. In addition, we figure out two weaknesses of the common triplet loss and propose double-anchor InfoNCE loss to reduce cosine distances between sketch-image pairs. Comprehensive experiments using various backbones are conducted on four datasets (i.e., QMUL-Shoe, QMUL-Chair, QMUL-ShoeV2, and Sketchy). In terms of acc@1, our method outperforms previous works by a great margin.
+
+Keywords: Fine-Grained, SBIR, FG-SBIR, double-anchor InfoNCE
+
+# 1 Introduction
+
+Compared with text description, sketches interpret the information need of users more accurately in some real applications like product retrieval. As a result, the research of Sketch-Based Image Retrieval (SBIR) has received increasing attention recently. According to the retrieval granularity, SBIR can be categorized into Coarse-Grained category-level SBIR (CG-SBIR) [18,4,1] and Fine-Grained instance-level SBIR (FG-SBIR) [3,38,22,44,17]. CG-SBIR retrieves an image in the gallery based on the category of query sketch while FG-SBIR retrieves a specific image that shares the same pose and outline. FG-SBIR has a wide range of applications in many fields such as searching online images or products. The key to FG-SBIR is to establish fine-grained correspondence between sketches
+
+
+Fig.1. 1) The top part shows an auxiliary recovery task conditioned by the paired image $p_{+}$ . The task recovers a sketch $s$ from a disordered one $s'$ . The recovery process learns to match each stroke with its corresponding image element and place the stroke back to the right position. 2) The bottom part compares triplet loss with our double-anchor InfoNCE loss. The former usually optimizes the L2 distance and samples negative images $p_{-}$ inefficiently. The latter optimizes cosine similarity and take $s'$ as an augmented auxiliary anchor, therefore enhancing robustness of our model.
+
+and images. Considering that sketches only consists of strokes, to establish the fine-grained correspondence is mainly to match each sketch stroke with the corresponding image element (e.g., a minute hand of a clock matched with an arrowed line in an sketch). We refer to the ability to recognize the arrowed line as stroke recognition. However, the unique stroke characteristic is not well stressed in previous works [29,31,16].
+
+Several previous works notice the problem. SaN [41,42] feeds strokes of different drawing stages into the network to enhance stroke recognition ability. Whereas, stroke annotations could be unavailable in real-world applications, limiting application scenarios of SaN. A jigsaw pretraining strategy [23] was proposed to boost the ability of the network to capture fine-grained correspondence. However, the jigsaw game requires that the backgrounds of input images should be clean. A generative model [39] reconstructs sketch feature based on the paired image feature. In this way, the network interprets different image elements into sketch stroke precisely. However, uncertainties in manually created sketch make the method only available for coarse-grained SBIR.
+
+To eliminate the uncertainties, we propose Conditional Stroke Recovery (CSR) We introduce an auxiliary task that recovers sketches. At first, we randomly move the strokes elsewhere within the sketch to obtain a corresponding disordered sketch. After that, conditioned on the image feature, we recover the original sketch from the feature of the disordered sketch. Intuitively, based on observation on the image, the network learns to decide which strokes are misplaced in the disordered sketch and place the misplaced strokes back. To decide the misplaced strokes is necessary for stroke recovery, so we take this intermediate recovery step as misplaced stroke distinguishing (MSD) for simplicity. In this way, the network learns to decide the right image element and match it with the corre
+
+sponding sketch stroke, therefore enhancing stroke recognition ability. Besides, the disordering process is completed by our proposed unsupervised stroke disorder algorithm. Compared with previous works, CSR locates stroke recognition ability of the network to establish fine-grained correspondence between paired images and sketches. CSR does not require side information (e.g., other pretraining datasets, stroke annotations and text descriptions), making it available in all kinds of scenarios. In addition, the existing works on FG-SBIR[33,29,31,16] reduce the sketch-image domain gap mainly by triplet loss. However, triplet sampling might be inefficient and triplet loss might not support cosine distance retrieval well. Therefore, by accustoming InfoNCE loss[5] specially for FG-SBIR, we propose double-anchor InfoNCE loss to overcome the weaknesses of triplet loss. Comprehensive experiments on four benchmark datasets [29,41] verify the effectiveness of CSR. Our main contributions are summarized as follows,
+
+- We propose a novel method, Conditional Stroke Recovery (CSR), to learn stroke recognition ability.
+- We introduce a double-anchor InfoNCE loss specially for FG-SBIR.
+- We introduce a stroke disorder algorithm that can be applied to sketch augmentation without sequential information of pixels.
+- Comprehensive results on four popular benchmark datasets demonstrate the advantage of our proposed CSR method over state-of-the-art methods.
+
+# 2 Related Works
+
+Coarse-grained SBIR. Coarse-grained SBIR (CG-SBIR) is firstly proposed by [14]. CG-SBIR aims to learn a feature space that reduces the gap between sketch domain and image domain. Early CG-SBIR works usually extract edges maps from images and then design hand-crafted features to match the query sketches with images [8,12,11,28]. In recent years, deep-learning based methods using variants of siamese losses [33] and ranking losses [43] are proposed for the CG-SBIR. Bui et. al. [4] applies a siamese loss and a triplet loss in different training stages to learn detailed features. A graph-based searching method[1] is proposed to re-rank the retrieved images.
+
+Fine-grained SBIR. Fine-grained SBIR (FG-SBIR) is firstly defined as retrieving the images with the same attributes (e.g., viewpoint and body configuration) as the query sketch [15]. Qian et. al. [41] further extend the definition, requiring the retrieved image instance to be right corresponding to the query sketch. Since attribute annotations are usually unavailable in real-world applications, we follow the latter definition[41] like most of existing FG-SBIR works [37,26,16,3,22]. Apart from the huge domain gap in CG-SBIR, FG-SBIR also needs to capture fine-grained correspondence between images and sketches, making the task much more challenging. Li et. al. [15] adopt DPM [9] to learn different parts of objects and perform graph matching between sketches and images. Other existing FG-SBIR works [33,29,31,16] are mostly based on a contrastive loss that captures fine-grained correspondence. Among these works, DSSA[33] proposes an attention mechanism to locate the most discriminative regions. GN Triplet [29] applies
+
+a classification loss to distinguish objects from different categories. Quadruplet [31] extends triplet loss to quadruplet loss. Radenovi et. al. [26] converts images to edge maps for shape matching. A reinforcement learning method [3] is proposed to support on-the-fly retrieval. TC-Net [16] further introduces various classification losses. Although SaN Triplet [42,41] improve stroke recognition ability by incorporating strokes of different drawing phases into different input channels, but it requires expensive stroke annotations. Besides, converting images to edge maps[42,41,23] for pre-training helps little for FG-SBIR[16] since edge maps can remove helpful information (e.g., color and texture).
+
+Sketch Reconstruction From Images. Bhunia et. al. [2] propose an image-to-sketch translation method. But it requires coordinate sequences and is only used for generation of more training sketch-image pairs. Pang et. al. [23] design a jigsaw game where edge maps are divided into grids and mixed into real image to form jigsaw tiles. However, simply dividing edge maps into grids might do great harm to semantic completeness of strokes. Yelamarthi et. al.[39] employ CVAE and CAAE to reconstruct sketch features from features of paired images. Since one image can correspond to more than one sketches, the generation process is not unique for the same image and therefore these generative frameworks do not work in FG-SBIR.
+
+InfoNCE loss. Information Noise Contrastive Estimation loss (InfoNCE loss) is first proposed for Contrastive Predictive Coding [21], which learns robust representations by predicting the future in latent space. In SimCLR[5] and SimCLRv2[6], InfoNCE loss aims to minimize the distance between paired augmented images. Chen et. al. [5] verify the advantage of InfoNCE loss over triplet loss on self-supervised image classification tasks. In this paper, based on InfoNCE loss, we introduce a double-anchor InfoNCE loss and prove its effectiveness on FG-SBIR as well.
+
+# 3 Our Method
+
+# 3.1 Overview
+
+A fine-grained sketch-image dataset basically consists of paired sketch-image pairs. We denote a sketch by $s$ and an image by $p$ . For a given $s$ , we represent the paired image by $p_{+}$ , an unpaired one by $p_{-}$ , and a disordered sketch by $s'$ . Our proposed CSR mainly consists of two networks: a feature extraction network $E^{f}$ and a stroke recovery network $E^{r}$ , as illustrated in Fig. 2. $E^{f}$ fuses multi-level features for retrieval. We give up the common triplet loss and propose double-anchor InfoNCE loss which supports cosine distance retrieval and samples negative images more efficiently. To learn stroke recognition ability, we design a recovery task by $E^{r}$ . Given retrieval features of a disordered sketch and its paired image, $E^{r}$ recovers the original sketch using a recovery loss.
+
+# 3.2 Stroke Disorder Algorithm
+
+
+Fig. 2. Overview of CSR-GoogLeNet (refer to Supplementary $^2$ . for details). CSR consists of $E^{f}$ and $E^{R}$ . All of images, sketches and disordered sketches share the same $E^{f}$ . In $E^{r}$ , intermediate feature maps are converted to $m$ -dimensional feature vectors and then concatenated to the final 1024-dim output vector as a retrieval feature. An double-anchor InfoNCE loss $\mathcal{L}_{da}$ is applied on the retrieval feature. The retrieval features of a sketch $s$ and its paired image $p_{+}$ are concatenated and sent into $E^{R}$ . A recovery loss $\mathcal{L}_{rec}$ is applied on a 4-channel recovered extended map $\mathbf{e}$ .
+
+A disordered sketch $s'$ is created by stroke disorder algorithm 1 in an unsupervised way. Algorithm 1 consists of two parts: stroke extraction (SE, Ln1-8) and stroke disorder (SD, Ln9-15). The whole algorithm runs as the following steps: 1) Ln1 initializes the strokes as unconnected pixels; 2) Ln3 obtains the longest stroke; 3) Ln4 find a chokepoint where several strokes might join; 4) Ln5-8 cut the stroke into $n_m$ parts with a direct line. We want the line to be perpendicular to the variance of neighborhood pixels to avoid the line coinciding with the stroke. 5) Ln9-15 disorders the selected strokes. The pixels removed in Ln6 into any stroke are stroke end points. We do not reassign them to any other strokes to prevent the network from taking a shortcut for stroke recovery[20]. The algorithm results are visualized in Fig. 3. $p_d$ is a hyper-parameter and a larger $p_d$ makes $s'$ messier. Instead of simply dividing strokes into grids[23], the algorithm tries to preserve stroke completeness and independence. The SD process can be used as a sketch augmentation technique. The obtained sketch strokes can also be used for other augmentation approaches, (e.g., stroke removal and stroke deformation in SaN[41,30]). Supplementary also presents more details.
+
+# 3.3 Feature Extraction
+
+All of $s$ , $p_{+}$ , $p_{-}$ and $s'$ shares the same feature extraction procedure. We take $s$ for example. Original output of $E^{f}$ is a 1024-dimensional vector, mainly con
+
+Algorithm 1: Stroke disorder algorithm.
+Input: A $w\times h$ binary matrix $s$ , where 0/1 is stroke/background color; A disorder probability $p_d$ . The target strokes $n_{s}$ , an integer. Output: Strokes of the disordered sketch.
+1 Group 0-valued pixels in $s$ into $n$ sets, say $\mathcal{P}_1,\mathcal{P}_2,\dots ,\mathcal{P}_n$ , where only pixels in the same set are connected, $\mathcal{S}\gets \{\mathcal{P}_1,\mathcal{P}_2,\dots ,\mathcal{P}_n\} ; / /\mathcal{P}_i$ forms a stroke
+2 while $n < n_s$ do // Stroke extraction
+3 $\mathcal{P}_m\gets \arg \max_{\mathcal{P}_i\in S}|\mathcal{P}_i|$ .
+4 $c_{m}\gets \operatorname {argmax}_{c_{i}\in \mathcal{P}_{m}}|Adj(c_{i})\cap \mathcal{P}_{m}|;$ //Adj yields neighborhood pixels.
+5 $\mathbf{v}\leftarrow var(Adj(c_m)),\mathcal{P}_l\gets Ln(c_m,\frac{\mathbf{v}}{|\mathbf{v}|}); / / var$ is the direction that maximizes neighbor variance. Ln(point, normal) is a parameterized line
+6 $\mathcal{P}_m\gets \mathcal{P}_m - \mathcal{P}_l$ ; // Remove intersection pixels
+7 Group pixels in $\mathcal{P}_m$ as Line-1 and obtain $n_m$ sets, say $\mathcal{P}_1,\mathcal{P}_2,\dots ,\mathcal{P}_{n_m};$
+8 $S\gets S\cup \{\mathcal{P}_1,\mathcal{P}_2,\dots ,\mathcal{P}_{n_m}\} -\{\mathcal{P}_m\} ,n\gets n - 1 + n_m$ .
+9 end
+10 Randomly select a subset $S^{\prime}\subset S$ , where $|\mathcal{S}^{\prime}| = \lceil n\times p_d\rceil$
+11 for $\mathcal{P}\in S^{\prime}$ do // Stroke Disorder
+12 $x_{t}\sim N(0,(w\times p_{d})^{2}),y_{t}\sim N(0,(h\times p_{d})^{2}),r\sim N(0,\pi^{2}\times p_{d}^{4});$
+13 Clip $x_{t},y_{t},r$ to constrain processed pixel coordinates in a valid value scope;
+14 Rotate $\mathcal{P}$ by $r$ and translate $\mathcal{P}$ by $(x_{t},y_{t})$ ..
+15 end
+16 return S
+
+taining high-level information (e.g., semantic information). We fuse multi-level features to enrich the output with low-level information (e.g., contours, texture and color). We refer to this step as Multi-level Feature Fusion. Specifically, CNNs are utilized to encode intermediate feature maps into $m$ -dimensional vectors. They are fused to be a vector of $1024 + 3m$ dimensions, $\mathbf{f}_s$ , which is taken as the final output of $E^f$ . The procedure is formulated as $\mathbf{f}_s = E^f(\mathbf{x}_s)$ . $\mathbf{f}_s$ is used for retrieval, so the distances between $\mathbf{f}_s$ and $\mathbf{f}_{p_+}$ should be reduced.
+
+A common approach: triplet loss. A common approach is to employ a triplet loss $\mathcal{L}_{trp}$ on the retrieval feature:
+
+$$
+\mathcal {L} _ {t r p} = \max \left(d \left(\mathbf {f} _ {s}, \mathbf {f} _ {p _ {-}}\right) - d \left(\mathbf {f} _ {s}, \mathbf {f} _ {p _ {+}}\right) + r, 0\right), \tag {1}
+$$
+
+where $d$ is a distance metric and $r$ is triplet margin. Empirically, $\mathcal{L}_{trp}$ should satisfy two rules: 1) the triplet anchor should be a sketch for sketch is the query. 2) negative samples of $\mathcal{L}_{trp}$ should all be images. These two rules are adopted by most previous works[16,29,41,31,23]. Despite broad application of $\mathcal{L}_{trp}$ , there exists two problems: 1) Naive triplet sampling is inefficient: a batch of $b\times 3$ samples contains only $b$ triplets. 2) $\mathcal{L}_{trp}$ usually targets at L2 distance[16,31,33,23] while cosine distance might produce better retrieval performance.
+
+Most of existing works[16,29,41,31,23,26] adopt L2 distance as $d$ for $\mathcal{L}_{trp}$ . Cosine distance disagrees with $d$ because (1) cosine distance in $\mathcal{L}_{trp}$ leads to insignificant gradients; (2) cosine distance has a certain value scope and thus makes $\mathcal{L}_{trp}$ very sensitive to $r$ . However, cosine distance performs better in re
+
+trieval since it avoids variations introduced by the vector norm [19]. Consequently, the inconsistency between training distance and retrieval distance might cause a performance bottleneck.
+
+Our solution: double-anchor InfoNCE. Inspired by InfoNCE loss[5], we propose a loss that overcomes weaknesses of $\mathcal{L}_{trp}$ while following the above rules:
+
+$$
+\mathcal {L} _ {s a} = - \log \frac {e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p +}\right)}}{e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p +}\right)} + \sum_ {p -} e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p -}\right)}}, \tag {2}
+$$
+
+where $sim$ yields amplified cosine similarity: $sim(x,y) = \frac{cos(x,y)}{\tau}$ . $\tau$ controls temperature. Different from the original InfoNCE loss that targets at similarity of single-domain features, $\mathcal{L}_{sa}$ refers to the success of triplet loss and is designed to optimize cross-modality distances.
+
+To further improve robustness of our model, the distance between $s'$ and $p_+$ should be taken into consideration. Although $s'$ is not strictly aligned with $p_+$ , $s'$ is more similar to $p_+$ than to $p_-$ . At the same time, $s$ should always be the closest to $p_+$ . We therefore propose a double-anchor InfoNCE loss:
+
+$$
+\mathcal {L} _ {d a} = - \log \frac {e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p _ {+}}\right)} + \alpha e ^ {s i m \left(\mathbf {f} _ {s ^ {\prime}} , \mathbf {f} _ {p _ {+}}\right)}}{e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p _ {+}}\right)} + \alpha e ^ {s i m \left(\mathbf {f} _ {s ^ {\prime}} , \mathbf {f} _ {p _ {+}}\right)} + \sum_ {p _ {-}} \left(e ^ {s i m \left(\mathbf {f} _ {s} , \mathbf {f} _ {p _ {-}}\right)} + \alpha e ^ {s i m \left(\mathbf {f} _ {s ^ {\prime}} , \mathbf {f} _ {p _ {-}}\right)}\right)}, \tag {3}
+$$
+
+where $0 \leq \alpha < 1$ . In $\mathcal{L}_{da}$ , $s'$ is an auxiliary anchor and regarded as an augmented sketch from $s$ . A larger $\alpha$ encourages $\mathbf{f}_{p_+}$ to move towards $\mathbf{f}_{s'}$ . To collect a $b$ -sized training batch, we fill it with $b$ triplets of $(s, s', p_+)$ . For a specific $s$ or $s'$ , other $b-1$ images in the same batch are regarded as as $p_-$ . Although $\mathcal{L}_{trp}$ can also adopt a similar efficient triplet collection (ETC) approach, where $b \times (b-1)$ triplets can be collected in a batch, $\mathcal{L}_{da}$ is still superior to $\mathcal{L}_{trp}$ since it directly optimizes cosine distances. Supplementary also analyzes an alternative of $\mathcal{L}_{da}$ .
+
+
+Fig. 3. Visualization of the stroke disorder algorithm 1. The leftmost two subfigures are an image and visualization of different groups of its paired sketch. The 5 columns on the right are: (1) the original sketch $s$ ; (2) disorder strokes, i.e., $\mathcal{P} \in S'$ after rotation and translation; (3) fixed strokes, i.e., the unselected strokes $\mathcal{P} \in S - S'$ ; (4) selected strokes, i.e., $\mathcal{P} \in S'$ before rotation and translation; (5) the disorder sketch $s'$ . We use column (1)-(4) to compose a 4-channel extended recovery map $\mathbf{e}$ .
+
+# 3.4 Stroke Recovery
+
+The stroke recovery network $E^{r}$ takes the input of $\mathbf{f}_{s^{\prime}}$ and $\mathbf{f}_{p_{+}}$ . The aim of $E^{r}$ is to recover the paired sketch from its disordered style. To stabilize the training of $E^{r}$ , we add another three maps to compose a 4-channel extended recovery map $\mathbf{e}$ as the recovery target, as illustrated in Fig. 3. Intuitively, the network first learns to distinguish misplaced and well-placed strokes (channel 2 and channel 3). After that, misplaced strokes are moved to their right places (channel 4) and then the sketch is recovered (channel 1).
+
+CSR does not intend to recover high-resolution sketch, so we downsample $\mathbf{e}$ to $56\times 56$ . It simplifies $E^r$ and prevent the risk that $\mathbf{f}_{s'}$ contains over-detailed pixel-level information. We compensate $\mathbf{f}_{s'}$ and $\mathbf{f}_{p_+}$ by two low-level feature maps of $s$ from $E^{f}$ [27], denoted by $\mathbf{F}_{s'}^{1}$ and $\mathbf{F}_{s'}^{2}$ . We refer to the trick as recovery compensation. The whole recovery process is formulated as: $\hat{\mathbf{e}} = E^{r}(\mathbf{f}_{s'},\mathbf{f}_{p_{+}},\mathbf{F}_{s'}^{1},\mathbf{F}_{s'}^{2})$ . Then we derive a recovery loss on the output $\hat{\mathbf{e}}$ : $\mathcal{L}_{rec} = CE(\hat{\mathbf{e}},\mathbf{e})$ , where $CE$ is the cross entropy loss. Although additional losses (e.g., adversarial losses) might improve the quality of the recovered sketch, these losses turn out to be helpless for FG-SBIR when complicating our proposed framework.
+
+# 3.5 Optimization
+
+After obtaining $\mathcal{L}_{da}$ and $\mathcal{L}_{rec}$ , we derive the total loss:
+
+$$
+\mathcal {L} _ {\text {t o t a l}} = w \times \mathcal {L} _ {d a} + \mathcal {L} _ {\text {r e c}}, \tag {4}
+$$
+
+where $w$ is the weight to balance $\mathcal{L}_{da}$ and $\mathcal{L}_{rec}$ . All of $s, p_+$ , $p_-$ and $s'$ share the same $E^f$ . The parameters of both of $E^f$ and $E^r$ are optimized simultaneously.
+
+# 4 Experiments
+
+# 4.1 Experimental Setup
+
+We briefly introduce the experimental setup in this section. Details can be seen in Supplementary. We report main results on GoogLeNet [34], InceptionV3 [35], DenseNet169 [13] and ResNet18 [10], which are adopted by the FG-SBIR works in the last three years [16,2,3,23,38,7]. We conduct all other experiments based on GoogLeNet. Empirically, we set $m = 64$ , $b = 96$ , $w = 10.0$ , $\tau = 0.005$ , $n_s = 10$ . $p_d$ starts at 0.1 and linearly grows to 0.3. We dynamically set $\alpha = 1 - \alpha_p p_d$ , $\alpha_p = 2$ . We evaluate CSR on four fine-grained sketch-image datasets: Sketchy [29], QMUL-Shoe [41], QMUL-Chair [41], and QMUL-ShoeV2 [41]. Following Qian et. al. [41], we report top-1 accuracy (acc@1) and top-10 accuracy (acc@10).
+
+# 4.2 Comparison With Existing Works
+
+We compare CSR with 12 baseline methods and report results in Table. 1.
+
+Table 1. Comparison of CSR and baselines on Sketchy, QMUL-Chair, QMUL-Shoe and QMUL-ShoeV2. Column "Side" shows side information used by existing works. "E" and "D" are short for extra annotations (e.g., text descriptions and attributes) and other datasets [40,25,36,23,24]. Results are grouped by backbone. The best within each group are denoted in boldface and the best across different groups are underlined.
+
+| Method | Backbone | Side | Sketchy(%) | QMUL-Chair(%) | QMUL-Shoe(%) | QMUL-ShoeV2(%) |
| acc@1 | acc@10 | acc@1 | acc@10 | acc@1 | acc@10 | acc@1 | acc@10 |
| Song et. al. [32](BMVC'16) | SaN | E | - | - | 78.4 | 99.0 | 50.4 | 91.3 | - | - |
| SaN Triplet [41](CVPR'16) | SaN | DE | 25.9 | - | 69.1 | 97.9 | 39.1 | 87.8 | 30.9 | - |
| DSSA [33](ICCV'17) | SaN | E | - | - | 81.4 | 95.9 | 61.7 | 94.8 | 33.7 | - |
| Radenoviet al. [26](ECCV'18) | VGG16 | D | - | - | 85.6 | 97.9 | 54.8 | 92.2 | - | - |
| GN Triplet [29](TOG'16) | GoogLeNet | - | 37.1 | - | - | - | - | - | - | - |
| DCCRM [38](PR'19) | GoogLeNet | DE | 46.2 | 96.5 | - | - | - | - | - | - |
| Pang et. al. [23](CVPR'20) | GoogLeNet | D | - | - | 86.0 | - | 56.5 | - | 36.5 | - |
| CSR (ours) | GoogLeNet | - | 50.8 | 85.4 | 93.8 | 99.0 | 58.3 | 90.5 | 48.7 | 84.8 |
| Ayan et. al. [3](CVPR'20) | InceptionV3 | E | - | - | - | - | - | - | - | 79.6 |
| Bhunia et. al. [2](CVPR'21) | InceptionV3 | D | - | - | - | - | - | - | 39.1 | 87.5 |
| CSR (ours) | InceptionV3 | - | 58.9 | 89.7 | 94.8 | 100.0 | 64.4 | 91.3 | 52.1 | 87.9 |
| Quadruplet [31](ACMMM'17) | ResNet18 | - | 42.2 | - | - | - | - | - | - | - |
| AE-Net [7](PR'22) | ResNet18 | - | 46.0 | - | - | - | - | - | - | - |
| CSR (ours) | ResNet18 | - | 47.6 | 82.9 | 93.8 | 97.9 | 55.5 | 89.1 | 45.1 | 85.5 |
| TC-Net [16](ACMMM'19) | Densnet169 | E | 40.8 | - | 95.9 | 100.0 | 63.5 | 94.8 | 40.2 | - |
| CSR (ours) | Densenet169 | - | 56.2 | 88.6 | 97.9 | 100.0 | 67.8 | 97.4 | 47.6 | 85.0 |
+
+acc@1 Comparison: CSR outperforms previous works within each backbone group respectively. Compared with TC-Net[16], CSR yields better performance gain on large datasets, (i.e., Sketchy and QMUL-ShoeV2). For small datasets (i.e., QMUL-Chair and QMUL-Shoe), it is not important to collect more negative samples, so advantage of $\mathcal{L}_{da}$ is not abvious and the performance gain is smaller. Compared with previous works, CSR-Densenet169 achieves the best acc@1 on all four datasets, outperforming previous works by $10.0\%$ on Sketchy, $2.0\%$ on QMUL-Chair, $4.3\%$ on QMUL-Shoe and $7.4\%$ on QMUL-ShoeV2.
+
+acc@10 Comparison: CSR achieves the best performance except on Sketchy, where DCCRM[38] reports $96.5\%$ . We suspect that side information (e.g., text descriptions in DCCRM[38]) provides rich references for matching similar images. However, the side information can be ambiguous and help little to target at the exact image paired with the query. Therefore, acc@1 of DCCRM[38] is lower than CSR. Beside Sketchy, CSR achieves $100\%$ on QMUL-Shoe Chair. CSR outperforms TC-Net[16] by $2.6\%$ on QMUL-Shoe and Bhunia et. al. by $0.4\%$ on QMUL-ShoeV2.
+
+Side Information Comparison: As shown in column "Side", several works[23,3,2,38] rely on side information. These methods dug into side information in one or two specific fine-grained sketch-image datasets. However, in some other scenarios where such information is unavailable, these methods might suffer from performance drop. On the contrary, since CSR relaxes the requirement for side information, it certainly paves the way for further applications.
+
+To observe how side information can work on CSR, we conducted an extra experiment: we pretrain CSR-GoogLeNet with $\mathcal{L}_{da}$ on the pretraining dataset used by Pang et. al. [23]. acc@1 on QMUL-Shoe improves from $64.4\%$ to $68.7\%$
+
+and acc@1 on QMUL-ShoeV2 improves from $48.7\%$ to $51.0\%$ . The result shows the performance gain from side information.
+
+Table 2. acc@1/acc@10 results on QMUL-ShoeV2 and Sketchy. MF stands for multi-level feature fusion. RC stands for recovery compensation. S0 reports results obtained from a pretrained backbone. "SE+SD": we adopt the stroke disorder approach as a sketch augmentation technique by setting $p_d = 0.05$ . "GridD": we divide the sketch into grids and then rotate and translate the grids to obtain a disordered sketch.
+
+| setting | MF | RC | total loss | Sketchy(%) | QMUL-ShoeV2(%) |
| acc@1 | acc@10 | acc@1 | acc@10 |
| S0 | × | - | × | 0.7 | 3.6 | 0.6 | 9.6 |
| S1 | × | - | Lsa | 42.6 | 80.2 | 42.2 | 82.9 |
| S2 | × | - | Lsa w/ SE+SD | 43.4 | 81.4 | 44.2 | 83.2 |
| S3 | × | - | Lda | 44.9 | 81.6 | 43.7 | 83.0 |
| S4 | ✓ | - | Lda | 48.2 | 82.4 | 45.9 | 84.3 |
| S5 | × | × | Lrec + Lda | 45.2 | 82.5 | 44.0 | 83.7 |
| S6 | × | ✓ | Lrec + Lda | 47.7 | 84.8 | 46.6 | 85.3 |
| S7 | ✓ | × | Lrec + Lda | 48.9 | 84.4 | 46.7 | 83.5 |
| S8 | ✓ | ✓ | Lrec + Lda w/ GridD | 41.9 | 80.8 | 43.5 | 81.7 |
| S9 | ✓ | ✓ | Lrec + Lda | 50.8 | 85.4 | 48.7 | 84.8 |
+
+# 4.3 Ablation Study
+
+We conduct ablation experiments on both QMUL-ShoeV2 and Sketchy bcause 1) QMUL-ShoeV2 is the largest clean dataset; 2) Sketchy is the largest and most diversified among the introduced four FG-SBIR datasets. Experiments on these two datasets can be representative.
+
+Module Ablation We report ablation study results in Table. 2. S2 outperforms S1 by 0.4/2.2 acc@1 performance gain on Sketchy/QMUL-ShoeV2, implying that our disorder algorithm work well for sketch augmentation. Also, S1 is inferior to S3, which proves that $\mathcal{L}_{da}$ can effectively make the advantage of $s^{\prime}$ to enhance robustness of our model. Comparison between S4 and S3 shows importance of MF in FG-SBIR. Moreover, MF contributes a greater performance gain when $\mathcal{L}_{rec}$ is introduced (S5 v.s. S7). It is also observed that $\mathcal{L}_{rec}$ does not work when ablating MF and RC, which produce important low-level information to support the recovery process (S5 v.s. S3). S8 shows that simply dividing the sketch into grids is not viable because it destroys semantic completeness of sketch strokes. S9 is the best setting, demonstrating the effectiveness of our method.
+
+Effect of $w$ We study effect of $w$ in Fig. 4. The recovered sketches in QMUL-ShoeV2 using different $w$ are visualized in Fig. 6. The results reveal that a smaller $w$ yields clearer recovered sketches. An over small $w$ will overemphasize
+
+
+Fig. 4. Visualization of recovered sketches and retrieval features towards different $w$ on QMUL-ShoeV2 test set. Within each group of figures bordered by dotted lines, the top two are the disordered sketch and the paired image. The rest three columns illustrate the original sketch, disordered strokes and selected strokes (refer to Fig. 3).
+
+$\mathcal{L}_{rec}$ so that retrieval feature contains too much pixel-level information. These information is unnecessary for retrieval. On the other hand, overvaluing $w$ leads to performance drop. Based on the low quality of the recovered sketches with a large $w$ , we suspect that $\mathcal{L}_{rec}$ is ignored during training so the model fails to learn stroke recognition ability.
+
+Table 3. acc@1 results by ablating each channel of e . "ablated" stands for the dis-enabled channel.
+
+| ablated | - | 1 | 2 | 3 | 4 |
| QMUL-ShoeV2 | 48.7 | 44.7 | 45.5 | 46.3 | 43.9 |
| Sketchy | 50.8 | 51.0 | 49.6 | 49.4 | 50.8 |
+
+Table 4. acc@1 results by setting different $\alpha_{p}$ . Note that $\alpha = 1 - \alpha_{p} p_{d}$ and $p_{d}$ linearly grows to 0.3.
+
+| αp | 0 | 1 | 2 | 3 |
| QMUL-ShoeV2 | 38.8 | 48.3 | 48.7 | 47.3 |
| Sketchy | 36.7 | 50.3 | 50.8 | 49.6 |
+
+Misplaced Stroke Distinguishing The visualization in Fig. 4 shows that recovery of disordered strokes (column 2) is better than that of selected strokes (column 3). Largely due to the complete pixel-level information, misplaced stroke distinguishing(MSD) is easier than stroke recovery. To further investigate the role MSD plays in stroke recovery in Table. 3, we ablate each channel of e. That is, we remove the channel from e and study the retrieval performance. We report results in Tab. 3. On QMUL-ShoeV2, each channel shows its necessity since sketch-image pairs are well aligned and recovery is well performed. Whereas, in Sketchy, the image object can be occluded and the paired sketch can be misaligned. Then stroke recovery cannot complete but MSD is still achievable. Therefore, channel 2 abd channel 3 are more important than channel 1 and channel 4 on Sketchy and ablating channel 1 and channel 4 does not make much difference. In conclusion, when stroke recovery is unable to complete, we can resort to MSD to enhance stroke recognition ability.
+
+$\mathcal{L}_{trp}$ v.s. $\mathcal{L}_{sa}$ v.s. $\mathcal{L}_{da}$ We compare variants of $\mathcal{L}_{trp}$ , $\mathcal{L}_{da}$ and $\mathcal{L}_{da}$ . Results are reported in Table. 5. Differences among some typical settings are visualized
+
+Table 5. acc@1 results with variants of $\mathcal{L}_{trp}$ and $\mathcal{L}_{da}$ . Column "loss" omits $\mathcal{L}_{rec}$ . CSR adopts A5 while A4 is the original InfoNCE loss[5]. "ETC" stands for efficient triplet collection (refer to Sec. 3.3). $n_t$ is the number of triplets in a batch. "anchor" stands for the anchor modality.
+
+| setting | loss | anchor | ETC | nt | metric | b = 16 | b = 96 |
| Sketchy | QMUL-ShoeV2 | Sketchy | QMUL-ShoeV2 |
| T1 | Ltrp | s | × | b | L2 | 38.9 | 26.6 | 39.2 | 27.0 |
| T2 | Ltrp | p | × | b | L2 | 28.8 | 14.2 | 30.1 | 14.3 |
| T3 | Ltrp | p& s | × | 2b | L2 | 35.0 | 37.3 | 35.2 | 38.2 |
| T4 | Ltrp | s | √ | b(b-1) | L2 | 45.8 | 43.0 | 46.5 | 45.2 |
| T5 | Ltrp | p | √ | b(b-1) | L2 | 37.8 | 37.1 | 38.9 | 39.6 |
| T6 | Ltrp | p& s | √ | 4b(b-1) | L2 | 45.2 | 42.0 | 46.2 | 44.5 |
| T7 | Ltrp | s | √ | b(b-1) | cos | 29.5 | 40.1 | 30.5 | 42.9 |
| A1 | Lsa | s | - | - | cos | 46.9 | 44.0 | 48.6 | 47.1 |
| A2 | Lsa | s | - | - | dot | 30.4 | 29.5 | 31.8 | 32.8 |
| A3 | Lsa | p | - | - | cos | 42.0 | 35.6 | 44.0 | 37.4 |
| A4 | Lsa | p& s | - | - | cos | 46.8 | 37.5 | 48.7 | 39.0 |
| A5 | Lda | s& s' | - | - | cos | 48.3 | 44.7 | 50.8 | 48.7 |
| A6 | Lda | s& s' | - | - | dot | 30.0 | 30.1 | 32.7 | 32.8 |
+
+in Fig. 5. In this paper, we define as $\lambda(1 - \cos(\cdot, \cdot))$ , where $\lambda$ is a scale hyperparameter. Besides results in the Table. 5, we also conduct experiments of $\mathcal{L}_{trp} + dot$ and $\mathcal{L}_{da} + L2$ but their results are not comparable.
+
+Results show that 1) sketches serve as anchors better than images (T1 v.s. T2, T4 v.s. T5, A1 v.s. A3); 2) negative samples should be all images and a sketch-image mixture does not help model performance (T4 v.s. T6, A1 v.s. A3) 3) ETC is consistently superior to the naive triplet collection approach(T1-T3 v.s. T4-T6); 4) $\mathcal{L}_{trp}$ is inconsistent with with cosine distance (T4 v.s. T7); 5) $\mathcal{L}_{sa} / \mathcal{L}_{da}$ are inconsistent with dot similarity (A1 v.s. A3,A5 v.s.A6).
+
+These results are reported according to retrieval with cosine distance. To ensure that the comparison is fair for $\mathcal{L}_{trp}$ , we perform retrieval using L2 distance. In setting T4(b = 96), the resultant acc@1 is 46.3/45.2 on Sketchy/QMUL-ShoeV2, which almost remains the same. We also compare $\mathcal{L}_{trp}$ acc@1-r curves using cosine and L2 distance in Fig.8. The curves show that $\mathcal{L}_{trp} + cos$ is sensitive to margin $r$ and is not a feasible combination. These results verify that our $\mathcal{L}_{sa}$ and $\mathcal{L}_{da}$ are superior to $\mathcal{L}_{trp}$ . Besides, enlarging the batch size leads to greater performance gain in T4-T6, A1 and A2-A4. This is because these settings can collect more negative samples.
+
+Augmentation via Stroke Disorder. To further investigate how our proposed stroke disorder algorithm works for sketch augmentation, we reproduce several existing worksGN Triplet[29] [29] and Quadruplet[31] and TC-Net[16] and employ different sketch augmentation methods in the training stage. The results are reported in Table. 6. In this section, SaN stands for the augmentation methods applied in SaN[41], including stroke removal and stroke deformation. $p_d$ is set to 0.05. Column " $\mathcal{L}_{sa}$ " reports results of setting S2 in Tab. 2. Results show that 1) SE+SD outperforms baselines, verifying that SD can improve diversity of training samples and prevent the risk of overfitting; 2) both of SE+SaN
+
+
+Fig. 5. Illustration of some settings in Tab. 5.
+
+Table 6. Acc@1 using different augmentation methods on Sketchy.
+
+| augmentation | [29] | [31] | [16] | Lsa |
| basiines | 37.1 | 42.2 | 40.8 | 42.6 |
| SE+SD | 37.6 | 44.1 | 41.4 | 43.4 |
| SE+SaN | 39.0 | 43.9 | 41.7 | 43.6 |
| SE+SD+SaN | 39.3 | 44.4 | 42.2 | 44.0 |
+
+and $\mathrm{SE} + \mathrm{SD} + \mathrm{SaN}$ outperform baselines, implying that extracted strokes are effective; 3) SaN works as an augmentation method better than SD. Compared with rotation and translation of SD, removal and deformation can provide more natural augmented sketches. But we do not disorder a sketch via removal and deformation since sketches augmented in this way are found difficult for recovery.
+
+
+Fig.6. acc@1-w curves of Fig.7. acc@1-τ curves of Fig.8. acc@1-r curves using CSR. CSR with different sim. ing $\mathcal{L}_{trp}$ with different $d$ .
+
+
+
+
+
+Effect of $\tau$ . We plot acc@1- $\tau$ curves in Fig. 7. The results show that cosine similarity works better than dot product. An extremely small $\tau$ can lead good model performance, which is subtly different from observation in SimCLR[5]. SimCLR[5] aims at self-supervised learning task, where a pair of positive samples are augmented from the same image and their cosine similarity is very high, approximating one. In FG-SBIR, a sketch-image pair belongs to two different domains and their features are likely to be mutually orthogonal. Therefore, a small $\tau$ is required to amplify the similarity between a sketch-image pair.
+
+# 5 Case Study
+
+Retrieval results are visualized in Fig. 9. In most cases, the first retrieved image is correctly hit. The failure case of row (4) results from misalignment between the sketch and target images. The failure case of row (7) is due to the noises from image background. Recovered sketches are presented in Fig. 10. Recovery results are generally satisfactory and most of poor-quality recovery results come from
+
+
+Fig.10. Recovery visualization on Sketchy (row (1)-(3)) and QMUL-ShoeV2 (row (4)-(6)). The four columns are the disordered sketch, the recovered sketch, the original sketch and the paired image.
+
+
+Fig.9.Top-10 retrievals on QMULShoeV2 (row 1)-(4)) and Sketchy (row 5)-(7)).Green/red borders indicate the correct/incorrect retrieved images.
+
+Sketchy. For example, the duck in row (2) is not well recovered for 1) the feather in the sketch is abstract and does not match any image element; 2) bottom of the duck is obstructed by water, making stroke recovery unfeasible. These two problems are common in Sketchy. Sketchy therefore benefits less from $\mathcal{L}_{rec}$ than QMUL-ShoeV2. Moreover, compared with row(10), we manually erase the knot of the image in row (8) and the knot of the disordered sketch in row (9). In both circumstances of row (8) and row (9), the knot cannot be recovered. These three cases imply that the recovery process does not rely on memorizing category characteristics. Instead, the recovery needs to match each sketch stroke with the corresponding image element.
+
+# 6 Conclusion
+
+In this paper, we investigate the task of fine-grained sketch-based image retrieval (FG-SBIR) from a new perspective. We highlight stroke recognition ability of the network and propose Conditional Stroke Recovery(CSR). CSR introduce an auxiliary task that recovers a sketch from its disordered style with its paired image as condition. Moreover, targeting at the weaknesses of triplet loss, we propose double-anchor InfoNCE loss specially for FG-SBIR. A unsupervised stroke disorder algorithm is also proposed along with CSR. The algorithm can work as a new sketch augmentation approach. In terms of acc@1, CSR outperforms previous works by a great margin on four datasets.
+
+Acknowledgments: This work was supported by the National Key Research and Development Program of China, No.2018YFB1402600.
+
+# References
+
+1. Bhattacharjee, S.D., Yuan, J., Hong, W., Ruan, X.: Query adaptive instance search using object sketches. In: ACM International Conference on Multimedia (ACM MM). pp. 1306-1315 (2016)
+2. Bhunia, A.K., Chowdhury, P.N., Sain, A., Yang, Y., Xiang, T., Song, Y.: More photos are all you need: Semi-supervised learning for fine-grained sketch based image retrieval. In: Computer Vision and Pattern Recognition (CVPR) (2021)
+3. Bhunia, A.K., Yang, Y., Hospedales, T.M., Xiang, T., Song, Y.Z.: Sketch less for more: On-the-fly fine-grained sketch-based image retrieval. In: Computer Vision and Pattern Recognition (CVPR) (2020)
+4. Bui, T., Ribeiro, L.S.F., Ponti, M., Collomosse, J.P.: Sketching out the details: Sketch-based image retrieval using convolutional neural networks with multi-stage regression. Computers & Graphics (CAG) 71, 77-87 (2018)
+5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.E.: A simple framework for contrastive learning of visual representations. In: International Conference on Machine Learning, (ICML) (2020)
+6. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.E.: Big self-supervised models are strong semi-supervised learners. In: Advances in neural information processing systems (NIPS) (2020)
+7. Chen, Y., Zhang, Z., Wang, Y., Zhang, Y., Feng, R., Zhang, T., Fan, W.: Ae-net: Fine-grained sketch-based image retrieval via attention-enhanced network. Pattern Recognition (PR) (2022)
+8. Eitz, M., Hildebrand, K., Boubekeur, T., Alexa, M.: An evaluation of descriptors for large-scale image retrieval from sketched feature lines. Computers & Graphics 34(5), 482-498 (2010)
+9. Felzenszwalb, P.F., Girshick, R.B., McAllester, D., Ramanan, D.: Object detection with discriminatively trained part-based models. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) 32(9), 1627-1645 (2010)
+0. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Computer Vision and Pattern Recognition (CVPR) (2016)
+1. Hu, R., Collomosse, J.: A performance evaluation of gradient field hog descriptor for sketch based image retrieval. Computer Vision and Image Understanding (CVIU) (2013)
+2. Hu, R., Wang, T., Collomosse, J.: A bag-of-regions approach to sketch-based image retrieval. In: IEEE International Conference on Image Processing (ICIP) (2011)
+3. Huang, G., Liu, Z., van der Maaten, L., Weinberger, K.Q.: Densely connected convolutional networks. In: Computer Vision and Pattern Recognition (CVPR). pp. 2261-2269 (2017)
+4. Kato, T., Kurita, T., Otsu, N., Hirata, K.: A sketch retrieval method for full color image database-query by visual example. In: IAPR International Conference on Pattern Recognition (ICPR). pp. 530-533 (1992)
+5. Li, Y., Hospedales, T.M., Song, Y.Z., Gong, S.: Intra-category sketch-based image retrieval by matching deformable part models. In: British Machine Vision Conference (BMVC). pp. 115.1-115.12 (2014)
+6. Lin, H., Fu, Y., Lu, P., Gong, S., Xue, X., Jiang, Y.G.: Tc-net for isbir: Triplet classification network for instance-level sketch based image retrieval. In: ACM International Conference on Multimedia (ACM MM) (2019)
+7. Ling, Z., Xing, Z., Li, J., Niu, L.: Multi-level region matching for fine-grained sketch-based image retrieval. In: ACM International Conference on Multimedia (ACM MM) (2022)
+
+18. Liu, L., Shen, F., Shen, Y., Liu, X., Shao, L.: Deep sketch hashing: Fast free-hand sketch-based image retrieval. In: computer vision and pattern recognition (CVPR). pp. 2862-2871 (2017)
+19. Liu, Q., Xie, L., Wang, H., Yuille, A.: Semantic-aware knowledge preservation for zero-shot sketch-based image retrieval. In: ICCV (2019)
+20. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: European Conference on Computer Vision (ECCV) (2016)
+21. van den Oord, A., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. CoRR abs/1807.03748 (2018)
+22. Pang, K., Li, K., Yang, Y., Zhang, H., Hospedales, T.M., Xiang, T., Song, Y.Z.: Generalising fine-grained sketch-based image retrieval. In: Computer Vision and Pattern Recognition (CVPR). pp. 677-686 (2019)
+23. Pang, K., Yang, Y., Hospedales, T.M., Xiang, T., Song, Y.: Solving mixed-modal jigsaw puzzle for fine-grained sketch-based image retrieval. In: Computer Vision and Pattern Recognition (CVPR) (2020)
+24. Peng, C., Gao, X., Wang, N., Li, J.: Face recognition from multiple stylistic sketches: Scenarios, datasets, and evaluation. Pattern Recognit. 84, 262-272 (2018)
+25. Radenovic, F., Tolias, G., Chum, O.: CNN image retrieval learns from bow: Unsupervised fine-tuning with hard examples. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 3-20 (2016)
+26. Radenovic, F., Tolias, G., Chum, O.: Deep shape matching. In: European Conference on Computer Vision (ECCV). pp. 751-767 (2018)
+27. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: Navab, N., Hornegger, J., III, W.M.W., Frangi, A.F. (eds.) Medical Image Computing and Computer-Assisted Intervention MICCAI. vol. 9351, pp. 234-241 (2015)
+28. Saavedra, J.M., Barrios, J.M., Orand, S.: Sketch based image retrieval using learned keyshapes (LKS). In: British Machine Vision Conference (BMVC). pp. 164.1-164.11 (2015)
+29. Sangkloy, P., Burnell, N., Ham, C., Hays, J.: The sketchy database: Learning to retrieve badly drawn bunnies. ACM Transactions on Graphics (TOG) (2016)
+30. Schaefer, S., McPhail, T., Warren, J.D.: Image deformation using moving least squares. ACM Trans. Graph. (2006)
+31. Seddati, O., Dupont, S., Saïd, M.: Quadruplet networks for sketch-based image retrieval. In: ACM International Conference on Multimedia (ACM MM) (2017)
+32. Song, J., Song, Y.Z., Xiang, T., Hospedales, T., Xiang, R.: Deep multi-task attribute-driven ranking for fine-grained sketch-based image retrieval. In: British Machine Vision Conference (BMVC). vol. 1, p. 3 (2016)
+33. Song, J., Yu, Q., Song, Y.Z., Xiang, T., Hospedales, T.M.: Deep spatial-semantic attention for fine-grained sketch-based image retrieval. In: International Conference on Computer Vision (ICCV). pp. 5551–5560 (2017)
+34. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., Rabinovich, A.: Going deeper with convolutions. In: computer vision and pattern recognition (CVPR). pp. 1-9 (2015)
+35. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z.: Rethinking the inception architecture for computer vision. In: Computer Vision and Pattern Recognition (CVPR). pp. 2818-2826 (June 2016)
+36. Xu, P., Huang, Y., Yuan, T., Pang, K., Song, Y., Xiang, T., Hospedales, T.M., Ma, Z., Guo, J.: Sketchmate: Deep hashing for million-scale human sketch retrieval. In: Computer Vision and Pattern Recognition (CVPR). pp. 8090-8098 (2018)
+
+37. Xu, P., Yin, Q., Qi, Y., Song, Y.Z., Ma, Z., Wang, L., Guo, J.: Instance-level coupled subspace learning for fine-grained sketch-based image retrieval. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 19-34 (2016)
+38. Yanfei, W., Fei, H., Yuejie, Z., Rui, F., Tao, Z., Weiguo, F.: Deep cascaded cross-modal correlation learning for fine-grained sketch-based image retrieval. Pattern Recognition (PR) (2019)
+39. Yelamarthi, S.K., Reddy, S.K., Mishra, A., Mittal, A.: A zero-shot framework for sketch based image retrieval. In: ECCV (2018)
+40. Yu, A., Grauman, K.: Fine-grained visual comparisons with local learning. In: Computer Vision and Pattern Recognition (CVPR). pp. 192-199 (2014)
+41. Yu, Q., Liu, F., Song, Y.Z., Xiang, T., Hospedales, T.M., Loy, C.C.: Sketch me that shoe. In: Computer Vision and Pattern Recognition (CVPR) (2016)
+42. Yu, Q., Yang, Y., Liu, F., Song, Y.Z., Xiang, T., Hospedales, T.M.: Sketch-a-net: A deep neural network that beats humans. International journal of computer vision (IJCV) 122(3), 411-425 (2017)
+43. Zhu, H., Long, M., Wang, J., Cao, Y.: Deep hashing network for efficient similarity retrieval. In: Proceedings of the AAAI Conference on Artificial Intelligence (AAAI). pp. 2415-2421 (2016)
+44. Zhu, M., Chen, C., Wang, N., Tang, J., Bao, W.: Gradually focused fine-grained sketch-based image retrieval. PLoS ONE 14(5), e0217168 (2019)
\ No newline at end of file
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/images.zip b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..45c972256f8beb7cac66733927e6fcf59975d548
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a844b84cc37ca1626e2282563907ffe0d5cfa741f4ab2a60117e0e61f6052693
+size 528789
diff --git a/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/layout.json b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b571bcb999236be2ec6aba79ee5c71bf1ebd0adb
--- /dev/null
+++ b/conditionalstrokerecoveryforfinegrainedsketchbasedimageretrieval/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c024ab62fd59b8c9b0d7f119703d8e889c0dbb36908ee222fce5f00a4330484f
+size 509175
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_content_list.json b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a1f1a97774c1babdceb427af188e06ea14cf431c
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e1dc896b539bd03a6340f705349ac477c29dbab3dae20bf272104043829d9d8d
+size 80536
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_model.json b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e633c4f5d0d04e05555bb4b06e8cc1889a45b8fc
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9937c9d61f02c374f2132f1564e2a0584e336cce7f38b1df4d62ab409603e203
+size 102562
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_origin.pdf b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9094f0feb55e51d7601c0df7d69629ed86058ce0
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/de6dc81c-fb3d-48bb-99f7-5265541ab0d5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b5443574f1b9eacd6357efa5e098ae62818686119437c2e6d4e08a43b8a4bebf
+size 8536432
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/full.md b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c3ed8d7191fcf1949466a41faa9fcbd244ffae55
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/full.md
@@ -0,0 +1,322 @@
+# ConMatch: Semi-Supervised Learning with Confidence-Guided Consistency Regularization
+
+Jiwon $\mathrm{Kim}^{1,2\dagger*}$ , Youngjo $\mathrm{Min}^{1*}$ , Daehwan $\mathrm{Kim}^{3*}$ , Gyuseong $\mathrm{Lee}^1$ , Junyoung $\mathrm{Seo}^1$ , Kwangrok Ryoo $^1$ , and Seungryong $\mathrm{Kim}^1$
+
+$^{1}$ Korea University
+2 NAVER AI Lab
+
+3 Samsung Electro-Mechanics
+
+Abstract. We present a novel semi-supervised learning framework that intelligently leverages the consistency regularization between the model's predictions from two strongly-augmented views of an image, weighted by a confidence of pseudo-label, dubbed ConMatch. While the latest semi-supervised learning methods use weakly- and strongly-augmented views of an image to define a directional consistency loss, how to define such direction for the consistency regularization between two strongly-augmented views remains unexplored. To account for this, we present novel confidence measures for pseudo-labels from strongly-augmented views by means of weakly-augmented view as an anchor in non-parametric and parametric approaches. Especially, in parametric approach, we present, for the first time, to learn the confidence of pseudo-label within the networks, which is learned with backbone model in an end-to-end manner. In addition, we also present a stage-wise training to boost the convergence of training. When incorporated in existing semi-supervised learners, ConMatch consistently boosts the performance. We conduct experiments to demonstrate the effectiveness of our ConMatch over the latest methods and provide extensive ablation studies. Code has been made publicly available at https://github.com/JiwonCocoder/ConMatch
+
+# 1 Introduction
+
+Semi-supervised learning has emerged as an attractive solution to mitigate the reliance on large labeled data, which is often laborious to obtain, and intelligently leverage a large amount of unlabeled data, to the point of being deployed in many computer vision applications, especially image classification [38, 51, 53]. Generally, this task has adopted pseudo-labeling [1, 19, 29, 38, 44, 49, 59] or consistency regularization [17, 23, 28, 34, 46, 51]. Some methods [4, 5, 40, 45, 50, 52, 56] proposed to integrate both approaches in a unified framework, which is often called holistic approach. As one of pioneering works, FixMatch [45] first generates a pseudo-label from the model's prediction on the weakly-augmented instance and then encourages the prediction from the strongly-augmented instance to follow
+
+the pseudo-label. Their success inspired many variants that use, e.g., curriculum learning [52, 56].
+
+On the other hand, concurrent to the race for better semi-supervised learning methods [45, 52, 56], substantial progress has been made in self-supervised representation learning, especially with contrastive learning [3, 6, 8, 10, 20, 22], aiming at learning a task-agnostic feature representation without any supervision, which can be well transferred to the downstream tasks. Formally, they encourage the features extracted from two differently-augmented images to be pulled against each other, which injects some invariance or robustness into the models. Not surprisingly, semi-supervised learning frameworks can definitely benefit from self-supervised representation learning [24, 32, 33] in that good representation from the feature encoder yields better performance with semi-supervised learning, and thus, some methods [24, 32] attempt to combine the aforementioned two paradigms to boost the performance by achieving the better feature encoder.
+
+Extending techniques presented in existing self-supervised representation learning [3,6,8,10,20,22], which only focus on learning feature encoder, to further consider the model's prediction itself would be an appealing solution to effectively combine the two paradigms, which allows for boosting not only feature encoder but also classifier. However, compared to feature representation learning [3,6,8,10,20,22], the consistency between the model's predictions from two different augmentations should be defined by considering which direction is better to achieve not only invariance but also high accuracy in image classification. Without this, simply pulling the model's predictions as done in [3,6,8,10,20,22] may hinder the classifier output, thereby decreasing the accuracy.
+
+In this paper, we present a novel framework for semi-supervised learning, dubbed ConMatch, that intelligently leverages the confidence-guided consistency regularization between the model's predictions from two strongly-augmented images. Built upon conventional frameworks [45, 56], we consider two strongly-augmented images and one weakly-augmented image, and define the consistency between the model's predictions from two strongly-augmented images, while still using an unsupervised loss between the model's predictions from one of the strongly-augmented images and the weakly-augmented image, as done in [45, 56]. Since defining the direction of consistency regularization between two strongly-augmented images is of prime importance, rather than selecting in a deterministic manner, we present a probabilistic technique by measuring the confidence of pseudo-labels from each strongly-augmented image, and weighting the consistency loss with this confidence. To measure the confidence of pseudo-labels, we present two techniques, including non-parametric and parametric approaches. With this confidence-guided consistency regularization, our framework dramatically boosts the performance of existing semi-supervised learners [45, 56]. In addition, we also present a stage-wise training scheme to boost the convergence of training. Our framework is a plug-and-play module, and thus various semisupervised learners [4, 24, 32, 33, 45, 50, 52, 56] can benefit from our framework. We briefly summarize our method with other highly relevant works in semisupervised learning in Table 1. Experimental results and ablation studies show
+
+Table 1. Comparison of our ConMatch to other relevant works which have a form of consistency regularization combining pseudo-labeling [5,24,32,33, 45,52,56]
+
+ | MixMatch [5] | FixMatch [45] | FlexMatch [56] | Dash [52] | SelfMatch [24] | CoMatch [32] | LESS [33] | ConMatch (Ours) |
| Using pseudo-labeling | X | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Using two strong branches | X | X | X | X | ✓ | ✓ | X | ✓ |
| Learning confidence measure | X | X | X | X | X | X | X | ✓ |
| Using stage-wise training | X | X | X | X | ✓ | X | X | ✓ |
+
+that the proposed framework not only boosts the convergence but also achieves the state-of-the-art performance on most standard benchmarks [12, 27, 35].
+
+# 2 Related Works
+
+Semi-supervised Learning. Semi-supervised learning has been an effective paradigm for leveraging an abundance of unlabeled data along with limited labeled data. For this task, various methods such as pseudo-labeling [19, 29] and consistency regularization [28, 42, 46] have been proposed. In pseudo-labeling [29], a model uses unlabeled samples with high confidence as training targets, which reduces the density of data points at the decision boundary [19, 41]. Consistency regularization has been first introduced by $\pi$ -model [42], which is further improved by numerous following works [17, 23, 28, 34, 46, 51]. In the consistency regularization, the model should minimize the distance between the model's predictions when fed perturbed versions of the input [23, 28, 34, 37, 46, 49, 51] or the model [23, 28, 37, 46, 51, 57]. Very recently, advanced consistency regularization methods [4, 45, 50] have been introduced by combining with pseudo-labeling. These methods show high accuracy, comparable to supervised learning in a fully-labeled setting, e.g., ICT [48], MixMatch [5], UDA [50], ReMixMatch [4], and FixMatch [45]. The aforementioned methods can be highly boosted by simultaneously considering the techniques proposed in recent self-supervised representation learning methods [3, 6, 8, 20, 22].
+
+Self-supervised Representation Learning. Self-supervised representation learning has recently attracted much attention [3, 6, 8, 16, 18, 20, 22, 36, 58] due to its competitive performance. Specifically, contrastive learning [3, 6, 8, 20, 22] becomes a dominant framework. It formally maximizes the agreement between different augmented views of the same image [16, 18, 36, 58]. Most previous methods benefit from a large amount of negative pairs to preclude constant outputs and avoid a collapse problem [8]. An alternative to approximate the loss is to use cluster-based approach by discriminating between groups of images with similar features [6]. Some methods [10, 20] mitigated to use negative samples by using a momentum encoder [20] and a stop-gradient technique [10]. The aforementioned methods applied the consistency loss at the feature-level, unlike recent semi-supervised learning methods [45, 56] that consider the consistency loss in the logit-level, which may not be optimal to be incorporated with
+
+
+(a) Semi-sup.
+
+
+(b) Self-sup.
+Fig. 1. Conceptual illustration of existing methods that leverage unlabeled data: (a) semi-supervised learning- the model uses the model's prediction itself to produce a pseudo-label for unlabeled data [4,5,17,28,29,34,42,45,46,48,50], (b) self-supervised representation learning- the model is learned to generate the same feature embedding for two augmented views from unlabeled data [3,6,8,10,20,20,22], and (c) semi-supervised learning with self-supervision representation learning- the model simultaneously learns a feature representation with self-supervised representation loss, while learning all the networks with semi-supervised learning [24,32,33].
+
+
+(c) Semi-sup. with self-sup.
+
+semi-supervised learners. Formulating the consistency loss in the logit-level as self-supervision is challenging because a direction between two augmented views should be determined. Without this, simply pulling the model's predictions as done in [3,6,8,10,20,22] may hinder the classifier output, thereby decreasing the accuracy.
+
+Self-supervision in Semi-supervised Learning. Many recent state-of-the-art semi-supervised learning methods adopt the self-supervised representation learning methods [9,55] to jointly learn good feature representation. Self-supervised pre-training, followed by supervised fine-tuning, has shown strong performance on semi-supervised learning settings. Specifically, SelfMatch [24] adopted SimCLR [8] for self-supervised pre-training and FixMatch [45] for semi-supervised fine-tuning. However, it may learn sub-optimal representation for the image classification task due to the task-agnostic learning. On the other hand, some methods [30, 32] unify pseudo-labeling and self-supervised learning. [31] alternates between self- and semi-supervised learning. There lacks a study to effectively use self-supervision, rather than simply adopting this.
+
+Confidence Estimation in Semi-supervised Learning. In semi-supervised learning, a confidence-based strategy has been widely used along with pseudo labeling so that the unlabeled data are used only when the predictions are sufficiently confident. Such confidence in pseudo-labeling has been often measured by the peak values of the predicted probability distribution [40, 45, 50, 52, 56]. Although the selection of unlabeled samples with high confidence predictions moves decision boundaries to low density regions [7], many of these selected predictions are incorrect due to the poor calibration of neural networks [21], which has the discrepancy between the confidence level of a network's individual predictions and its overall accuracy and leads to noisy training and poor gen
+
+eralization [14, 15]. However, there was no study how to learn the confidence of pseudo-labels, which is the topic of this paper.
+
+# 3 Methodology
+
+# 3.1 Preliminaries
+
+Let us define a batch of labeled instances as $\mathcal{X} = \{(x_b, y_b)\}_{b=1}^B$ , where $x_b$ is an instance and $y_b$ is a label representing one of $Y$ labels. In addition, let us define a batch of unlabeled instances as $\mathcal{U} = \{u_b\}_{b=1}^{\mu B}$ , where $\mu$ is a hyper-parameter that determines the size of $\mathcal{U}$ relative to $\mathcal{X}$ . The objective of semi-supervised learning is to use both $\mathcal{X}$ and $\mathcal{U}$ to train a model with parameters $\theta$ taking an instance $r \in \mathcal{X} \cup \mathcal{U}$ as input and outputting a distribution over class labels $y$ such that $p_{\mathrm{model}}(y|r;\theta)$ . The model generally consists of an feature encoder $f(\cdot)$ and a classifier $g(\cdot)$ , and thus, $p_{\mathrm{model}}(y|r;\theta) = g(f(r))$ .
+
+For semi-supervised learning, most state-of-the-art methods are based on consistency regularization approaches [2,28,42] that rely on the assumption that the model should generate similar predictions when perturbed versions of the same instance are fed, e.g., using data augmentation [34], or model perturbation [28, 46]. These methods formally extract a pseudo-label from one branch, filtered by confidence, and use this as a target for another branch. For instance, FixMatch [45] utilizes two types of augmentations such as weak and strong, denoted by $\alpha(\cdot)$ and $\mathcal{A}(\cdot)$ , and a pseudo-label from weakly-augmented version of an image is used as a target for strongly-augmented version of the same image. This loss function is formally defined such that
+
+$$
+\mathcal {L} _ {\mathrm {u n}} = c (r) \mathcal {H} (q (r), p _ {\text {m o d e l}} (y | \mathcal {A} (r); \theta)), \tag {1}
+$$
+
+where $c(r)$ denotes a confidence of $q(r)$ , and $q(r)$ denotes a pseudo-label generated from $p_{\mathrm{model}}(y|\alpha (r);\theta)$ , which can be either an one-hot label [40, 45, 52, 56] or a sharpened one [4, 5, 50], and $\mathcal{H}(\cdot ,\cdot)$ is often defined as a cross-entropy loss. In this framework, measuring confidence $c(r)$ is of prime importance, but conventional methods simply measure this, e.g., by the peak value of the softmax predictions [40, 45, 50, 52, 56].
+
+On the other hands, semi-supervised learning framework can definitely benefit from existing self-supervised representation learning [24,32,33] in that good representation from the feature encoder $f(\cdot)$ yields better performance with semi-supervised learner. In this light, some methods attempted to combine semi-supervised learning and self-supervised representation learning to achieve the better feature encoder [24,32]. Concurrent to the race for better semi-supervised learning methods, substantial progress has been made in self-supervised representation learning, especially with contrastive learning [3,6,8,10,20,22]. The loss function for this task can also be defined as a consistency regularization loss, similar to [40,45,50,52,56] but in the feature-level, such that
+
+$$
+\mathcal {L} _ {\text {s e l f}} = \mathcal {D} \left(F _ {i} (r), F _ {j} (r)\right), \tag {2}
+$$
+
+
+Fig. 2. Network configuration of ConMatch. A semi-supervised learning framework built upon consistency loss with an additional strong branch to leverage confidence loss between two strong branches. In the parametric approach, the confidence estimator block takes a concatenated heterogeneous feature as an input and produces the estimated confidence of pseudo label.
+
+where $F_{i}(r) = f(\mathcal{A}_{i}(r))$ and $F_{j}(r) = f(\mathcal{A}_{j}(r))$ extracted from images with two different strongly-augmented images $\mathcal{A}_i(\cdot)$ and $\mathcal{A}_j(\cdot)$ , respectively. $\mathcal{D}(\cdot, \cdot)$ can be defined as contrastive loss [22] or negative cosine similarity [10]. Even though this loss helps to boost learning the feature encoder $f(\cdot)$ , the mechanism that simply pulls the features $F_{i}(r)$ and $F_{j}(r)$ may not be optimal to boost a semi-supervised learner and break the latent feature space, without considering a direction representing which branch is better.
+
+# 3.2 Formulation
+
+To combine the semi- and self-supervised learning paradigm in a boosting fashion, unlike [24, 32, 33], we present to effectively exploit a self-supervision between two strong branches tailored for boosting semi-supervised learning, called ConMatch. Unlike existing self-supervised representation learning methods, e.g., SimSiam [10], we formulate the consistency regularization loss at class logit-level $^{4}$ , as done in semi-supervised learning methods [45, 56], and estimate the confidences of each pseudo-label from two strongly-augmented images, $\mathcal{A}_i(r)$ and $\mathcal{A}_j(r)$ for $r$ , and use them to consider the probability of each direction between them. Since measuring such confidences is notoriously challenging, we present novel confidence estimators by using the output from weak-augmented image $\alpha(r)$ as an anchor in non-parametric and parametric approaches.
+
+An overview of our ConMatch is illustrated in Fig. 2. Specifically, there exist two branches for strongly-augmented images (called strong branches) and one
+
+branch for weakly-augmented image (called weak branch). Similar to existing semi-supervised representation learning methods [45,52,56], we attempt to apply the consistency loss between a pair of each strong branch and weak branch. But, tailored to semi-supervised learning, we present a confidence-guided consistency regularization loss $\mathcal{L}_{\mathrm{ccr}}$ between two strong branches such that
+
+$$
+\mathcal {L} _ {\mathrm {c c r}} = c _ {i} (r) \mathcal {H} \left(q _ {i} (r), p _ {\text {m o d e l}} \left(y \mid \mathcal {A} _ {j} (r); \theta\right)\right) + c _ {j} (r) \mathcal {H} \left(q _ {j} (r), p _ {\text {m o d e l}} \left(y \mid \mathcal {A} _ {i} (r); \theta\right)\right), \tag {3}
+$$
+
+where $q_{i}(r)$ and $q_{j}(r)$ denote the pseudo-labels generated from $p_{\mathrm{model}}(y|\mathcal{A}_i(r);\theta)$ and $p_{\mathrm{model}}(y|\mathcal{A}_j(r);\theta)$ , respectively. $c_{i}(r)$ and $c_{j}(r)$ denote estimated confidence of $q_{i}(r)$ and $q_{j}(r)$ . Our proposed loss function is different from conventional self-supervised representation learning loss $\mathcal{L}_{\mathrm{self}}$ in that the consistency is applied in the logit-level (not feature-level) similar to [45,56], and adjusted by the estimated confidence. However, unlike [40, 45, 50, 52, 56], we can learn the better feature representation by considering two strongly-augmented views, while improving semi-supervised learning performance at the same time. It should be noted that this simple loss function can be incorporated with any semi-supervised learners, e.g., FixMatch [45] or FlexMatch [56].
+
+To measure the confidences $c_{i}(r)$ and $c_{j}(r)$ , we present two kinds of confidence estimators, based on non-parametric and parametric approaches. In the following, we explain how to measure these confidences in detail.
+
+# 3.3 Measuring Confidence: Non-parametric Approach
+
+Existing semi-supervised learning methods [29, 42, 45] have selected unlabeled samples with high confidence as training targets (i.e., pseudo-labels) in a straightforward way; which can be viewed as a form of entropy minimization [19]. It has been well known that it is non-trivial to set an appropriate threshold for such handcrafted confidence estimation, and thus, confidence-based strategies commonly suffer from a dilemma between pseudo-label exploration and accuracy depending on the threshold [1, 33].
+
+In our framework, estimating the confidence of pseudo-labels from strong branches may suffer from similar limitations if the conventional handcrafted methods [29, 42, 45] are simply used. To overcome this, we present a novel way to measure the confidences, $c_{i}(r)$ and $c_{j}(r)$ , based on the similarity between outputs of strongly-augmented images and weakly-augmented images. Based on the hypothesis that the similarity between the logits or probabilities from strongly-augmented images and weakly-augmented images can be directly used as a confidence estimator, we present to measure confidence of each strong branch loss by the cross-entropy loss value itself between strongly-augmented and weakly-augmented images. Specifically, we measure such a confidence with the following:
+
+$$
+s _ {i} (r) = \frac {1}{\mathcal {H} \left(p _ {\text {m o d e l}} (y \mid \alpha (r) ; \theta) , p _ {\text {m o d e l}} (y \mid \mathcal {A} _ {i} (r) ; \theta)\right)}, \tag {4}
+$$
+
+where the smaller $\mathcal{H}(p_{\mathrm{model}}(y|\alpha (r);\theta),p_{\mathrm{model}}(y|\mathcal{A}_i(r);\theta))$ , the higher $s_i(r)$ is. $s_j(r)$ can be similarly defined with $\alpha (r)$ and $\mathcal{A}_j(r)$ . Finally, $c_{i}(r)$ is computed such that $c_{i}(r) = s_{i}(r) / (s_{i}(r) + s_{j}(r))$ , and $c_{j}(r)$ is similarly computed.
+
+Algorithm 1: ConMatch-P (Parametric Approach)
+1: Notation: strong augmentation $\mathcal{A}$ , weak augmentation $\alpha$ , model $p_{\mathrm{model}}(\cdot;\theta)$ consisting of feature encoder $f$ and classifier $g$ , confidence estimator $h(\cdot;\theta_{\mathrm{conf}})$ , pseudo label $q$ , leranable confidence $c$
+2: Input: $\mathcal{X} = \{(x_b, y_b) : b \in (1, \ldots, B)\}$ , $\mathcal{U} = \{u_b : b \in (1, \ldots, \mu B)\}$
+3: for $b = 1$ to $B$ do
+4: $F(\alpha(x_b)), L(\alpha(x_b)) = f(\alpha(x_b)), g(f(\alpha(x_b)))$
+5: $c(\alpha(x_b)) = h(F(\alpha(x_b)), L(\alpha(x_b)); \theta_{\mathrm{conf}})$
+6: if $y_b == \operatorname{argmax}_y p_{\mathrm{model}}(y|\alpha(x_b);\theta)$ then
+7: $c_{\mathrm{GT}}(\alpha(x_b)) = 1$
+8: else
+9: $c_{\mathrm{GT}}(\alpha(x_b)) = 0$
+10: end if
+11: end for
+12: $\mathcal{L}_{\mathrm{sup}} = \sum_{b=1}^{B} \mathcal{H}(y_b, p_{\mathrm{model}}(y|\alpha(x_b);\theta))$
+13: $\mathcal{L}_{\mathrm{conf-sup}} = \mathcal{H}(c_{\mathrm{GT}}(\alpha(x_b)), h(F(\alpha(x_b)), L(\alpha(x_b)); \theta_{\mathrm{conf}}))$
+14: for $b = 1$ to $\mu B$ do
+15: $(F_i, F_j), (L_i, L_j) = f(\mathcal{A}_i(u_b), \mathcal{A}_j(u_b)), g(f(\mathcal{A}_i(u_b), \mathcal{A}_j(u_b)))$
+16: $c_i, c_j = h(F_i, L_i; \theta_{\mathrm{conf}}), h(F_j, L_j; \theta_{\mathrm{conf}})$
+17: Generate pseudo labels for differently augmented versions $\alpha, \mathcal{A}_i, \mathcal{A}_j$
+18: end for
+19: Calculate $\mathcal{L}_{\mathrm{un}}$ using $c, q$ from $\alpha(u_b)$ , and $p_{\mathrm{model}}(y|\mathcal{A}(u_b);\theta)$ via Eq. 2
+20: Calculate $\mathcal{L}_{\mathrm{ccr}}$ using $c, q$ from $\mathcal{A}(u_b)$ and $p_{\mathrm{model}}(y|\mathcal{A}(u_b);\theta)$ via Eq. 3
+21: Calculate $\mathcal{L}_{\mathrm{conf}}$ using $c$ from $\mathcal{A}(u_b)$ and $p_{\mathrm{model}}(y|\alpha(u_b);\theta)$ via Eq. 6
+22: Update $\theta$ by minimizing $L_{\mathrm{sup}}, L_{\mathrm{un}}$ and $L_{\mathrm{ccr}}$
+23: Update $\theta_{\mathrm{conf}}$ by minimizing $L_{\mathrm{conf-sup}}$ and $L_{\mathrm{conf}}$
+24: Return: Model parameters $\{\theta, \theta_{\mathrm{conf}}\}$
+
+In this case, the total loss for the non-parametric approach is as follows:
+
+$$
+\mathcal {L} _ {\text {t o t a l}} ^ {\mathrm {n p}} = \lambda_ {\sup } \mathcal {L} _ {\sup } + \lambda_ {\mathrm {u n}} \mathcal {L} _ {\mathrm {u n}} + \lambda_ {\mathrm {c c r}} \mathcal {L} _ {\mathrm {c c r}}, \tag {5}
+$$
+
+where $\lambda_{\mathrm{sup}}$ , $\lambda_{\mathrm{un}}$ , and $\lambda_{\mathrm{ccr}}$ are weights for $\mathcal{L}_{\mathrm{sup}}$ , $\mathcal{L}_{\mathrm{un}}$ , and $\mathcal{L}_{\mathrm{ccr}}$ , respectively. Note that for weakly-augmented labeled images $\alpha(x_b)$ with labels $y_b$ , a simple classification loss $\mathcal{L}_{\mathrm{sup}}$ is applied as $\mathcal{H}(y_b, p_{\mathrm{model}}(y|\alpha(x_b);\theta))$ , as done in [45].
+
+# 3.4 Measuring Confidence: Parametric Approach
+
+Even though the above confidence estimator with non-parametric approach yields comparable performance to some extent (which will be discussed in experiments), it solely depends on each image, and thus it may be sensitive to outliers or errors without any modules to learn a prior from the dataset. To overcome this, we present an additional parametric approach for confidence estimation. Motivated by stereo confidence estimation [11, 39, 43, 47], obtaining a confidence measure from the networks by extracting the confidence features from input and predicting the confidence with a classifier, we also introduce a learnable confidence
+
+measure for pseudo-labels. Unlike existing methods that simply use the model output as confidence [40, 45, 50, 52, 56], such learned confidence can intelligently select a subset of pseudo-labels that are less noisy, which helps the network to converge significantly faster and achieve improved performance by utilizing the false negative samples excluded from training by high threshold at early training iterations.
+
+Specifically, we define an additional network for learnable confidence estimation such that $c(r) = h(F(r), L(r); \theta_{\mathrm{conf}})$ , where $h(\cdot)$ is a confidence estimator with model parameters $\theta_{\mathrm{conf}}$ , $F(r)$ is a feature, and $L(r)$ is a logit from an instance $r$ , as shown in Fig. 2. For the network architecture, the concatenation of feature $F(r)$ and logit $L(r)$ transformed by individual non-linear projection heads is used, based on the intuition that a direct concatenation of two their heterogeneous confidence features does not provide an optimal performance [25], followed by the final classifier for confidence estimation. The detailed network architecture is described in the supplementary material.
+
+The confidence estimator is learned with the following loss function:
+
+$$
+\mathcal {L} _ {\text {c o n f}} = c _ {i} (r) \mathcal {H} \left(p _ {\text {m o d e l}} (y | \alpha (r); \theta_ {\text {f r e e z e}}), p _ {\text {m o d e l}} (y | \mathcal {A} _ {i} (r); \theta_ {\text {f r e e z e}})\right) + \log \left(1 / c _ {i} (r)\right), \tag {6}
+$$
+
+where $\theta_{\mathrm{freeze}}$ is a freezed network parameter with a stop gradient. The intuition behind is that during the confidence network training, we just want to make the network learn the confidence itself, rather than collapsing to trivial solution to learn the feature encoder simultaneously. In addition, we also use the supervised loss for confidence estimator $\mathcal{L}_{\mathrm{conf - sup}} = \mathcal{H}(c_{\mathrm{GT}},h(F(\alpha (x_b)),L(\alpha (x_b));\theta_{\mathrm{conf}}))$ $c_{\mathrm{GT}} = 1$ if $y_{b}$ is equal to $\arg \max_yp_{\mathrm{model}}(y|\alpha (x_b);\theta)$ , and $c_{\mathrm{GT}} = 0$ otherwise.
+
+The total loss for the parametric case can be written as
+
+$$
+\mathcal {L} _ {\text {t o t a l}} ^ {\text {p a r a m}} = \lambda_ {\sup } \mathcal {L} _ {\sup } + \lambda_ {\mathrm {u n}} \mathcal {L} _ {\mathrm {u n}} + \lambda_ {\text {c o n f}} \mathcal {L} _ {\text {c o n f}} + \lambda_ {\text {c o n f - s u p}} \mathcal {L} _ {\text {c o n f - s u p}} + \lambda_ {\text {c c r}} \mathcal {L} _ {\text {c c r}} \tag {7}
+$$
+
+where $\lambda_{\mathrm{conf}}$ and $\lambda_{\mathrm{conf - sup}}$ are the weights for $\mathcal{L}_{\mathrm{conf}}$ and $\mathcal{L}_{\mathrm{conf - sup}}$ , respectively. We explain an algorithm for ConMatch of parametric approach in Alg. 1.
+
+# 3.5 Stage-Wise Training
+
+Even though our framework can be trained in an end-to-end manner, we further propose a stage-wise training strategy to boost the convergence of training. This stage-wise training consists of three stages, 1) pre-training for the feature encoder, 2) pre-training for the confidence estimator (for parametric approach only), and 3) fine-tuning for both feature encoder and confidence estimator (for parametric approach only). Specifically, we first warm up the feature encoder by solely using the standard semi-supervised loss functions with $\mathcal{L}_{\mathrm{sup}}$ and $\mathcal{L}_{\mathrm{un}}$ . We then train the confidence estimator based on the outputs of the pre-trained feature encoder in the parametric approach. As mentioned in [26], this kind of simple technique highly boosts the convergence to discriminate between confident and unconfident outputs from the networks. Finally, we fine-tune all the networks with the proposed confidence-guided self-supervised loss $\mathcal{L}_{\mathrm{ccr}}$ . We empirically demonstrate the effectiveness of the stage-wise training by achieving state-of-the-art results on standard benchmark datasets [12, 27, 35].
+
+# 4 Experiments
+
+# 4.1 Experimental Settings
+
+In experiments, we extensively evaluate the performance of our ConMatch on various standard datasets [12, 27, 35] with various label fraction settings in comparison to state-of-the-art algorithms, such as UDA [50], FixMatch [45], FlexMatch [56], SelfMatch [24], LESS [33] and Dash [52]. Our proposed methods have two variants; ConMatch-NP (non-parametric approach), and ConMatch-P (parametric approach) integrated to FlexMatch [56], which is the state-of-the-art semi-supervised learner, even though it can be easily integrated to others [32, 45, 49].
+
+Datasets. We consider four standard benchmarks, including CIFAR-10/100 [27], SVHN [35], and STL-10 [12]. CIFAR-10 [27] contains 50,000 training images and 10,000 test images, which have resolution $32 \times 32$ with ten classes. Similar to CIFAR-10, CIFAR-100 [27] has the same number of training/test images and image size, but it differently classifies as 100 fine-grained classes. SVHN [35] consists of 73,257 training images with 26,032 test images, having also $32 \times 32$ resolution images, belonging to ten different classes of numeric digits. STL-10 [12] contains 5,000 labeled images with size of $96 \times 96$ from 10 classes and 100,000 unlabeled images with size of $96 \times 96$ .
+
+Evaluation Metrics. For quantitative evaluation, we compute the mean and standard deviation of error rates, when trained on 3 different folds for labeled data, based on the standard evaluation protocol of selecting a subset of the training data while keeping the remainder unlabeled. In addition, as in [32, 56], we evaluate the quality of pseudo labels by training curves of precision, recall, and F1 values.
+
+# 4.2 Implementation Details
+
+For a fair comparison, we generally follow the same hyperparameters with Fix-Match [45]. Specifically, we use Wide ResNet (WRN) [54] as a feature encoder for the experiments, especially WRN-28-2 for CIFAR-10 [27] and SVHN [35], WRN-28-8 for CIFAR-100 [27], and WRN-37-2 for STL-10 [12]. We use a batch size of labeled data $B = 64$ , the ratio of unlabeled data $\mu = 7$ , and SGD optimizer with a learning rate starting from 0.03. The detailed hyperparameter settings are described in the supplementary material. For a weakly-augmented sample, we use a crop-and-flip, and for a strongly-augmented sample, we use RandAugmnet [13].
+
+# 4.3 Comparison to State-Of-The-Art Methods
+
+On standard semi-supervised learning benchmarks, we evaluate the performance of our frameworks, ConMatch-P and ConMatch-NP, compared to various state-of-the-art methods, as shown in Table 2 and Table 3. We observe that the performance difference between ConMatch-NP and ConMatch-P is not large, except in
+
+Table 2. Comparison on error rates on CIFAR-10 [27] and CIFAR-100 [27] benchmarks on 3 different folds.
+
+| Methods | CIFAR-10 | CIFAR-100 |
| 40 | 250 | 4,000 | 400 | 2,500 |
| UDA [50] | 29.05±5.93 | 8.82±1.08 | 4.88±0.18 | 59.28±0.88 | 33.13±0.22 |
| FixMatch (RA) [45] | 13.81±3.37 | 5.07±0.65 | 4.26±0.06 | 48.85±1.75 | 28.29±0.11 |
| FlexMatch [56] | 4.97±0.06 | 4.98±0.09 | 4.19±0.01 | 39.94±1.62 | 26.49±0.20 |
| SelfMatch [24] | 6.81±1.08 | 4.87±0.26 | 4.06±0.08 | - | - |
| CoMatch [32] | 6.91±8.47 | 4.91±0.33 | - | - | - |
| LESS [33] | 6.80±1.10 | 4.90±0.80 | - | 48.70±12.40 | - |
| Dash (RA) [52] | 13.22±3.75 | 4.56±0.13 | 4.08±0.06 | 44.76±0.96 | 27.18±0.21 |
| ConMatch-NP | 4.89±0.07 | 5.00±0.37 | 4.36±0.42 | 44.90±1.34 | 26.91±1.35 |
| ConMatch-P | 4.43±0.13 | 4.70±0.25 | 3.92±0.08 | 38.89±2.18 | 25.39±0.20 |
+
+Table 3. Comparison on error rates on SVHN [35] and STL-10 [12] benchmarks on 3 different folds.
+
+| Method | SVHN | STL-10 |
| 40 | 250 | 1,000 |
| UDA [50] | 52.63±20.51 | 5.69±2.76 | 7.66±0.56 |
| FixMatch (RA) [45] | 3.96±2.17 | 2.48±0.38 | 7.98±1.50 |
| FlexMatch [56] | 4.97±0.06 | 4.98±0.09 | 5.77±0.18 |
| SelfMatch [24] | 3.42±1.02 | 2.63±0.43 | - |
| CoMatch [32] | 6.91±8.47 | 4.91±0.33 | 20.20±0.38 |
| Dash (RA) [52] | 3.03±1.59 | 2.17±0.10 | 7.26±0.40 |
| ConMatch-NP | 6.20±3.44 | 5.80±0.74 | 6.02±0.08 |
| ConMatch-P | 3.14±0.57 | 3.13±0.72 | 5.26±0.04 |
+
+the label-scare setting. This may be explained by the fact that non-parametric method highly depends on baseline performance since it does not consider other samples which can be modeled as a prior. We show our superiority on most benchmarks with extensive label setting, but we mainly focus the label-scare setting, since it corresponds to the central goal of semi-supervised learning, reducing the need for labeled data. We achieve $4.43\%$ and $38.89\%$ error rate for CIFAR-10 and CIFAR-100 settings [27] with only 4 labels per class respectively. Compared to the results of SelfMatch [24] and CoMatch [32], closely related to ours, adopting self-supervised methods, we can prove the competitiveness of our method by achieving $2.38\%$ and $2.48\%$ improvements at CIFAR-10 with 40 labels. On the other datasets, CIFAR-100 [35] and STL-10 [12], we record the lowest error rate of $38.89\%$ and $25.39\%$ with 400 and 2500 labels setting, and also slightly better than baseline [56] by recording $5.26\%$ in STL-10 dataset.
+
+# 4.4 Ablation Study
+
+Effects of Different Baseline. We first evaluate our ConMatch with two baselines, FixMatch [45] and FlexMatch [56], in both parametric (ConMatch-P) and non-parametric (ConMatch-NP) approaches as shown in Table 4. ConMatch-P w/ [45] boosts the performance significantly on CIFAR-10 with 40 labels from
+
+Table 4. Ablation study of different semi-supervised baselines. We evaluate non-parametric (ConMatch-NP) and parametric (ConMatch-P) approaches with different baselines, Fixmatch [45] and FlexMatch [56].
+
+| Methods | CIFAR-10 | CIFAR-100 |
| 40 | 250 | 400 |
| FixMatch [45] | 13.81 | 5.07 | 48.85 |
| ConMatch-NP w/ [45] | 6.83 | 4.73 | 48.73 |
| ConMatch-P w/ [45] | 5.13 | 4.64 | 48.00 |
| FlexMatch [56] | 4.97 | 4.98 | 39.94 |
| ConMatch-NP w/ [56] | 4.84 | 4.74 | 44.90 |
| ConMatch-P w/ [56] | 4.68 | 4.70 | 38.89 |
+
+Table 5. Ablation study of training schemes. E means end-to-end training and S means stage-wise training.
+
+| Methods | Status | CIFAR-10 | CIFAR-100 |
| 40 | 250 | 400 |
| ConMatch w/ FixMatch [45] | E | 4.85 | 4.77 | 47.81 |
| S | 5.13 | 4.60 | 48.00 |
| ConMatch w/ FlexMatch [56] | E | 4.68 | 4.70 | 57.16 |
| S | 4.43 | 4.70 | 38.89 |
+
+$13.81\%$ to $5.13\%$ , achieving the state-of-the-art result. The performance gains of ConMatch-P w/ [45] is relatively higher than one w/ [56] on most setting since [45] does not adaptively adjust the threshold depending on the difficulty level of samples. Note that the thresholds of FixMatch [45] and FlexMatch [56] are used only for $\mathcal{L}_{\mathrm{un}}$ .
+
+Effectiveness of Confidence Measure. In Table 4, we evaluate two confidence measures in non-parametric and parametric approach. In extremely labelscare setting, such as CIFAR-10 with 4 labels per class, the non-parametric approach achieves relatively lower performance, $1.70\%$ and $0.16\%$ , in both FixMatch and FlexMatch baseline, while the parametric approach (ConMatch-P w/ [56]) reaches the state-of-the-art performance. But, as the number of labels increases, the gap between non-parametric and parametric approach decreases, indicating that a certain number of labeled samples are required to measure the confidence without the confidence estimator.
+
+Effectiveness of Stage-Wise Training. In Table 5, we report the performance difference between end-to-end training and stage-wise training. We can observe that ConMatch-P has obtained meaningful enhancements in both training schemes, but stage-wise training shows more larger gap between baseline.
+
+Architecture. Here we analyze the key components of ConMatch, the confidence estimator and guided consistency regularization as shown in Table 6. For the fair comparison, we construct three branches on FixMatch [45] as baseline (I), one branch for a weakly-augmented sample and two branches for strongly-augmented samples. (II) uses logit-level self-supervised loss, but not weighted
+
+Table 6. Ablation study of our component on CIFAR-10 [27] with 40 labels.
+
+ | Three branches | Logit-level self-sup. | Confidence net. input | Error rate |
| logits | features |
| (I) | ✓ | X | X | X | 18.11 |
| (II) | ✓ | ✓ | X | X | 77.50 |
| (III) | ✓ | ✓ | ✓ | X | 7.05 |
| (IV) | ✓ | ✓ | ✓ | ✓ | 5.13 |
+
+
+(a) Precision
+
+
+(b) Recall
+Fig. 3. Plots of evolution of pseudo-labeling between ours and baselines [45, 56] as training progresses on CIFAR-10 [27] with 40 labels: in terms of (a) Precision, (b) Recall, and (c) F1-Score.
+
+
+(c) F1-score
+
+by confidence, i.e., $\mathcal{L}_{\mathrm{ccr}}$ with $c_{i}(r), c_{j}(r) = 1/2$ . (III) and (IV) weight confidences of strongly-augmented instances to logit-level self-supervised loss. (III) only takes logits as an input of confidence estimator while both logits and features are fed into (IV). The result of this ablation study shows that logit-level self-supervised loss without confidence guidance causes network collapse. The collapse occurred in (II) is one of the reasons why other semi-supervised methods [32] could not use self-supervision at logit-level and should use negative pairs. (III) and (IV) show a significant performance improvement compared to (I) without such collapse.
+
+Evaluating Confidence Estimation. To evaluate the effectiveness of our confidence estimator, we measure precision, recall, and F1-score of ConMatch and FixMatch [45] as evolving the training iterations on CIFAR-10 [27] with 40 labels as shown in Fig. 3. The confident sample is defined as an unlabeled sample having max probability over than threshold in the baseline and confidence measures over than 0.5 in ConMatch. The quality of the confident sample is important to determine precisely to prevent the confirmation bias problem, significantly degrading the performances. The three classification metric, precision, recall and F1-score, are effective to evaluate the quality of the confidence. By Fig. 3, we can observe that ConMatch, starting from the scratch for the fair comparison, shows higher values in all metric compared to the baseline.
+
+# 4.5 Analysis
+
+Convergence Speed. One of the advantages of our ConMatch is its superior convergence speed. Based on the results as shown in Fig. 4 (b) and (d), the loss of
+
+
+(a)
+
+
+(b)
+Fig. 4. Convergence analysis of baselines [45,56] and ConMatch: A comparison of top-1-accuracy and loss between FixMatch [45] and ConMatch w/ [45] are shown at (a) and (b). A comparison between FlexMatch [56] and ConMatch w/ [56] is shown at (c) and (d). Evaluations are done every 200K iterations on CIFAR-10 with 40 labels.
+
+
+(c)
+
+
+(d)
+
+ConMatch decreases much faster and smoother than corresponding baseline [45], demonstrating our superior convergence speed. Furthermore, the result of the accuracy in Fig. 4 (a) also proves that the global optimum is quickly reached. We also prove our effectiveness of our method by comparing the another baseline, FlexMatch [56]. The convergence speed gap is relatively smaller than FixMatch since it dynamically adjust class-wise thresholds at each time step, leading to the stable training, but ConMatch achieves fast convergence at all time step from the early phase where the predictions of the model are still unstable. It is manifest that the introduction of ConMatch successfully encourages the model to proactively improve the overall learning effect.
+
+# 5 Conclusion
+
+In this paper, we have proposed a novel semi-supervised learning framework built upon conventional consistency regularization frameworks with an additional strong branch to define the proposed confidence-guided consistency loss between two strong branches. To account for the direction of such consistency loss, we present confidence measures in non-parametric and parametric approaches. Also, we also presented a stage-wise training to boost the convergence of training. Our experiments have shown that our framework boosts the performance of base semi-supervised learners, and is clearly state-of-the-art on several benchmarks.
+
+Acknowledgements. This research was supported by the MSIT, Korea (IITP-2022-2020-0-01819, ICT Creative Consilience program), and National Research Foundation of Korea (NRF-2021R1C1C1006897).
+
+# References
+
+1. Arazo, E., Ortego, D., Albert, P., O'Connor, N.E., McGuinness, K.: Pseudolabeling and confirmation bias in deep semi-supervised learning. In: IJCNN (2020)
+2. Bachman, P., Alsharif, O., Precup, D.: Learning with pseudo-ensembles. In: NeurIPS (2014)
+3. Bachman, P., Hjelm, R.D., Buchwalter, W.: Learning representations by maximizing mutual information across views. In: NeurIPS (2019)
+4. Berthelot, D., Carlini, N., Cubuk, E.D., Kurakin, A., Sohn, K., Zhang, H., Raffel, C.: Remixmatch: Semi-supervised learning with distribution alignment and augmentation anchoring. arXiv:1911.09785 (2019)
+5. Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., Raffel, C.A.: Mixmatch: A holistic approach to semi-supervised learning. In: NeurIPS (2019)
+6. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., Joulin, A.: Unsupervised learning of visual features by contrasting cluster assignments. In: NeurIPS (2020)
+7. Chapelle, O., Zien, A.: Semi-supervised classification by low density separation. In: AISTATS workshops (2005)
+8. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: ICML (2020)
+9. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.E.: Big self-supervised models are strong semi-supervised learners. In: NeurIPS (2020)
+10. Chen, X., He, K.: Exploring simple siamese representation learning. In: CVPR (2021)
+1. Choi, H., Lee, H., Kim, S., Kim, S., Kim, S., Sohn, K., Min, D.: Adaptive confidence thresholding for monocular depth estimation. In: ICCV (2021)
+2. Coates, A., Ng, A., Lee, H.: An analysis of single-layer networks in unsupervised feature learning. In: AISTATS (2011)
+3. Cubuk, E.D., Zoph, B., Shlens, J., Le, Q.V.: Randaugment: Practical automated data augmentation with a reduced search space. In: CVPR workshops (2020)
+4. Dawid, A.P.: The well-calibrated bayesian. JASA (1982)
+5. DeGroot, M.H., Fienberg, S.E.: The comparison and evaluation of forecasters. Journal of the Royal Statistical Society: Series D (The Statistician) (1983)
+6. Donahue, J., Jia, Y., Vinyals, O., Hoffman, J., Zhang, N., Tzeng, E., Darrell, T.: Decaf: A deep convolutional activation feature for generic visual recognition. In: ICML (2014)
+7. French, G., Mackiewicz, M., Fisher, M.: Self-ensembling for visual domain adaptation. arXiv:1706.05208 (2017)
+8. Gidaris, S., Singh, P., Komodakis, N.: Unsupervised representation learning by predicting image rotations. arXiv:1803.07728 (2018)
+9. Grandvalet, Y., Bengio, Y.: Semi-supervised learning by entropy minimization. In: NeurIPS (2004)
+20. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al.: Bootstrap your own latent-a new approach to self-supervised learning. In: NeurIPS (2020)
+21. Guo, C., Pleiss, G., Sun, Y., Weinberger, K.Q.: On calibration of modern neural networks. In: ICML (2017)
+22. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: CVPR (2020)
+23. Ke, Z., Wang, D., Yan, Q., Ren, J., Lau, R.W.: Dual student: Breaking the limits of the teacher in semi-supervised learning. In: ICCV (2019)
+
+24. Kim, B., Choo, J., Kwon, Y.D., Joe, S., Min, S., Gwon, Y.: Selfmatch: Combining contrastive self-supervision and consistency for semi-supervised learning. arXiv:2101.06480 (2021)
+25. Kim, S., Min, D., Kim, S., Sohn, K.: Unified confidence estimation networks for robust stereo matching. TIP (2018)
+26. Kim, S., Min, D., Kim, S., Sohn, K.: Adversarial confidence estimation networks for robust stereo matching. T-ITS (2020)
+27. Krizhevsky, A., Hinton, G., et al.: Learning multiple layers of features from tiny images (2009)
+28. Laine, S., Aila, T.: Temporal ensembling for semi-supervised learning. arXiv:1610.02242 (2016)
+29. Lee, D.H., et al.: Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In: ICML workshops (2013)
+30. Lee, D., Kim, S., Kim, I., Cheon, Y., Cho, M., Han, W.S.: Contrastive regularization for semi-supervised learning. arXiv:2201.06247 (2022)
+31. Lerner, B., Shiran, G., Weinshall, D.: Boosting the performance of semi-supervised learning with unsupervised clustering. arXiv:2012.00504 (2020)
+32. Li, J., Xiong, C., Hoi, S.C.: Comatch: Semi-supervised learning with contrastive graph regularization. In: ICCV (2021)
+33. Lucas, T., Weinzaepfel, P., Rogez, G.: Barely-supervised learning: Semi-supervised learning with very few labeled images. arXiv:2112.12004 (2021)
+34. Miyato, T., Maeda, S.i., Koyama, M., Ishii, S.: Virtual adversarial training: a regularization method for supervised and semi-supervised learning. TPAMI (2018)
+35. Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., Ng, A.Y.: Reading digits in natural images with unsupervised feature learning (2011)
+36. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: ECCV (2016)
+37. Park, S., Park, J., Shin, S.J., Moon, I.C.: Adversarial dropout for supervised and semi-supervised learning. In: AAAI (2018)
+38. Pham, H., Dai, Z., Xie, Q., Le, Q.V.: Meta pseudo labels. In: CVPR (2021)
+39. Poggi, M., Mattoccia, S.: Learning from scratch a confidence measure. In: BMVC (2016)
+40. Rizve, M.N., Duarte, K., Rawat, Y.S., Shah, M.: In defense of pseudo-labeling: An uncertainty-aware pseudo-label selection framework for semi-supervised learning. arXiv:2101.06329 (2021)
+41. Sajjadi, M., Javanmardi, M., Tasdizen, T.: Mutual exclusivity loss for semi-supervised deep learning. In: ICIP (2016)
+42. Sajjadi, M., Javanmardi, M., Tasdizen, T.: Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In: NeurIPS (2016)
+43. Seki, A., Pollefeys, M.: Patch based confidence prediction for dense disparity map. In: BMVC (2016)
+44. Shi, W., Gong, Y., Ding, C., Tao, Z.M., Zheng, N.: Transductive semi-supervised deep learning using min-max features. In: ECCV (2018)
+45. Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C.A., Cubuk, E.D., Kurakin, A., Li, C.L.: Fixmatch: Simplifying semi-supervised learning with consistency and confidence. In: NeurIPS (2020)
+46. Tarvainen, A., Valpola, H.: Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In: NeurIPS (2017)
+47. Tosi, F., Poggi, M., Benincasa, A., Mattoccia, S.: Beyond local reasoning for stereo confidence estimation with deep learning. In: ECCV (2018)
+
+48. Verma, V., Kawaguchi, K., Lamb, A., Kannala, J., Bengio, Y., Lopez-Paz, D.: Interpolation consistency training for semi-supervised learning. arXiv:1903.03825 (2019)
+49. Xie, Q., Dai, Z., Hovy, E., Luong, T., Le, Q.: Unsupervised data augmentation for consistency training. In: NeurIPS (2020)
+50. Xie, Q., Dai, Z., Hovy, E., Luong, T., Le, Q.: Unsupervised data augmentation for consistency training. In: NeurIPS (2020)
+51. Xie, Q., Luong, M.T., Hovy, E., Le, Q.V.: Self-training with noisy student improves imagenet classification. In: CVPR (2020)
+52. Xu, Y., Shang, L., Ye, J., Qian, Q., Li, Y.F., Sun, B., Li, H., Jin, R.: Dash: Semi-supervised learning with dynamic thresholding. In: ICML (2021)
+53. Yalniz, I.Z., Jégou, H., Chen, K., Paluri, M., Mahajan, D.: Billion-scale semi-supervised learning for image classification. arXiv:1905.00546 (2019)
+54. Zagoruyko, S., Komodakis, N.: Wide residual networks. arXiv:1605.07146 (2016)
+55. Zhai, X., Oliver, A., Kolesnikov, A., Beyer, L.: S4l: Self-supervised semi-supervised learning. In: ICCV (2019)
+56. Zhang, B., Wang, Y., Hou, W., Wu, H., Wang, J., Okumura, M., Shinozaki, T.: Flexmatch: Boosting semi-supervised learning with curriculum pseudo labeling. In: NeurIPS (2021)
+57. Zhang, L., Qi, G.J.: Wcp: Worst-case perturbations for semi-supervised deep learning. In: CVPR (2020)
+58. Zhang, R., Isola, P., Efros, A.A.: Colorful image colorization. In: ECCV (2016)
+59. Zoph, B., Ghiasi, G., Lin, T.Y., Cui, Y., Liu, H., Cubuk, E.D., Le, Q.: Rethinking pre-training and self-training. In: NeurIPS (2020)
\ No newline at end of file
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/images.zip b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4b39c8dc9ccd454e6bdab6113c6e37a281060f80
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:14b8c5d57eed20f205eb0422e1744af89731b9cca11de88b460f5a27bdd35704
+size 384699
diff --git a/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/layout.json b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7cdb043bea1b113fe07ced37fc06050508661bc6
--- /dev/null
+++ b/conmatchsemisupervisedlearningwithconfidenceguidedconsistencyregularization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7149c0752377b5f200d3f393b8ba7eba25ddeda4603019abaa2f9ea7c44ae456
+size 484501
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_content_list.json b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..dc5ee2006d4c085dfa178e03ccba02e661b1fdb7
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e554beaaabae039fd222163af86bbc949b55ca504d847800883f29b4c3abcfd5
+size 73498
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_model.json b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..76d538323618a91f7e7210750ea9852fefca754c
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce20d7eda4a95625cf5dd53b3ce3ebc45d3a41a84b756e2c508d3e23a69a14bc
+size 87774
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_origin.pdf b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..10191649fcd5ff2bc72c5edefbb789bc7e2967f8
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/4a2209be-bca7-4fec-b5a6-8bf50738c883_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6929fd587f3ce94f533c70276700b7dffe598b5c6dbf24dc4eb8123266b973ea
+size 480575
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/full.md b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..deb1e7acdadb965ca1339d2177bc5b2a2d30f847
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/full.md
@@ -0,0 +1,247 @@
+# Connecting Compression Spaces with Transformer for Approximate Nearest Neighbor Search
+
+Haokui Zhang $^{1,2}$ , Buzhou Tang $^{*2}$ , Wenze Hu $^{1}$ , and Xiaoyu Wang $^{1}$
+
+1 Intellifusion, Shenzhen, China
+hkzhang1991@mail.nwpu.edu.cn, windsor.hwu@gmail.com, fanghuaxue@gmail.com
+2 Harbin Institute of Technology (Shenzhen), Shenzhen, China
+tangbuzhou@hit.edu.cn
+
+Abstract. We propose a generic feature compression method for Approximate Nearest Neighbor Search (ANNS) problems, which speeds up existing ANNS methods in a plug-and-play manner. Specifically, based on transformer, we propose a new network structure to compress the feature into a low dimensional space, and an inhomogeneous neighborhood relationship preserving (INRP) loss that aims to maintain high search accuracy. Specifically, we use multiple compression projections to cast the feature into many low dimensional spaces, and then use transformer to globally optimize these projections such that the features are well compressed following the guidance from our loss function. The loss function is designed to assign high weights on point pairs that are close in original feature space, and keep their distances in projected space. Keeping these distances helps maintain the eventual top-k retrieval accuracy, and down weighting others creates room for feature compression. In experiments, we run our compression method on public datasets, and use the compressed features in graph based, product quantization and scalar quantization based ANNS solutions. Experimental results show that our compression method can significantly improve the efficiency of these methods while preserves or even improves search accuracy, suggesting its broad potential impact on real world applications. Source code is available at https://github.com/hkzhang91/CCST
+
+Keywords: Approximate nearest neighbor search; transformer; neighborhood relationship preserving; compression projections; retrieval
+
+# 1 Introduction
+
+Approximate nearest neighbor search (ANNS) methods focus on searching for $k$ approximate nearest neighbors from a given database to a given query node $q$ . It is a fundamental technology in information retrieval and is widely used in applications such as search engines and recommendation systems. The common goal of ANNS approaches is to minimize the search latency while maintain a low search accuracy loss on a fixed hardware constraint.
+
+As stated in [1], currently, the two most popular ANNS methods are graph based approaches and quantization based approaches. Many of these methods, such as product quantization (PQ) [2], HNSW [3] and NSG [4] are widely used in real-world applications. Although popular, there are rooms to further improve them. In PQ, the sub vectors are quantized into codewords using a clustering objective, which is a poor proxy to search accuracy. In graph based methods, there are a large number of distance computations in index building time (for instance, indexing complexity NSG graph is $O(kn^{\frac{1 + d}{d}}\log n^{\frac{1}{d}} + n\log n)$ [4], where $d$ is data dimension), which in real world applications can last weeks on billion scale datasets. For PQ related methods, introducing the feature compression as an intermediate step avoids direct feature quantization from high dimensional space. Such a two stage quantization strategy usually results in higher accuracy. For graph based methods, computing distance in low dimensional space reduces computational cost linearly, which significantly speeds up indexing.
+
+Existing feature compression methods such as principal components analysis (PCA) [5], Variational Auto-Encoders(VAE) [6] focus on keeping the information in the input features instead of their neighborhood relations, but in ANNS applications the neighborhood structure affects the eventual accuracy more than the locations of the individual data points themselves. As is shown in experiments, directly applying these methods lead to significantly reduced search accuracy, which is not suitable for applications requiring both high speed and high recall.
+
+In this paper, we propose a feature compression method for the approximate nearest neighbor search problem, which aims to retain the local neighborhood relations instead of the fidelity of the reconstructed features. Our method is composed of a compression network which connect compression spaces with transformer (CCST), and an inhomogeneous neighborhood relationship preserving (INRP) loss.
+
+Our CCST is a combination of projection units that projects original features to low dimensions, and transformer units that compose these projections to generate the output feature. The projection unit is initialized as sparse random projection (SRP) [7], which is proved by JL (Johnson-Lindenstrauss) lemma that this projection reserves distances of an increasing number of data points with decreasing dimension reduction ratios. We design our network with multiple projections units, so that each can be used to compress a local neighborhood, and the entire space can be covered in a piece-wise manner by the ensemble of these units. We then use transformers to adaptively combine the output of these random projection units, because the transformer unit has the well known property of globally attending its inputs, which could lead to better global alignment of these projections. In other words, multiple compression spaces are connected to one via transformer. Different from standard transformer based networks, we design an input dependent, non-trivial output token named compression token, which is itself a compressed feature derived from the input feature, and is updated by the transformer layers with skip connections. The compression token is designed to provide an anchor vector to the multi-head attention units so that
+
+transformers properly mix the output of random projection units to generate the output compressed feature.
+
+Our training loss is designed for the purpose of preserving local neighborhood structures. In most ANNS applications, user is mostly interested in the accuracy of the top few nearest neighbors. So, changes in the distances between a query and its far away points will not affect the search result, as long as their distances are still large. Inspired by this property in ANNS problems, we design the INRP loss, which assigns high losses on point pairs whose distances are within a threshold. This loss design allows certain information of the original feature to be discarded while still maintaining high retrieval accuracy.
+
+Our experiments show that our feature compression model can be seamlessly used with popular ANNS methods. While saving 1/2 to 3/4 indexing time, graphs built using our compressed features can improve the recall slightly for HNSW and NSG methods. It also significantly improves recalls of 1@1 and recalls of 1@5 metrics by more than 10.0 percentage points for PQ based methods, and about 1.0 or 2.0 percentage points for a quantization methods tailored to HNSW methods [8].
+
+Our main contributions are summarized as follows.
+
+1. We propose a novel feature vector compression model CCST for ANNS problem. In CCST, traditional projection based compression units and emerging transformer units are jointly used to compress features for ANNS problems. To our knowledge, this is the first attempt to apply transformer to ANNS.
+2. We propose an INRP loss that mainly keeps the distances of a point and its close local neighbors. This maintains top $k$ retrieval accuracy and creates space for lossy feature compression.
+3. The experiment results show that our proposed method can be used in most ANNS methods to improve efficiency. It speeds up indexing speed to $2 \times$ to $4 \times$ for graph based methods and it improves recalls significantly for PQ related methods.
+
+# 2 Related Work
+
+# 2.1 ANNS methods
+
+Existing ANNS approaches can be divided into four main types: 1) tree-structure based strategies [9], which partitions indexed datapoints into different subspaces based on specific conditions; 2) Locality sensitive hashing (LSH) related methods, which map similar items to the same symbol with a high probability [10]; 3) product quantization (PQ) related approaches decompose the space into a Cartesian product of low dimensional subspaces and quantize each subspace separately [2]; 4) graph based frameworks search on pre-built relative neighborhood graphs (RNG) to find the closest data points to query [3]. Compared with PQ and graph based methods, tree based and LSH based methods need ensembles of trees or hash tables to achieve similar accuracy, which consume considerably more memory and are less frequently used in large scale ANNS problems.
+
+Product quantization based approach reduces the index memory cost by holding quantized codes and speeds up distance computation using online or offline computed distance look up tables. When combined with inverted index to further reduce the number of distance computations, PQ becomes a strong baseline for modern ANNS systems. Compared with quantization based approach, which partitions original feature space to generate shorter features, our method directly maps the original features into a new space. These two methods are orthogonal. As is shown in experiments, the new space can be further quantized by PQ, which generates even better speed and accuracy trade-offs than using PQ method alone.
+
+Graph based algorithms usually construct a navigable graph over database, and searches along the edges of this built graph to find the closest points to query. The most recent works in this category are NSG [4], HNSW [3], Disk-ANN [1] and HM-ANN [11]. NSG builds a relatively sparse indexing graph to reduce memory usage and improve search speed. HNSW employs hierarchical graph structure to reduce query latency. Disk-ANN and HM-ANN focus on reducing memory overhead via adopting quantization and heterogeneous memory. Besides, Douze et al. proposed Link and Code (L&C), which takes HNSW as basic ANNS framework and replaces full precision vectors with refined quantization codes [8]. Compared with brute force, these graph based methods visit 1/1000 or even less of the indexed points in each search, significantly reduce the number of needed distance computations. However, most of these methods suffer from the problem of high indexing time, as constructing a navigable graph over database has high time complexity. For instance, $O(n \log n)$ for HNSW and $O(kn^{\frac{1 + d}{d}} \log n^{\frac{1}{d}} + n \log n)$ for NSG. In real world application, building a navigable graph over a billion-scale database with $30+$ threads costs several days or even weeks.
+
+# 2.2 Dimension reduction / compression
+
+In early stage, almost all dimension reduction methods are based on mathematical theory. PCA [5] and independent components analysis (ICA) [12] are proposed to transform vectors into lower dimensional space, where the most information of high dimension vectors are retained. Random projection [13][7] project data into low dimensional space, while approximately preserving structure information in original feature space. The efficiency of random projection methods is guaranteed by Johnson-Lindenstrauss (JL) lemma [14]. This lemma states that data points in sufficiently high dimensional space may be projected into suitable low dimensional space while approximately preserving the distances between the points in original space.
+
+In 2006, Hinton and Salakhutdinov proposed to compress high dimensional data via neural network [15], and several recent works on dimension reduction have shifted their methods to neural networks. For example, VAE maps data to low dimensional space and forces the encoded features to follow a multivariate Gaussian distribution [6].
+
+
+Fig. 1. Overview of the CCST model. The proposed model consists of three major parts, including compression part, projection part and global optimization part. The projection part projects input vectors into multiple subspaces and outputs a sequence of sub vectors. Global optimization part optimizes the sequence of sub vectors from global perspective and summarizes all optimized information into compression token. Compression part provides initial the compression token, and interacts with global optimization part to generate the final compression result.
+
+Very recently, Sablayrolles et al. [16] proposed an end-to-end quantization model for similarity search, where a compression network named catalyst is designed and trained to compress vectors from $d_{in}$ -dimensional input space to the hypersphere of a $d_{out}$ -dimensional space, where $d_{in} > d_{out}$ . Our proposed CCST is close to this work, as it involves an ANNS oriented loss and a learnable network to compress feature vectors. Compared with catalyst, our training objective is easier to implement as it does not involve offline exhaustive search for positive and negative pairs. Also, we design a deep compression model for the ANNS problem, where [16] uses multi-layer perceptrons to demonstrate their entropy maximization idea.
+
+# 2.3 Transformer
+
+Vaswani et al. first proposed the transformer architecture for the task of language modelling in [17]. Inspired by the promising performance of transformer, several works started to introduce transformer into vision tasks and proposed a new type of models. Dosovitskiy et.al proposed ViT, in which the input image is cropped into a sequence of patches to meet the input format requirement of transformer [18]. Later, Touvron et al. proposed to use knowledge distillation to overcome the difficulties of training ViT models [19]. Liu et al. proposed a hierarchical transformer, where representation is computed within shifted windows [20] to reduce computation cost. Very recently, Graham et al. mixed CNN and transformer in their LeViT model, which significantly outperforms previous CNNs and ViT models with respect to the speed/accuracy tradeoff [21].
+
+The transformer part of our CCST model is inspired by the works above. We have made several modifications to better fit transformer with our applications, which are detailed in section global optimization part.
+
+# 3 The Proposed Approach
+
+In this section, we present our proposed method in detail. We first introduce the architecture of CCST. Then we elaborate on our INRP loss function.
+
+# 3.1 CCST
+
+As illustrated in Fig. 1, the proposed CCST consists of three major parts, including projection part, global optimization part and compression part.
+
+The projection part casts the input feature vector $x \in \mathbb{R}^{d_{in}}$ to $n$ different low dimensional spaces. The output of this part is a sequence of low dimensional vectors $[p^1(x), p^2(x), \dots, p^n(x)]$ , where $p^i(x) \in \mathbb{R}^{d_{out}}, i = 1, \dots, n$ . $d_{in}$ and $d_{out}$ denote feature dimensions before and after compression, respectively. In addition, note that $[p^1(x), p^2(x), \dots, p^n(x)]$ constructs a $n$ by $d_{out}$ matrix instead of a $n \cdot d_{out}$ dimensional vector. It is a sequence of tokens as the input to transformers instead of a concatenated vector. $p^i()$ is a compression projection function. $p^i(x) = W^i x$ , where $W^i \in \mathbb{R}^{d_{in} \times d_{out}}$ . The global optimization part takes $[cp(x), p^1(x), p^2(x), \dots, p^n(x)]$ as input and globally optimizes all sub vectors step by step. The global optimization part then summarizes all optimized sub vectors into a compression token $cp(x)$ . The compression part is responsible for initializing the compression token, interacting with global optimization part in each step and further processes the information in compression token to generate the final compression result $f(x) \in \mathbb{R}^{d_{out}}$ .
+
+Projection part Our goal is compressing feature vectors into a low dimensional space, where the data neighborhood relation in original space is preserved. It seems that random projections satisfy our requirement and there are already some classical random projection methods. Unfortunately, according to JL lemma [14], the projection error of using single random projection function satisfies:
+
+$$
+(1 - \epsilon) \| x _ {i} - x _ {j} \| _ {2} ^ {2} \leq \| p (x _ {i}) - p (x _ {j}) \| _ {2} ^ {2} \leq (1 + \epsilon) \| x _ {i} - x _ {j} \| _ {2} ^ {2} \tag {1}
+$$
+
+where $x_{i}$ and $x_{j}$ represent two data points in high dimensional space and $p(x_{i})$ and $p(x_{j})$ are corresponding projection data points in low dimensional space. $p()$ is the projection function. $\epsilon$ satisfies equation $d_{out} > \frac{4\ln(m)}{\epsilon^2 / 2 - \epsilon^3 / 3}$ , where $0 < \epsilon < 1$ and $m$ represents data size. Random projections are inapplicable in our case. For example, if compressing 960 dimensional vectors in GIST1M dataset to 480 dimensions, we have $0.63 < \epsilon < 1$ . In GIST1M, the distance of a query to its nearest neighbor and to its hundredth neighbor are probably 1.177 and 1.5615, respectively. After projection, with the minimum $\epsilon$ , the distance of a query to its nearest neighbor and to its hundredth neighbor fall into the scope of [0.7160, 1.5027] and the scope of [0.9498, 1.9936], respectively. These two scopes have a considerable overlap, which may disturb neighborhood relationship and lead to a lower search accuracy. We can draw a consistent conclusion from our experimental results.
+
+
+Fig. 2. Different modules. (a) Transformer module of ViT [18]. (b) Transformer module proposed in this paper. By adopting lightweight designs, transformer module in (b) has fewer parameters than that in (a).
+
+Existing random projection methods do not address our problem directly, but they give us some inspirations. Here, we propose to use $n$ different projections to boost compression accuracy. Specifically, we initialize the $n$ projection matrices in $p^i(x) = W_i x$ ( $i = 1, 2, \dots, n$ ) on input $x \in \mathbb{R}^{d_{in}}$ to generate a sequence of features $[p^1(x), p^2(x), \dots, p^n(x)]$ . Following [7], the elements in $W_i$ are randomly drawn from:
+
+$$
+\left\{ \begin{array}{c} - \sqrt {\frac {s}{d _ {o u t}}} \text {w i t h p r o b a b i l i t y} 1 / 2 s, \\ 0 \text {w i t h p r o b a b i l i t y} 1 - 1 / s \\ \sqrt {\frac {s}{d _ {o u t}}} \text {w i t h p r o b a b i l i t y} 1 / 2 s \end{array} \right. \tag {2}
+$$
+
+where $s = \sqrt{d_i n}$ . Different from traditional random projections, projection matrices used in here will be further optimized by our INRP loss.
+
+Global optimization part The projection part outputs a sequence of low dimensional vectors, which brings in the core problem of this global optimization part, that is how to generate the result compressed feature using these features from different sub spaces.
+
+Here, as the problem that we need to solve is exactly what transformer model is good at, we tailor a transformer model to overcome the core problem. One biggest advantage of transformer is it good at capturing and taking use of relationships between different tokens to get a global optimization result. When we treat features from different sub spaces as different tokens, our core problem becomes optimizing a sequence of tokens from the global perspective. So, based on ViT [18] structure, we propose a new transformer model for feature compression.
+
+Based on the characteristics of our compression problem, we have made four major modifications to the original ViT structure, including two structural modifications and two lightweight designs.
+
+Structural modifications ensure the new proposed transformer structure is aligned with our problem. These two modifications are:
+
+1. Discard position embedding. In transformer models for processing sentences or images, position embedding and relative position embedding are widely used, as the order of words and the positions or relative positions of images patches contain important information. However, in our case, the order of random projections is fixed. Naturally, position embedding is discarded in our transformer model. Interestingly, when we add position embedding into our transformer, the search accuracy drops. We conjecture this is because randomly initialized position coding disturbs our model.
+2. Add compression token. In our transformer model, an extra token named compression token is used. Structurally, this design is similar to the transformer model in ViT, where an extra token named classification token is also employed. Compression token and classification token are added for different purposes and they have different functions. Compression token provides a base reference for optimizing and summarizing information from different projection spaces and it also works as a bridge between compression part and global optimization part. Classification token is used as a placeholder to perform classification. Different from classification token, which is a learned constant, our compression token is derived from input feature vector. Initializing compression token with random numbers is not in accordance with its role of working as base reference.
+
+Lightweight designs are adopted to reduce the number of learnable parameters. Fig. 2 shows lightweight designs for MLP and attention parts are:
+
+1. In MLP part, we decrease the expansion ratio (changes among widths of the adjacent linear mapping layers) from 4 to 2 to reduce the number of parameters by half, as shown in the bottom half of Fig. 2 (b). In addition, the basic computing unit in our model is Linear_ABN, which, in data processing order, consists of a linear mapping layer, activation function and batch normalization. As pointed out in [22], placing batch normalization layer before ReLU leads to the conv layer updated in a suboptimal way due to the nonnegative responses of activation function. So we design our unit following the order of $\mathrm{conv}\rightarrow \mathrm{activation}\rightarrow \mathrm{bn}$ . This order is also recommended in [23].
+
+2. Attention part has three intermediate variables, which are represented as Value $(V)$ , Query $(Q)$ and Key $(K)$ . The output of head $i$ is calculated as:
+
+$$
+\operatorname {h e a d} _ {i} (Q, K, V) = \operatorname {s o f t m a x} (\frac {Q W _ {i} ^ {Q} \cdot K W _ {i} ^ {K ^ {T}}}{\sqrt {d}}) V W _ {i} ^ {V} \qquad (3)
+$$
+
+where $W_{i}^{Q}, W_{i}^{K}$ and $W_{i}^{V}$ are three projection matrices. As in Eqn. 3, V stores main information, $Q$ and $K$ are used to generate attention weights. In ViT, $Q, K$ and $V$ are all the same in each head. Inspired by [17], we decrease the dimension of $Q$ and $K$ for reducing parameters of $W_{i}^{K}$ and $W_{i}^{V}$ .
+
+
+Fig. 3. The weight curve of INRP loss. $d_{ij}$ is Euclidean distance between $x_i$ and $x_j$ .
+
+
+
+Structurally, as shown in the middle part of Fig. 1, global optimization part consists of $s$ stages, each of which has $N_{i}$ transformer encoders. From stage 1 to $s - 1$ , projected vector from compression part is added to compression token at the end of each stage. Finally, $cp(x)$ is from the output of last stage is fed back to compression part to generate the final compression result.
+
+Compression part The compression part is responsible for providing initial compression token, interacting with global optimization part in each step and generating the final compression result. Corresponding to three responsibilities three learnable modules are constructed. As shown in the top part of Fig. 1, three modules are a compression module and two linear projection modules.
+
+The compression module is made up of a single Linear_ABN module. Each linear projection module has a linear mapping function. Compression module takes $x \in \mathbb{R}^{d_{in}}$ as input and outputs $cp(x) \in \mathbb{R}^{d_{out}}$ . Linear projection $A$ maps input $x \in \mathbb{R}^{d_{in}}$ to $d_{out}$ -dimensional vector, which is added to compression tokens of global optimization part. Linear projection $B$ takes compression token from the last stage of global optimization part as input and output the final compression result.
+
+# 3.2 INRP loss
+
+To preserve neighborhood structures, a straightforward way is training the network to keep distances between all possible point pairs. However, the goal of ANNS is searching for top $k$ approximate nearest neighbors to a query point, which generally are points that are close to query point in the original space. In other words, focusing on keeping distances between close pairs is more important, as these pairs affect search result the most. In [24], Guo et al. presented a similar idea, which is proposed for quantization instead of compression. Inspired by this, we design our INRP loss, the formula of which is:
+
+$$
+l o s s = \frac {1}{m ^ {2}} \sum_ {i = 1} ^ {m} \sum_ {j = 1} ^ {m} w _ {i j} \cdot \| \| f (x _ {i}) - f (x _ {j}) \| _ {2} - \| x _ {i} - x _ {j} \| _ {2} \| _ {2} \tag {4}
+$$
+
+where $x_{i}$ and $x_{j}$ are a pair of any two nodes from original space. $m$ denotes data size. $f(x_{i})$ and $f(x_{j})$ are compression results. $w_{ij}$ is weight for this pair and it is calculated as:
+
+$$
+w _ {i j} = \min (\alpha , \max (\beta , - \ln (\frac {d _ {i j}}{\text {b o u n d a r y}}))) \tag {5}
+$$
+
+where $d_{ij} = ||x_i - x_j||_2$ . $\alpha$ and $\beta$ are two hyper-parameters, which are set to 2.0 and 0.01 respectively. boundary denotes the average distance between any two nodes in original space. The curve is shown in Fig. 3. In implementation, we use all pairs inside a mini-batch to approximate Eqn.4, which significantly simplifies computation.
+
+# 4 Experiments
+
+# 4.1 Datasets and implementation details
+
+Datasest We carry out experiments on two million-scale benchmark datasets GIST1M and Deep1M $^{3}$ . GIST1M consists of 1 million of 960-dimensional handcrafted feature vectors, which are extracted from images with GIST descriptors [25]. Deep1M contains 1 million of 256-dimensional deep feature vectors, which are extracted by using GoogleNet [26].
+
+Training setting Following [27][28], we take database as training set. We train our model for 2400 epochs with the Adamw optimzier [29], where the initial learning rate and batch size are set to 1e-4 and 1024 respectively. We use poly learning rate policy with power of 0.9 to adjust the learning rate for every epoch. Just like other deep learning models, training CCST is time consuming. With a single RTX2080Ti GPU, training costs about half a day. However in practice, the trained model will be used to process huge amount of data. In Bigann-1B, indexing the 1 billion data saves 54 hours, which already pays off.
+
+Platforms We implement our CSST using Pytorch and conduct ANNS experiments based on Faisss4.
+
+# 4.2 Speeding up indexing for graph-based methods
+
+Here, we focus on using our proposed CSST to speed up indexing of graph-based methods. Two most popular graph-based methods HNSW [3] and NSG [4] are employed as baselines. We construct all HNSW indices with $M = 48$ , efConstruction=512, and perform search with efSearch=100 on GIST1M and efSearch=200 on Deep1M. Following [4][1], we build all NSG indices using $R = 60$ , $L = 70$ and $C = 500$ and initialize K-NN graphs with NN-descent. On GIST1M, we initialize K-NN graph using $\mathrm{GK} = 400$ , $L = 400$ , iter=12, $S = 15$ and $R = 100$ . On Deep1M, we initialize K-NN graph using $\mathrm{GK} = 200$ , $L = 200$ , iter=10, $S = 12$ and $R = 100$ .
+
+Table 1. Experiments of speeding up indexing for graph based methods. C_F represents the feature compression factor. IND and SS denote indexing time and search speed. q/s is query per second. Experiments are performed on a server with two Xeon Gold 5218 CPUs. We build indices with 32 threads and perform search with a single thread. All the speed numbers are averaged from 20 cold runs to rule out random factors. Comp_t is encoding time. Here, a single RTX2080Ti GPU is used for accelerating compressing process and the GPU memory usage is restricted to about 1GB.
+
+| C.F | Methods | Comp_tGPU (s) (G) |
| HNSW | NSG |
| IND SS (s) (q/s) | Recall 1@1 1@10 100@100 | IND SS (s) (q/s) | Recall 1@1 1@10 100@100 |
| GIST1M |
| 1 | 733 182 | 97.40 100.00 | 94.39 | 1118 | 179 | 97.40 100.00 | 93.97 | - | - | |
| 2 | 454 184 | 97.70 100.00 | 94.55 | 778 | 180 | 98.00 99.90 | 94.16 | 21.43 | 1.19 | |
| 4 | 245 186 | 98.00 100.00 | 95.27 | 645 | 182 | 98.30 100.00 | 94.85 | 10.00 | 1.17 | |
| Deep1M |
| 1 | 300 861 | 99.50 100.00 | 95.23 | 505 | 820 | 99.7 100.00 | 94.53 | - | - | |
| 2 | 144 870 | 99.50 100.00 | 95.46 | 246 | 822 | 99.6 100.00 | 94.69 | 5.15 | 1.09 | |
| 4 | 100 874 | 99.80 100.00 | 95.60 | 209 | 842 | 99.6 100.00 | 94.92 | 4.64 | 1.06 | |
+
+Table 2. Experiments of speeding up indexing for real world database and billion-scale database. Deepfeat25M is a subset of our internal 1 billion 512-d dataset.
+
+| Datasets | C_factor | indexing time(h) | Recall 1@1 | Compressing time (h) | GPU usage(G) |
| Deepfeat25M | 1 | 15.1 | 95.4 | - | - |
| 2 | 9.5 | 95.1 | 0.18 | 1.32 |
| Bigann-1B | 1 | 106 | 92.6 | - | - |
| 2 | 51 | 92.8 | 1.01 | 1.24 |
+
+We conduct three groups of experiments with different compression ratios. In all three groups, full-dimensional vectors are used to search nearest neighbors. Full-dimensional vectors, feature vectors compressed with a factor of 2 and 4 are respectively used in indexing. Experiment results listed in Table 1 show that using compressed features triples indexing speed for HNSW and doubles indexing speed for NSG. Taking experiments based on HNSW as an example, using compressed features reduce indexing time from 733 seconds to 454 seconds and 245 seconds for GIST1M dataset and decreases indexing time from 300 seconds to 144 and 100 seconds for Deep1M. Results on NSG show similar trends.
+
+Interestingly, using compression feature vectors slightly improves search accuracy. For instance, on GIST1M, using $4 \times$ -compressed vectors improves recall of 1@1 to $98.00\%$ and improves recall of 100@100 to 95.60, 0.5 and 0.37 percentage points higher than that of baseline respectively. We conjecture this is due to that using compressed feature vectors to build index introduces some extra links
+
+Table 3. Fusion experiments. Bytes denotes the size of quantized feature vectors. Comp. and Quant. represent compression and quantization methods, respectively. Following default settings in their source code, we conduct experiments on L&C [8], except that the M of coder is set to 8 (This gets highest accuracy.). For PQ experiments, we adopt IVFADC (nlist=8) to avoid exhaustive search.
+
+| Datasets | Bytes | Comp. | ANNS | Speed (q/s) | 1@1 | Recall 1@5 | 1@50 |
| GIST1M | 60 | - | PQ | 115 | 23.0 | 45.2 | 79.7 |
| 60 | CSST | PQ | 117 | 39.5(16.5↑) | 72.8(27.6↑) | 97.3(17.6↑) |
| 60 | - | L&C | 1536 | 31.4 | 48.9 | 54.2 |
| 60 | CSST | L&C | 1527 | 30.7(0.7↓) | 50.2(1.3↑) | 55.1(0.9↑) |
| 30 | - | PQ | 246 | 15.2 | 31.0 | 62.4 |
| 30 | CSST | PQ | 251 | 20.9(5.7↑) | 43.4(12.4↑) | 79.7(17.3↑) |
| 30 | - | L&C | 2000 | 23.6 | 43.0 | 53.9 |
| 30 | CSST | L&C | 1992 | 23.9(0.3↑) | 43.9(0.9↑) | 54.3(0.4↑) |
| Deep1M | 32 | - | PQ | 236 | 32.3 | 67.5 | 95.9 |
| 32 | CSST | PQ | 240 | 53.3(21.0↑) | 88.5(21.0↑) | 100.0(4.1↑) |
| 32 | - | L&C | 2000 | 47.9 | 72.3 | 76.4 |
| 32 | CSST | L&C | 2020 | 48.7(0.9↑) | 74.1(1.8↑) | 78.3(1.9↑) |
| 16 | - | PQ | 520 | 16.8 | 38.6 | 73.6 |
| 16 | Catalyst | PQ | 545 | 19.8(3.0↑) | 47.9(9.3↑) | 82.5(8.9↑) |
| 16 | CSST | PQ | 537 | 32.5(15.7↑) | 65.6(27.0↑) | 94.4(20.8↑) |
| 16 | - | L&C | 2677 | 28.8 | 55.6 | 71.6 |
| 16 | CSST | L&C | 2676 | 29.2(0.4↑) | 56.9(1.3↑) | 73.7(2.1↑) |
+
+and these links improves search accuracy, just like extra links selected by select neighbors heuristic improves the accuracy of HNSW [3].
+
+Note that the speedup is scalable to larger datasets. As shown in Table 2, for Bigann-1B $^5$ (1 billion 128-d hand drafted features), using our features reduces indexing time from 106 hours to 51 hours; On our internal dataset Deepfeat25M, comparison results show similar trend.
+
+# 4.3 Improving accuracy and speed for PQ related methods
+
+Besides graph-based methods, PQ related methods are also very popular in real world applications. As quantization and dimension compression are orthogonal at the method level, we conjecture that our proposed CSST can be applied on PQ related methods to achieve higher accuracy. In this section, we conduct fusion experiments to verify this point. Specifically, we fuse our proposed CSST with the classical PQ [2] and most recent proposed L&C [8]. In addition, as the inspirational method catalyst [16] is close to our method in training networks to compress feature dimension, we compare our proposed model with catalyst on Deep1M, the dataset which is used in both this paper and their paper. Experiment results are listed in Table 3.
+
+Table 4. Ablation study on lightweight designs on GIST1M ( $d_{in} = 960$ ). C_F, k/s and GPU denote compression factor, thousand feature vectors per second and the peak GPU memory usage during encoding. Queries are batch-processed, where batch size is set to 512 or 1024 according to GPU GPU memory usage. # param. is the number of learnable parameters in model. GPU adopted here is RTX2080Ti.
+
+| C_F d_out | Light # param. | HNSW | encoding info |
| designs | (M) | R1@1 | R100@100 | time (s) speed (k/s) | GPU(G) |
| 2 | 480 | Y | 10.4 | 97.70 | 94.55 | 21.43 | 46.66 |
| 2 | 480 | N | 15.9 | 97.70 | 94.57 | 35.21 | 28.40 |
| 4 | 240 | Y | 4.7 | 98.00 | 95.27 | 10.00 | 100.00 |
| 4 | 240 | N | 6.1 | 97.98 | 95.27 | 14.12 | 70.82 |
+
+Table 5. Ablation study on random projection initialization (RP init) and the proposed INPR loss, using GIST1M dataset.
+
+| Settings | None | RP init | INPR loss | RP init and INPR loss |
| Recall | 1@1 | 76.1 | 77.9 | 78.5 | 80.1 |
| 1@5 | 94.3 | 96.1 | 97.2 | 98.4 |
+
+Experiment results show that using compressed feature learned by our proposed CSST improves both search accuracy and speed for PQ related methods. On Deep1M, in experiments of quantizing feature vectors to 32 bytes, combining CSST with PQ improves recalls 1@1, 1@5 and 1@50 by 21.0, 21.0 and 4.1 percentage points respectively. Our proposed CSST also brings more improvement than Catalyst. In experiments of coding input vectors with 16 bytes, using Catalyst improves recalls 1@1 and 1@5 by 3.0 and 9.3 percentage points and our proposed CSST improves recalls by 11.7 and 27 percentage points.
+
+Using CSST also improves search accuracy for L&C, but the improvements CSST brings in here are less than that in PQ. This may result from that 2-level residual codec already optimized PQ quantized codes once and there is less room for improvement. Overall, CSST still improves search accuracy for L&C, while keeping high search speed.
+
+# 4.4 Ablation study
+
+In this section, we conduct ablation study experiments on lightweight designs, random projection initialization and the proposed INPR loss. Experimental results are listed in Tables 4 and 5. From results in Table 4, we can see that lightweight designs improve encoding speed and save GPU usage without sacrificing accuracy. Results in Table 5 show that using random projection units to initialize projection matrices and adopting the proposed INPR loss are beneficial for final accuracy. The best accuracy is achieved by employing both.
+
+Table 6. Comparison experiments. Compression factor $= 4$ .
+
+| Methods | GIST1M | Deep1M |
| HNSW | Brute force | HNSW | Brute force |
| 1@1 | 1@5 | 1@10 | 1@1 | 1@5 | 1@10 | 1@1 | 1@5 | 1@10 | 1@1 | 1@5 | 1@10 |
| SRP | 24.9 | 49.4 | 60.7 | 24.8 | 49.7 | 60.9 | 17.3 | 35.6 | 44.4 | 17.3 | 35.6 | 44.4 |
| MLP | 47.9 | 73.8 | 84.2 | 47.9 | 73.8 | 84.1 | 48.3 | 77.6 | 89.1 | 48.4 | 77.6 | 88.9 |
| VAE | 49.2 | 77.0 | 86.0 | 49.3 | 76.8 | 85.8 | 50.0 | 81.9 | 90.2 | 50.0 | 81.9 | 90.2 |
| Catalyst | | - | - | - | - | - | 57.9 | 89.6 | 92.1 | 57.9 | 89.6 | 92.1 |
| CSST | 80.1 | 98.4 | 99.8 | 80.9 | 98.3 | 99.7 | 67.3 | 94.9 | 98.9 | 67.3 | 94.9 | 98.9 |
+
+# 4.5 Comparison with other compression methods
+
+Previous experiments have shown that using compression feature vectors learned by our proposed CSST speeds up indexing without sacrificing accuracy. Besides our CSST, there are other compression methods. In this section, we compare the proposed models with other methods to evaluate its efficiency.
+
+Here, we employed five comparison methods, including one traditional methods and four network based learning methods. Table 6 presents comparison results. Compared with other four compression methods, our proposed CSST achieves the highest accuracy. For GIST1M, using CSST and HNSW achieves $80.1\%$ recall 1@1, 30.9 percentage points higher that that of VAE. As is analysed in the section the proposed method, using single sparse random projection harms search accuracy seriously. Both VAE is classical and powerful compression method, but it focus on keeping information of the input feature instead of keeping the neighborhood structure, which is not aligned with the requirement of ANNS. They are outperformed by our proposed CSST. On Deep1M, the proposed CSST also achieves better performance, even compared with the most recent proposed method Catalyst.
+
+# 5 Discussion
+
+In this work, we have proposed a generic feature compression method for ANNS problem. The proposed method consists of a compression network (CSST) which combines traditional projection function and transformer model, and an inhomogeneous neighborhood relationship preserving (INRP) loss which is aligned with the characteristic of ANNS. The proposed method can be generalized to most ANNS methods. It speeds up indexing speed to $2 \times$ to $4 \times$ its original speed without hurting accuracy for graph based methods. It improves recalls by several or even a dozen percentage points for PQ related methods.
+
+# Acknowledgements
+
+B. Tang's participation was in part supported by the National Natural Science Foundations of China (U1813215)
+
+# References
+
+1. Subramanya, S.J., Kadekodi, R., Krishaswamy, R., Simhadri, H.V.: Diskann: Fast accurate billion-point nearest neighbor search on a single node. In: Proceedings of the 33rd International Conference on Neural Information Processing Systems. (2019) 13766-13776
+2. Jegou, H., Douze, M., Schmid, C.: Product quantization for nearest neighbor search. IEEE transactions on pattern analysis and machine intelligence 33(1) (2010) 117-128
+3. Malkov, Y.A., Yashunin, D.A.: Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. IEEE transactions on pattern analysis and machine intelligence 42(4) (2018) 824-836
+4. Fu, C., Xiang, C., Wang, C., Cai, D.: Fast approximate nearest neighbor search with the navigating spreading-out graph. arXiv preprint arXiv:1707.00143 (2017)
+5. Wold, S., Esbensen, K., Geladi, P.: Principal component analysis. Chemometrics and intelligent laboratory systems 2(1-3) (1987) 37-52
+6. Pu, Y., Gan, Z., Henao, R., Yuan, X., Li, C., Stevens, A., Carin, L.: Variational autoencoder for deep learning of images, labels and captions. Advances in neural information processing systems 29 (2016) 2352-2360
+7. Li, P., Hastie, T.J., Church, K.W.: Very sparse random projections. In: Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining. (2006) 287-296
+8. Douze, M., Sablayrolles, A., Jégou, H.: Link and code: Fast indexing with graphs and compact regression codes. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. (2018) 3646-3654
+9. Silpa-Anan, C., Hartley, R.: Optimised kd-trees for fast image descriptor matching. In: 2008 IEEE Conference on Computer Vision and Pattern Recognition, IEEE (2008) 1-8
+0. Andoni, A., Razenshteyn, I.: Optimal data-dependent hashing for approximate near neighbors. In: Proceedings of the forty-seventh annual ACM symposium on Theory of computing. (2015) 793-801
+1. Ren, J., Zhang, M., Li, D.: Hm-ann: Efficient billion-point nearest neighbor search on heterogeneous memory. Advances in Neural Information Processing Systems (2020)
+2. Hyvarinen, A., Oja, E.: Independent component analysis: algorithms and applications. Neural networks 13(4-5) (2000) 411-430
+3. Achlioptas, D.: Database-friendly random projections: Johnson-lindenstrauss with binary coins. Journal of computer and System Sciences 66(4) (2003) 671-687
+4. Johnson, W.B., Lindenstrauss, J.: Extensions of lipschitz mappings into a hilbert space 26. Contemporary mathematics 26 (1984)
+5. Hinton, G.E., Salakhutdinov, R.R.: Reducing the dimensionality of data with neural networks. science 313(5786) (2006) 504-507
+6. Sablayrolles, A., Douze, M., Schmid, C., Jégou, H.: Spreading vectors for similarity search. In: ICLR. (2019)
+7. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. (2017) 5998-6008
+8. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+
+19. Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., Jégou, H.: Training data-efficient image transformers & distillation through attention. In: International Conference on Machine Learning, PMLR (2021) 10347-10357
+20. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030 (2021)
+21. Graham, B., El-Nouby, A., Touvron, H., Stock, P., Joulin, A., Jégou, H., Douze, M.: Levit: a vision transformer in convnet's clothing for faster inference. arXiv preprint arXiv:2104.01136 (2021)
+22. Chen, G., Chen, P., Shi, Y., Hsieh, C.Y., Liao, B., Zhang, S.: Rethinking the usage of batch normalization and dropout in the training of deep neural networks. arXiv preprint arXiv:1905.05928 (2019)
+23. Zhuang, B., Shen, C., Tan, M., Liu, L., Reid, I.: Structured binary neural networks for accurate image classification and semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2019) 413-422
+24. Guo, R., Sun, P., Lindgren, E., Geng, Q., Simcha, D., Chern, F., Kumar, S.: Accelerating large-scale inference with anisotropic vector quantization. In: International Conference on Machine Learning, PMLR (2020) 3887-3896
+25. Oliva, A., Torralba, A.: Modeling the shape of the scene: A holistic representation of the spatial envelope. International journal of computer vision 42(3) (2001) 145-175
+26. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25 (2012) 1097-1105
+27. Muja, M., Lowe, D.G.: Scalable nearest neighbor algorithms for high dimensional data. IEEE transactions on pattern analysis and machine intelligence 36(11) (2014) 2227-2240
+28. Gong, Y., Lazebnik, S., Gordo, A., Perronnin, F.: Iterative quantization: A procrustean approach to learning binary codes for large-scale image retrieval. IEEE transactions on pattern analysis and machine intelligence 35(12) (2012) 2916-2929
+29. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 (2017)
\ No newline at end of file
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/images.zip b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..0792ebf8a813aac051a7156321b58b70dbf17535
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:64d15c163b80151039afbb52ddc84cd1095fbd5dd13d77b41d2ff287892bc693
+size 388198
diff --git a/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/layout.json b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e6ad330e3c855ab1061e1ce69b5f11e735388f35
--- /dev/null
+++ b/connectingcompressionspaceswithtransformerforapproximatenearestneighborsearch/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a70fd3461e1658bb832d9083c6fdbd8d1c1b4f5c7cc59f7f22f68b0d87e658b
+size 359109
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_content_list.json b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7255d3f9d78625013c8f6758e6ab376dc78ff0b3
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a81bb3965972d02d671d4812961fb4fcc212ba1eb4ead1a8fe4a88f7b37fc588
+size 91415
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_model.json b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..628da924a92b83471f5878769c2730c8e14e7599
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:50213312fddf2ee1025c1858cf7cee35b6865ccf56327f44d377a5906ec4abb7
+size 116484
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_origin.pdf b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5809da6f488bffbbe9fc83d1737db7edaa5ac4f7
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/5d1ed5a4-4ee5-4e25-8d30-1fdb377e9ef0_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1e722f5bfbc25c3d932a34c02d0cd77beeb5ebb4c2a3622f51dc5b8873169337
+size 3582378
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/full.md b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..46f5d08f4484a13c818aee3bb2305e60a2bbf335
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/full.md
@@ -0,0 +1,276 @@
+# Constrained Mean Shift Using Distant Yet Related Neighbors for Representation Learning
+
+K L Navaneet $^{1}$ , Soroush Abbasi Koohpayegani $^{1}$ , Ajinkya Tejankar $^{1}$ , Kossar Pourahmadi $^{1}$ , Akshayvarun Subramanya $^{2}$ , and Hamed Pirsiavash $^{1}$
+
+1 University of California, Davis
+2 University of Maryland, Baltimore County
+
+Abstract. We are interested in representation learning in self-supervised, supervised, and semi-supervised settings. Some recent self-supervised learning methods like mean-shift (MSF) cluster images by pulling the embedding of a query image to be closer to its nearest neighbors (NNs). Since most NNs are close to the query by design, the averaging may not affect the embedding of the query much. On the other hand, far away NNs may not be semantically related to the query. We generalize the mean-shift idea by constraining the search space of NNs using another source of knowledge so that NNs are far from the query while still being semantically related. We show that our method (1) outperforms MSF in SSL setting when the constraint utilizes a different augmentation of an image from the previous epoch, and (2) outperforms PAWS in semi-supervised setting with less training resources when the constraint ensures that the NNs have the same pseudo-label as the query. Our code is available here: https://github.com/UCDvision/CMSF
+
+# 1 Introduction
+
+Recently, we have seen great progress in self-supervised learning (SSL) methods that learn rich representations from unlabeled data. Such methods are important since they do not rely on manual annotation of data, which can be costly, biased, or ambiguous. Hence, SSL representations may perform better than supervised ones in transferring to downstream visual recognition tasks.
+
+Most recent SSL methods, e.g., MoCo [29] and BYOL [27], pull the embedding of a query image to be closer to its own augmentation compared to some other random images. Follow-up works have focused on improving the positive pairs through generating better augmentations [62,51,41] and the negative set by increasing the set size [29] or mining effective samples [35,34,67], but have largely ignored possibility of utilizing additional positive images. More recently, [37,21,5] expand the positive set using nearest neighbors. Inspired by classic mean-shift algorithm, MSF [37] generalizes BYOL to group similar images together. MSF pulls a query image to be close to not only its augmentation, but also the top- $k$ nearest neighbors (NNs) of its augmentation.
+
+
+Fig.1. Accuracy vs. training compute on ImageNet with ResNet50: We report the total training FLOPs for forward and backward passes through the CNN backbone. (Left) Self-supervised: All methods are for 200 epochs. $\mathrm{CMSF}_{\mathrm{self}}$ achieves competitive accuracy with considerably lower compute. (Right) Semi-supervised: Circle radius is proportional to the number of GPUs/TPUs used. The results are on ImageNet with $10\%$ labels. In addition to being compute efficient, CMSF is trained with an order of magnitude lower resources, making it more practical and accessible. * methods use self-supervised pre-training and finetuning on the labeled set.
+
+
+
+We argue that the top- $k$ neighbors are close to the query image by construction and thus may not provide a strong supervision signal. We are interested in choosing far away (non-top) neighbors that are still semantically related to the query image. This cannot be trivially achieved by increasing the number of NNs since the purity of retrieved neighbors decreases with increasing $k$ (See Fig. 4 and Fig. 5). Purity is defined as the percentage of the NNs belonging to the same category as the query image.
+
+We generalize MSF [37] method by simply limiting the NN search to a smaller subset that we believe is reasonably far from the query but still semantically related to it. We define this constraint to be (1) the nearest neighbors of another augmentation of the query in SSL setting and (2) images sharing the same label or pseudo-label as the query in supervised and semi-supervised settings. While we aim to obtain distant samples of the same category, note that we group only a few neighbors ( $k$ in our method) from the constrained subset instead of grouping the whole subset together. This is in contrast to cross-entropy supervised learning, where we pull all images of a category to form a cluster or be on the same side of a hyper-plane. Our method can benefit from this relaxation by preserving the latent structure of the categories and also being robust to noisy labels.
+
+Our experiments show that the method outperforms the various baselines in all three settings with same or less amount of computation in training (refer Fig. 1). It outperforms MSF [37] in SSL, cross-entropy in supervised (with clean or noisy labels), and PAWS [4] in semi-supervised settings. Our main novelty is in developing a simple but effective method for searching for far away but semantically related NNs and in generalizing it to work across the board from self-supervised to semi-supervised and fully supervised settings. To summarize,
+
+1. We propose constrained mean-shift (CMSF), a generalization of MSF [37], to utilize additional sources of knowledge to constrain the NN search space.
+
+
+Fig. 2. Our method (CMSF): We augment an image twice and pass them through online and target encoders followed by $\ell_2$ normalization to get $u$ and $v$ . Mean-shift [37] encourages $v$ to be close to both $u$ and its nearest neighbors (NN). To make NNs diverse, we constrain the NN search space based on additional knowledge in the form of NNs of the previous augmentation in self-supervised setting or the labels or pseudo-labels in semi or fully supervised settings. These constraints encourage the query to be pulled towards semantically related NNs that are farther away from the target embedding. See Fig 3 for constructing the constrained set.
+
+2. We develop methods to select the constraint set in self-, semi- and fully supervised settings. The retrieved samples are empirically shown to be far away in the embedding space but semantically related to the query image, providing a stronger training signal compared to MSF.
+3. CMSF achieves non-trivial gains in performance over self-supervised MSF and a direct extension of MSF to semi-supervised version. CMSF outperforms SOTA methods with comparable compute in self- and semi-supervised settings.
+
+# 2 Method
+
+Similar to MSF [37], given a query image, we are interested in pulling its embedding closer to the mean of the embeddings of its nearest neighbors (NNs). However, since top NNs are close to the target itself, they may not provide a strong supervision signal. On the other hand, far away (non-top) NNs may not be semantically similar to the target image. Hence, we constrain the NN search space to include mostly far away points with high purity. The purity is defined as the percentage of the selected NNs being from the same ground truth category as the query image. We use different constraint selection techniques to analyze our method in supervised, self- and semi-supervised settings.
+
+Following MSF and BYOL, we use two embedding networks: a target encoder $f(.)$ with parameters $\theta_{f}$ and an online encoder $g(.)$ with parameters $\theta_{g}$ . The online encoder is directly updated using backpropagation while the target encoder is updated as a slowly moving average of the online encoder: $\theta_{f}\gets m\theta_{f} + (1 - m)\theta_{g}$ where $m$ is close to 1. We add a predictor head $h(.)$ [27] to the end of the online encoder so that pulling the embeddings together encourages one embedding to be
+
+
+Fig. 3. $\mathbf{CMSF}_{\mathrm{self}}$ : The indices of the NNs of the previous epoch's memory bank $M^{\prime}$ are used to construct the constrained set $C$ from the current memory bank $M$ .
+
+predictable by the other one and not necessarily encouraging the two embeddings to be equal. In the experiments, we use a two-layer MLP for $h(.)$ .
+
+Given a query image $x_{i}$ , we augment it twice with transformations $T_{1}(.)$ and $T_{2}(.)$ , feed them to the two encoders, and normalize them with their $\ell_{2}$ norm to get $u_{i} = \frac{f(T_{1}(x_{i}))}{||f(T_{1}(x_{i}))||_{2}}$ and $v_{i} = \frac{h(g(T_{2}(x_{i})))}{||h(g(T_{2}(x_{i})))||_{2}}$ . We add $u_{i}$ to the memory bank $M$ and remove the oldest entries to maintain a fixed size $M$ . We select the constraint set $C_i$ as a subset of $M$ . Constraint set selection is explained in detail in Sections 2.1, 2.2, and 2.3. We then find the set $S_{i}$ of top- $k$ nearest neighbors of $u_{i}$ in $C_i$ including $u_{i}$ itself. Finally, we update $g(.)$ by minimizing:
+
+$$
+L = \sum_ {i = 1} ^ {n} \frac {1}{| S _ {i} |} \sum_ {z \in S _ {i}} v _ {i} ^ {T} z
+$$
+
+where $n$ is the size of mini-batch and $|S_i|$ is the size of set $S_i$ , e.g., $k$ in top- $k$ . Finally, we update $f(.)$ with the momentum update. In the top-all variation of our method, number of neighbors $k$ is set equal to the size of $C_i$ , i.e., $S_i = C_i$ . Note that since $u_i$ itself is included in the nearest neighbor search, the method will be identical to BYOL [27] when $k = 1$ and to self-supervised mean-shift [37] when the constraint is fully relaxed ( $C_i = M$ ). Our method covers a larger spectrum of algorithms by defining the constrained set. Below we discuss the selection of constrained set in various settings.
+
+# 2.1 Self-Supervised Setting
+
+In addition to $M$ , we maintain a second memory bank $M'$ that is exactly the same as $M$ but contains features from a different $(3^{rd})$ augmentation of the image $x_i$ fed through target encoder $f(.)$ . We assume $w_i \in M'$ and $u_i \in M$ are two embeddings corresponding to the same image $x_i$ . Then, we find NNs of $w_i$ in $M'$ and use their indices to construct the search space $C_i$ from $M$ (See Fig. 3). Note that although the NNs of $w_i$ in $M'$ are already close to each other, their corresponding elements in $M$ may not be close to each other since $M$ contains different augmentations $u_i$ of the same images. As a result, $C_i$ will maintain good purity while containing distant NNs (refer to Table 1-Right and Fig. 5).
+
+Since it is expensive to embed a 3rd augmentation of each image, we embed only two augmentations as in MSF and BYOL and cache the embeddings from
+
+the previous epoch, keeping the most recent embedding for each image. The cached embedding will be still valid after one epoch since the target encoder is updated slowly using the momentum update rule (similar to MoCo). Since cache size is equal to the dataset size, we store it in the CPU memory and maintain the auxiliary memory bank $M'$ by loading the corresponding part of it to the GPU memory for each mini-batch. Caching of features is not essential for CMSF to work and is only used to reduce computational cost. We performed experiments with an actual 3rd augmentation instead and found the results to be similar to our method except that it was nearly $30\%$ slower due to forwarding an additional augmentation. Table 1-Right shows that in the intermediate stages of learning, the top elements of $C_i$ are spread apart in $M$ with higher median ranks, and get closer to the top elements of $M$ as the learning progresses. Note that we use $w_i$ instead of $u_i$ in finding the NNs in $M'$ since both $w_i$ and $M'$ use an older target model, so are more comparable.
+
+Since CMSF adds farther NNs only for stronger supervision, we additionally employ MSF loss calculated on the unconstrained $M$ . Then, in the self-supervised setting, the total loss is an equally weighted sum of MSF and CMSF losses.
+
+Our method can be extended to cross-modal self-supervised setting where the constraint can use NNs in a different modality rather than the 3rd augmentation of the same modality. We report the details and some preliminary experiments on this setting in the supplementary.
+
+# 2.2 Supervised Setting
+
+While supervised setting is not our primary novelty or motivation, we study it to provide more insights into our constrained mean-shift framework. With access to the labels of each image, we can simply construct $C_i$ as the subset of $M$ that shares the same label as the query $x_i$ . This guarantees 100% purity for NNs.
+
+Note that most supervised methods, including cross-entropy loss, try to group all examples of a category together on the same side of a hyper-plane while remaining categories are on the other side. However, our method pulls the target to be close to only those examples of the same category that are already close to the target. This results in a supervised algorithm that may keep the latent structure of each category which can be useful for pre-training on coarse-grained labels. Moreover, as shown in the experiments (Fig. 6), our method is more robust to label noise since most mis-labeled images will be far from the target embedding, thus ignored in learning. This motivates applying our method to semi-supervised setting where the limited supervision provides noisy labels.
+
+# 2.3 Semi-Supervised Setting
+
+In this setting, we assume access to a dataset with a small labeled and a large unlabeled subset. We train a simple classifier using the current embeddings of the labeled data and use the classifier to pseudo-label the unlabeled data. Then, similar to the supervised setting, we construct $C_i$ to be the elements of $M$ that share the pseudo-label with the target embedding. Again, this method
+
+increases the diversity of $C_i$ while maintaining high purity. To keep the purity high, we enforce the constraint only when the pseudo-label is very confident (the probability is above a threshold.) For the samples with non-confident pseudo-label, we relax the constraint resulting in regular MSF loss (i.e., $C_i = M$ ). Moreover to reduce the computational overhead of pseudo-labeling, we cache the embeddings of labeled examples throughout the epoch and train a 2-layer MLP classifier using the frozen cached features and their groundtruth labels in the middle and end of each epoch.
+
+# 3 Experiments
+
+Implementation details: We use PyTorch for all our experiments. Unless specified, we use the same hyper-parameter values in self-, semi- and fully supervised settings. All models are trained on ImageNet-1k (IN-1k) for 200 epochs with ResNet-50 [30] backbone and SGD optimizer (learning rate=0.05, batch size=256, momentum=0.9, and weight decay=1e-4) with cosine scheduling for learning rate. While we focus on single crop setting in most of our experiments, we also report the results for multiple crop inputs in the SSL setting. Following SwAV [11], we use four additional crops of $96x96$ resolution as input. These are used as inputs only to the online encoder and not the target encoder. The momentum value of CMSF for the moving average key encoder is 0.99. The 2-layer MLP architecture for $\mathrm{CMSF}_{\mathrm{semi}}$ is as follows: (linear (2048x4096), batch norm, ReLU, linear (4096x512)). The default memory bank size is 128k. Top- $k$ is set to 10 in the semi- and fully supervised settings and 5 in the self-supervised setting. Additional details are provided in the supplementary. Our main CMSF experiment with 200 epochs takes nearly 6 days on four NVIDIA-2080TI GPUs. The overhead in training time due to NN search is negligible compared to the forward and backward passes through the network (that is also done in BYOL): the increase in time is $0.7\%$ for MSF [37] and $2.1\%$ for $\mathrm{CMSF}_{\mathrm{self}}$ .
+
+Recent SSL methods are usually computationally expensive leading to worse environmental impact and exclusion of smaller research labs. While our experiments are more efficient and accessible than most SOTA methods, e.g., PAWS, we limit our training length to 200 epochs due to resource constraints. We do not empirically verify whether the improvements observed over SOTA approaches at lower epochs (200) are persistent with longer training (e.g., 800 or 1000 epochs).
+
+Evaluation: We evaluate the pre-trained models using linear evaluation (Linear $IN-1k$ ) in both ImageNet classification and transfer settings. The model backbone parameters are fixed and a single linear layer is trained atop them following the setting in CompRess [2]. Additionally, we report $k$ -nearest neighbor ( $k = 1,20$ ) evaluation for the SSL setting as in [2]. The transfer performance is evaluated on the following datasets: Food101 [8], SUN397 [73], CIFAR10 [39], CIFAR100 [39], Cars196 [38], Aircraft [43], Flowers (Flwrs102) [46], Pets [49], Caltech-101 (Calt101) [22], and DTD [18] (additional details in supplementary material.)
+
+Table 1. Left: Evaluation on full ImageNet: We compare our model with other SOTA methods in Linear (Top-1 Linear) and Nearest Neighbor (1-NN,20-NN) evaluation. We use a memory bank of size 128K for CMSF and provide comparison with both 256K and 1M memory bank versions of MSF. Since $\mathrm{CMSF}_{\mathrm{self}}$ uses NNs from two memory banks, it is comparable to MSF (256K) in memory and computation overhead. Both single crop and multi-crop versions of our method outperform other SOTA methods, including MSF, with similar compute. Right: Histogram of constrained sample ranks: We consider the $5^{th}$ NN in the constrained set $C$ and obtain its rank in the unconstrained memory bank $M$ . The histogram of these ranks are shown up to rank 100 for different train stages of $\mathrm{CMSF}_{\mathrm{self}}$ . Also, the median of these ranks are shown in Figure 5. A large number of distant neighbors are included in the constrained set in the early stages of training while there is a higher overlap between constrained and unconstrained NN sets towards the end of training.
+
+| Method | Ref. | Batch Size | Epochs | Sym. Loss 2x FLOPS | Multi-Crop Training | Top-1 Linear | NN | 20-NN |
| Supervised | [1] | 256 | 100 | - | - | 76.2 | 71.4 | 74.8 |
| Random-init | - | - | - | - | - | 5.1 | 1.5 | 2.0 |
| SeLa-v2 [76] | [11] | 4096 | 400 | ✓ | ✗ | 67.2 | - | - |
| SimCLR[13] | [13] | 4096 | 1000 | ✓ | ✗ | 69.3 | - | - |
| SwAV [11] | [11] | 4096 | 400 | ✓ | ✗ | 70.1 | - | - |
| DeepCluster-v2 [10] | [11] | 4096 | 400 | ✓ | ✗ | 70.2 | - | - |
| SimSiam [16] | [16] | 256 | 400 | ✓ | ✗ | 70.8 | - | - |
| MoCo v2 [29] | [15] | 256 | 800 | ✗ | ✗ | 71.1 | 57.3 | 61.0 |
| CompReess [2] | [2] | 256 | 1K+130 | ✗ | ✗ | 71.9 | 63.3 | 66.8 |
| InvP | [66] | 256 | 800 | ✗ | ✗ | 71.3 | - | - |
| BYOL [27] | [27] | 4096 | 1000 | ✓ | ✗ | 74.3 | 62.8 | 66.9 |
| SwAV [11] | [11] | 4096 | 800 | ✓ | ✓ | 75.3 | - | - |
| NNCLR | [21] | 4096 | 1000 | ✗ | ✗ | 75.4 | - | - |
| SimCLR[13] | [16] | 4096 | 200 | ✓ | ✗ | 68.3 | - | - |
| SwAV [11] | [16] | 4096 | 200 | ✓ | ✗ | 69.1 | - | - |
| MoCo v2 [29] | [16] | 256 | 200 | ✓ | ✗ | 69.9 | - | - |
| SimSiam [16] | [16] | 256 | 200 | ✓ | ✗ | 70.0 | - | - |
| NNCLR[21] | [21] | 4096 | 200 | ✗ | ✗ | 70.7 | - | - |
| BYOL [27] | [16] | 4096 | 200 | ✓ | ✗ | 70.6 | - | - |
| SwAV [11] | [16] | 256 | 200 | ✓ | ✓ | 72.7 | - | - |
| Truncated Triplet [67] | [67] | 832 | 200 | ✓ | ✗ | 73.8 | - | - |
| OBoW [24] | [24] | 256 | 200 | ✗ | ✓ | 73.8 | - | - |
| CMSFself (128K) | - | 256 | 200 | ✗ | ✓ | 74.4 | 62.3 | 66.2 |
| MoCo v2 [29] | [15] | 256 | 200 | ✗ | ✗ | 67.5 | 50.9 | 54.3 |
| CO2 [69] | [69] | 256 | 200 | ✗ | ✗ | 68.0 | - | - |
| BYOL-asym [27] | [37] | 256 | 200 | ✗ | ✗ | 69.3 | 55.0 | 59.2 |
| ISD [60] | [60] | 256 | 200 | ✗ | ✗ | 69.8 | 59.2 | 62.0 |
| MSF (1M) [37] | [37] | 256 | 200 | ✗ | ✗ | 72.4 | 62.0 | 64.9 |
| MSF (256K)[37] | [37] | 256 | 200 | ✗ | ✗ | 72.2 | 62.1 | 65.1 |
| CMSFself (128K) | - | 256 | 200 | ✗ | ✗ | 73.0 | 63.2 | 66.4 |
+
+
+
+# 3.1 Self-Supervised Learning (CMSFself)
+
+To reduce the GPU memory footprint, we cache the previous augmentation embedding of each sample in the dataset in the CPU. The cached features corresponding to the current mini-batch are retrieved from CPU memory to maintain memory bank $M'$ with previous augmentations. This cache is updated using the oldest features in $M$ that we remove from $M$ after each iteration.
+
+Results on ImageNet: Results of $\mathrm{CMSF_{self}}$ are shown in Table 1. $\mathrm{CMSF_{self}}$ outperforms MSF baseline with a larger memory bank, which we believe is due to
+
+
+Fig. 4. Nearest neighbor selection on constrained memory bank: First row shows top-5 NNs of target in constrained set $C$ and their corresponding rank in the unconstrained memory bank $M$ obtained using an intermediate checkpoint (epoch 100). While they are not the closest samples to the target (higher rank index), they are semantically similar to the target. This shows that the constraint can capture far away samples with similar semantic as the target. The second row depicts images from memory bank with one rank lower than the corresponding image in the first row. These images contain incorrect category retrievals. Distant neighbors cannot be trivially obtained by increasing the number of NNs. Examples are chosen randomly.
+
+pulling together far yet semantically similar samples (Fig. 4). We use MSF with $2x$ larger memory bank for fair comparison. $\mathrm{CMSF}_{\mathrm{self}}$ also achieves state-of-the-art performance on both NN and Linear metrics when compared with approaches with similar computational budget. We compare our method to other state-ofthe-art approaches with 200 epochs of training in Fig. 1. We observe a good trade-off in terms of accuracy and compute for $\mathrm{CMSF}_{\mathrm{self}}$ . Our best performance is obtained with the multi-crop version but at the cost of increased compute.
+
+Evaluation on ImageNet subsets: Following [31,13], we evaluate the pretrained models on the ImageNet classification task with limited labels. We report results with $1\%$ and $10\%$ labeled subsets of ImageNet (Table 4). $\mathrm{CMSF}_{\mathrm{self}}$ outperforms MSF on top-1 accuracy in both $1\%$ and $10\%$ settings and is comparable to existing approaches that require significantly higher training time.
+
+Transfer learning: We follow the procedure in [27,13] for transfer evaluation (refer to Table 2). Hyperparameters for each dataset are tuned independently based on the validation set accuracy and final accuracy is reported on the held-out test set (more details in supplementary). $\mathrm{CMSF}_{\mathrm{self}}$ achieves SOTA average performance among methods trained for 200 epochs.
+
+Purity of constrained samples: In $\mathrm{CMSF}_{\mathrm{self}}$ , we depend on information from previous augmentations to constrain NN search in the current memory bank. Our goal is to improve learning by using distant samples with a good purity. We observe that the top- $k$ samples from constrained memory bank $C$ have higher rank in $M$ , so are far neighbors of the target (see Table 1-Right and Fig. 5). Also, as shown in Fig. 5, those samples maintain almost the same purity as the top- $k$ samples from unconstrained memory bank $M$ . As a result, $C$ maintains good purity while being diverse.
+
+Effect of $k'$ : In $\mathrm{CMSF}_{\mathrm{self}}$ , we first calculate top- $k'$ samples (the first $k'$ NNs of the target) from the secondary memory bank $M'$ . We then use those indices to constrain NN search space in the primary memory bank $M$ and select top- $k$ for optimization. We varied the value of $k'$ in $\mathrm{CMSF}_{\mathrm{self}}$ to explore its effect, keeping $k$ fixed to 5. We observe that increasing $k'$ (relaxing the constraint) will decrease the accuracy of the model. As observed in Table 3-right, the overlap between
+
+Table 2. Transfer learning evaluation: Our supervised CMSF model at just 200 epochs outperforms all supervised baselines on transfer learning evaluation. Our SSL model outperforms MSF, the comparable state-of-the-art approach, by 1.2 points on average over 10 datasets. We get the results for MoCo v2, MSF, and BYOL-asym from [37], SimCLR and Xent (1000 epoch) from [13], and BYOL from [27].
+
+| Method | Epoch | Food 101 | CIFAR 10 | CIFAR 100 | SUN 397 | Cars 196 | Air-craft | DTD | Pets | Calt. 101 | Flwr 102 | Mean Trans | Linear IN-1k |
| Supervised Models |
| Xent | 200 | 67.7 | 89.8 | 72.5 | 57.5 | 43.7 | 39.8 | 67.9 | 91.8 | 91.1 | 88.0 | 71.0 | 77.2 |
| Xent | 90 | 72.8 | 91.0 | 74.0 | 59.5 | 56.8 | 48.4 | 70.7 | 92.0 | 90.8 | 93.0 | 74.9 | 76.2 |
| ProtoNW | 200 | 73.3 | 93.2 | 78.3 | 61.5 | 65.0 | 57.6 | 73.7 | 92.2 | 94.3 | 93.7 | 78.3 | 76.0 |
| SupCon | 200 | 72.5 | 93.8 | 77.7 | 61.5 | 64.8 | 58.6 | 74.6 | 92.5 | 93.6 | 94.1 | 78.4 | 77.5 |
| Xent | 1000 | 72.3 | 93.6 | 78.3 | 61.9 | 66.7 | 61.0 | 74.9 | 91.5 | 94.5 | 94.7 | 78.9 | 76.3 |
| \( CMSF_{sup} \)top-all | 200 | 73.7 | 94.2 | 78.7 | 62.1 | 71.7 | 64.1 | 73.4 | 92.5 | 94.5 | 95.8 | 80.1 | 75.7 |
| \( CMSF_{sup} \)top-10 | 200 | 74.9 | 94.4 | 78.7 | 62.7 | 70.8 | 63.4 | 73.8 | 92.2 | 94.9 | 95.6 | 80.1 | 76.4 |
| Self-Supervised Models |
| SimCLR | 1000 | 72.8 | 90.5 | 74.4 | 60.6 | 49.3 | 49.8 | 75.7 | 84.6 | 89.3 | 92.6 | 74.0 | 69.3 |
| MoCo v2 | 800 | 72.5 | 92.2 | 74.6 | 59.6 | 50.5 | 53.2 | 74.4 | 84.6 | 90.0 | 90.5 | 74.2 | 71.1 |
| BYOL | 1000 | 75.3 | 91.3 | 78.4 | 62.2 | 67.8 | 60.6 | 75.5 | 90.4 | 94.2 | 96.1 | 79.2 | 74.3 |
| MoCo v2 | 200 | 70.4 | 91.0 | 73.5 | 57.5 | 47.7 | 51.2 | 73.9 | 81.3 | 88.7 | 91.1 | 72.6 | 67.5 |
| BYOL-asym | 200 | 70.2 | 91.5 | 74.2 | 59.0 | 54.0 | 52.1 | 73.4 | 86.2 | 90.4 | 92.1 | 74.3 | 69.3 |
| MSF | 200 | 72.3 | 92.7 | 76.3 | 60.2 | 59.4 | 56.3 | 71.7 | 89.8 | 90.9 | 93.7 | 76.3 | 72.1 |
| \( CMSF_{self} \) | 200 | 73.0 | 92.2 | 77.2 | 61.0 | 60.6 | 58.4 | 74.1 | 91.1 | 92.0 | 94.5 | 77.4 | 73.0 |
+
+Table 3. Effect of $k'$ in sampling NN from $M'$ : In $\mathrm{CMSF}_{\mathrm{self}}$ , we constrain top- $k$ NN search space in $M$ with top- $k'$ samples from $M'$ . (Left) Increasing $k'$ results in a drop in accuracy. The $k$ in top- $k$ is set to 5 for all values of $k'$ . (Right) Histogram of the constrained sample ranks at epoch 50. The histogram shifts left, i.e., overlap between constrained and unconstrained NN sets increases with increasing value of $k'$ .
+
+| k' | 5 | 10 | 20 | 40 | 80 |
| NN | 63.2 | 62.9 | 62.7 | 62.3 | 61.7 |
| 20-NN | 66.4 | 66.1 | 65.9 | 65.6 | 65.0 |
+
+constrained and unconstrained NN set increases with increasing value of $k'$ . Note that in a case where $k' = \infty$ , $\mathrm{CMSF}_{\mathrm{self}}$ will be identical to the MSF baseline.
+
+# 3.2 Supervised Learning
+
+Evaluation: Unlike cross-entropy (Xent [7,42,52]) baseline, SupCon [36], ProtoNW [55] and CMSF do not train a linear classifier during the pre-training stage. Thus, we use the pre-training dataset ImageNet-1k (IN-1k) for linear evaluation of the frozen features as done in SSL. For Xent, we use the linear classifier trained during pre-training. We use the same settings and datasets as self-supervised for transfer learning evaluation.
+
+Results: Results on IN-1k dataset are shown in Table 2. In top-all variation of our method, $k$ is equal to the total size of $C$ . SSL inspired methods like CMSF
+
+
+Fig. 5. Purity of constrained samples: During training of $\mathrm{CMSF}_{\mathrm{self}}$ , we plot purity of the top-5 samples in unconstrained set $M$ (in black) and that of the top-5 samples in constrained set $C$ (in red). The red curve is not significantly below the black one suggesting that the purity is not dropped by increasing the distance of the NNs. To show that elements in $C$ may be far from the target $u$ , we choose the $5^{th}$ element in $C$ and find its rank in the set $M$ . We calculate the median of this rank as $m$ . The purity of the top- $m$ elements of set $M$ (green curve) is consistently lower than that of top-5 elements of the constrained set $C$ (red curve). This suggests that one cannot maintain high purity by simply considering more NNs using a larger $k$ .
+
+and SupCon significantly outperform Xent when trained for similar number of epochs. We observe that improvements in ImageNet performance do not always translate to transfer performance. Interestingly, CMSF performs the best on transfer evaluation, particularly on fine-grained datasets like Cars196 and Aircraft. We believe that the absence of explicit cross-entropy based optimization using the supervised labels preserves the multi-modal distribution of categories improving fine-grained performance. Supervised CMSF uses class labels only as a constraint for MSF during pre-training and does not explicitly optimize on the classification task. Superior performance of $\mathrm{CMSF}_{\mathrm{sup}}$ top-10 demonstrates the importance of using distant yet semantically related neighbors as positives.
+
+Noisy Labels: In the noisy setting, we use random i.i.d. noise to corrupt the labels (change the label randomly) of a percentage of images. We consider, $5\%$ , $10\%$ , $25\%$ , and $50\%$ label corruption (noise) rates. For faster experiments, we report results on the ImageNet-100 dataset [61] (Fig. 6). We observe a significantly higher degradation in performance of Xent baseline and $\mathrm{CMSF}_{\mathrm{sup}}$ top-all compared to $\mathrm{CMSF}_{\mathrm{sup}}$ top-10 at high noise levels. The gap between the approaches is larger on transfer learning. These observations indicate that NN based methods like CMSF are better suited for noisy constraint settings compared to approaches utilizing all samples of a class as positives. This robustness to label noise motivates our application of CMSF to self- and semi-supervised settings where pseudo-labels or the NNs of previous augmentations may be noisy.
+
+Coarse-grained ImageNet: CMSF groups together only top- $k$ neighbors and thus can help in preserving the latent structure of the data compared to top-all. To verify this, we consider a dataset with coarse-grained labels where this difference is pronounced. Based on the WordNet hierarchy, we merge each category in the ImageNet dataset to its parent class. We further ensure that no two classes are in the same path in the graph by merging the descendant into the ancestor
+
+Table 4. Evaluation on small labeled ImageNet : We compare our model to MSF and other baselines on ImageNet $1\%$ and $10\%$ linear evaluation benchmarks. "Fine-tuned" refers to fine-tuning the entire backbone network instead of a single linear layer. $\mathrm{CMSF}_{\mathrm{self}}$ outperforms MSF on top-1 metric in both $1\%$ and $10\%$ settings.
+
+| Method | Fine-tuned | Epochs | Top-1 | Top-5 |
| 1% | 10% | 1% | 10% |
| Supervised | ✓ | | 25.4 | 56.4 | 48.4 | 80.4 |
| PIRL [44] | ✓ | 800 | - | - | 57.2 | 83.8 |
| CO2 [69] | ✓ | 200 | - | - | 71.0 | 85.7 |
| SimCLR [13] | ✓ | 1000 | 48.3 | 65.6 | 75.5 | 87.8 |
| InvP [66] | ✓ | 800 | - | - | 78.2 | 88.7 |
| BYOL [27] | ✓ | 1000 | 53.2 | 68.8 | 78.4 | 89.0 |
| SwAV [11] | ✓ | 800 | 53.9 | 70.2 | 78.5 | 89.9 |
| MoCo v2 [15] | X | 800 | 51.5 | 63.6 | 77.6 | 86.1 |
| BYOL [27] | X | 1000 | 55.7 | 68.6 | 80.0 | 88.6 |
| CompRes [2] | X | 1K+130 | 59.7 | 67.0 | 82.3 | 87.5 |
| MoCo v2 [15] | X | 200 | 43.6 | 58.4 | 71.2 | 82.9 |
| BYOL-asym | X | 200 | 47.9 | 61.3 | 74.6 | 84.7 |
| ISD [60] | X | 200 | 53.4 | 63.0 | 78.8 | 85.9 |
| MSF [37] | X | 200 | 55.5 | 66.5 | 79.9 | 87.6 |
| CMSFself | X | 200 | 56.4 | 67.5 | 79.8 | 87.7 |
+
+
+
+
+Fig.6. Noisy supervised setting on ImageNet-100: Our method is more robust to noisy annotation compared to Xent and SupCon. Also, using top-all degrades the results since all images from a single category are not guaranteed to be semantically related due to noisy labels. Mean Transfer Accuracy is the average over 10 transfer datasets.
+
+Table 5. Supervised learning on coarse grained ImageNet: We train on the coarse grained version of ImageNet (93 super categories) and perform linear evaluation on the original ImageNet-1k validation set with fine-grained labels (1000 categories).
+
+| Train Dataset | ImageNet-1k Validation Set |
| Xent | SupCon | CMSFsup top-all | CMSFsup top-10 |
| ImageNet-1k | 77.2 | 77.5 | 75.7 | 76.4 |
| ImageNet-coarse | 61.4 | 58.7 | 67.0 | 74.2 |
+
+class. The total number of classes is thus reduced from 1000 in ImageNet-1k to 93 in our ImageNet-coarse. We train CMSF and the baseline approaches in a supervised manner using the coarse labels and then evaluate on the fine-grained / original labels on ImageNet-1k validation set. In Table 5 we compare the top-all and top-k variants on the coarse grained version of ImageNet. $\mathrm{CMSF}_{\mathrm{sup}}$ top- $k$ sees a minor drop in performance compared to training on ImageNet-1k. However, methods in which all samples in a class are explicitly brought closer - $\mathrm{CMSF}_{\mathrm{sup}}$ top-all, cross-entropy and supervised contrastive - see a huge drop in accuracy. More details on coarse-grained ImageNet are in the supplementary.
+
+# 3.3 Semi-Supervised Learning
+
+Implementation Details: We train a 2-layer MLP atop the cached target features of supervised set for pseudo-labeling. The pseudo-label training is performed
+
+Table 6. Semi-supervised learning on ImageNet dataset with $10\%$ labels: FLOPs denotes the total number of FLOPS for forward and backward passes through ResNet-50 backbone while batch size denotes the sum of labeled and unlabeled samples in a batch. $\mathrm{CMSF}_{\mathrm{semi}}$ -mix precision is compute and resource efficient, achieving SOTA performance at comparable compute. PAWS requires large number of GPUs to be compute efficient and its performance drastically drops with 4/8 GPUs. $\dagger$ Trained with stronger augmentations like RandAugment [19]. *TPUs are used.
+
+| Method | Epochs | Batch Size | GPUs | FLOPs (x1018) | Top-1 |
| Self-supervised Pre-training |
| Mean Shift [37] | 200 | 256 | 4 | 4 | 67.4 |
| BYOL [27] | 1000 | 4096 | 512* | 40 | 68.8 |
| SwAV [11] | 800 | 4096 | 64 | 37 | 70.2 |
| SimCLRv2 [14] | 800 | 4096 | 128* | 16 | 68.4 |
| Semi-supervised Pre-training |
| SimCLRv2 (+Self Dist) [14] | 1200 | 4096 | 128* | 20 | 70.5 |
| UDA† [74] | 800 | 15872 | 64* | 10 | 68.1 |
| FixMatch† [57] | 300 | 6144 | 32* | 7 | 71.5 |
| MPL† [50] | 800 | 2048 | - | 30 | 73.9 |
| PAWS (support=6720) [4] | 300 | 4096 | 64 | 21 | 75.5 |
| PAWS (support=1680) [4] | 100 | 256 | 8 | 15 | 70.2 |
| PAWS (support=400) [4] | 100 | 256 | 4 | 7 | 62.9 |
| CMSFsemi-basic | 200 | 256 | 4 | 4 | 68.6 |
| CMSFsemi | 200 | 256 | 4 | 4 | 69.9 |
| CMSFsemi-mix precision | 200 | 768 | 4 | 4 | 70.5 |
+
+twice per epoch (takes 40 seconds per training) and the label assignment is done in an online fashion for each mini-batch. The confidence threshold for pseudolabeling is set to 0.85. We use the same optimizer settings as in self-supervised CMSF for the pre-training stage. Similar to S4L [78], we perform two stages of fine-tuning with supervised and pseudo-labels. We fine-tune the backbone network with two MLPs (as in PAWS [4]) on the $10\%$ labeled set for 20 epochs and pseudo-label the train set. Samples above confidence threshold (nearly $30\%$ of dataset) are combined with supervised set to fine-tune again for 20 epochs (more details in suppl.). The second fine-tuning is equivalent to 5 epochs with full data and is a small increase in our total compute. This is needed since we do not directly optimize cross-entropy loss in pre-training as in [57,74,50].
+
+Evaluation: The final epoch parameters are used to perform evaluation. We report top-1 accuracy on the ImageNet validation set. We additionally report the total number of FLOPs for forward and backward passes (backward is $2 \times$ forward) through ResNet-50 backbone and the number of GPUs/TPUs used by each method in the pre-training stage (more details in suppl.).
+
+Baselines: We compare the proposed approach ( $CMSF_{semi}$ ) with self- and semi-supervised approaches. $CMSF_{semi}$ -basic minimizes unconstrained MSF loss on the unlabeled examples (no pseudo-labeling) and CMSF loss on the labeled examples only. We provide comparison of PAWS method with different support set sizes. We train PAWS on 4x 16GB GPUs with maximum possible support set size (200 classes, 2 images/class) using code provided by the authors. We also
+
+report results using mixed precision training ( $CMSF_{semi}$ -mix precision) as in PAWS [4] with a higher batch size of 768 since it has lower memory requirement.
+
+Results: $\mathrm{CMSF}_{\mathrm{semi}}$ -mix precision achieves comparable performance to most methods with significantly less training and without the use of stronger augmentation schemes like RandAugment [19] (Table 6, Fig. 1). PAWS with a support set size of 6720 outperforms other approaches. However, this requires significantly higher compute ( $4.8\times$ FLOPs) and resources (64 GPUs) compared to $\mathrm{CMSF}_{\mathrm{semi}}$ -mix precision (4 GPUs). Since PAWS requires a large support set, it does not scale well to lower resource ( $4/8$ GPUs) settings even if the total compute remains the same. When trained on only 4 GPUs, CMSF outperforms PAWS by $7.6\%$ points. Additional ablations and results on ImageNet-100 dataset are in supplementary.
+
+# 4 Related Work
+
+Self-supervised learning (SSL): Earlier works on SSL focused on solving a pretext task that does not require additional labeling. Examples of pretext tasks include colorization [80], jigsaw puzzle [47], counting [48], and rotation prediction [25]. Another class of SSL methods is based on instance discrimination [20]. The idea is to classify each image as its own class. Some methods adopt the idea of contrastive learning for instance discrimination [29,13,10,11,12]. BYOL [27] proposes a non-contrastive approach by removing the negative set and simply regressing one view of an image from another.
+
+Several recent works aim to find a larger positive sample set to improve learning. In LA [82], samples are clustered using $k$ -means and samples within a cluster are brought closer together compared to cross-cluster samples. MSF [37] and MYOW [5] generalize BYOL by regressing target view and its NNs. NNCLR [21] extends SimCLR to use NNs as positives. CLD [68] integrates grouping using instance-group discrimination. Affinity diffusion [33] uses strongly connected nodes in a graph constructed using embeddings to find positive samples. Unlike these methods, we focus on grouping together far away neighbors that are semantically similar. We show quantitatively and qualitatively the diversity and purity of retrieved neighbors and improved performance over MSF. We generalize the idea in MSF [37] to use an additional source of knowledge to constrain the NN search space for the target view. CoCLR [28] and Cl-InfoNCE [64] also use additional information sources in the form of additional modality and auxiliary labels respectively to improve performance. However, we focus on self- and semi-supervised classification settings and design methods to obtain and use the additional information as a constraint in NN search space.
+
+Supervised learning: A drawback of Cross-entropy is its lack of robustness to noisy labels [81,58]. [59,45,63,75] address the issue of hard labeling, e.g., (one-hot labels) with label smoothing, [32,6,23] replace hard labels with prediction of pre-trained teacher, and [79,77] propose an augmentation strategy to train on combination of instances and their labels. Another line of work [26,53] is to learn representations with good kNN performance. SupCon [36] and [72] improve upon [26] by changing the distance to inner product on $\ell_2$ normalized embeddings. We
+
+include the supervised setting to better understand the effect of using constrained NNs, particularly in the noisy label setting.
+
+Semi-supervised learning: Several methods combine self-supervised and supervised learning to form semi-supervised methods. S4L [78] uses rotation prediction based loss on the unlabeled set along with cross-entropy loss on the labeled set. Similarly, SuNCEt [3] combines SimCLR [13] and SwAV [11] methods with supervised contrastive loss. Pseudo-labeling is frequently used in semi-supervised learning. In Pseudo-Label [40], the network is trained with cross-entropy loss using supervised data on the labeled examples and pseudo-labels on the unlabeled ones. In SimCLR-v2 [14], a teacher network is pre-trained using SimCLR [13] and fine-tuned with supervised labels. The teacher is then distilled to a student network using pseudo-labels on the unlabeled set. FixMatch [57] uses pseudo-labels obtained using a weakly augmented image to train a strongly augmented version of the same image. UDA [74] leverages strong data augmentation techniques in enforcing this consistency in pseudo-labels across augmentations. MPL [50] optimizes a student network using pseudo-labels from a teacher network, while the teacher is optimized to maximize the student's performance on the labeled set. PAWS [4] uses consistency based loss on soft pseudo-labels obtained in a non-parametric manner. Our method too uses pseudo-labels to train the unlabeled samples. However, we use the labels as a constraint in MSF [37] and do not directly optimize samples using cross-entropy loss.
+
+Metric learning: The goal of metric learning is to train a representation that puts two instances close in the embedding space if they are semantically close. Two important methods in metric learning are: triplet loss [17,70,54] and contrastive loss [56,9]. Metric learning methods perform well on tasks like image retrieval [71] and few-shot learning [65,55]. Prototypical networks [55] is similar to a contrastive version of our method with top-all.
+
+# 5 Conclusion
+
+MSF is a recent SSL method that pulls an image towards its nearest neighbors. We argue that the model can benefit from more diverse yet pure neighbors. Hence, we generalize MSF method by constraining the NN search. This opens the door to using the mean-shift idea to various settings of self-supervised, supervised, and semi-supervised. To construct the constraint, our SSL method uses cached augmentations from the previous epoch while the supervised and semi-supervised settings use labels or pseudo-labels. We show that our method outperforms SOTA approaches like MSF in SSL, PAWS in semi-supervised, and supervised contrastive in transfer-learning evaluation of supervised settings.
+
+Acknowledgments: This material is based upon work partially supported by DARPA under Contract No. HR00112190135, the United States Air Force under Contract No. FA8750-19-C-0098, funding from SAP SE, and NSF grants 1845216 and 1920079. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the United States Air Force, DARPA, or other funding agencies.
+
+# References
+
+1. Torchvision models. https://pytorch.org/docs/stable/torchvision/models.html 7
+2. Abbasi Koohpayegani, S., Tejankar, A., Pirsiavash, H.: Compress: Self-supervised learning by compressing representations. Advances in Neural Information Processing Systems 33 (2020) 6, 7, 11
+3. Assran, M., Ballas, N., Castrejon, L., Rabbat, M.: Supervision accelerates pretraining in contrastive semi-supervised learning of visual representations. arXiv preprint arXiv:2006.10803 (2020) 14
+4. Assran, M., Caron, M., Misra, I., Bojanowski, P., Joulin, A., Ballas, N., Rabbat, M.: Semi-supervised learning of visual features by non-parametrically predicting view assignments with support samples. ICCV (2021) 2, 12, 13, 14
+5. Azabou, M., Azar, M.G., Liu, R., Lin, C.H., Johnson, E.C., Bhaskaran-Nair, K., Dabagia, M., Avila-Pires, B., Kitchell, L., Hengen, K.B., et al.: Mine your own view: Self-supervised learning through across-sample prediction. arXiv preprint arXiv:2102.10106 (2021) 1, 13
+6. Bagherinezhad, H., Horton, M., Rastegari, M., Farhadi, A.: Label refinery: Improving imagenet classification through label progression. arXiv preprint arXiv:1805.02641 (2018) 13
+7. Baum, E., Wilczek, F.: Supervised learning of probability distributions by neural networks. In: Anderson, D. (ed.) Neural Information Processing Systems. American Institute of Physics (1988), https://proceedings.neurips.cc/paper/1987/file/eccbc87e4b5ce2fe28308fd9f2a7baf3-Paper.pdf 9
+8. Bossard, L., Guillaumin, M., Van Gool, L.: Food-101 - mining discriminative components with random forests. In: European Conference on Computer Vision (2014) 6
+9. Bromley, J., Guyon, I., LeCun, Y., Säckinger, E., Shah, R.: Signature verification using a" siamese" time delay neural network. Advances in neural information processing systems 6, 737-744 (1993) 14
+10. Caron, M., Bojanowski, P., Joulin, A., Douze, M.: Deep clustering for unsupervised learning of visual features. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 132-149 (2018) 7, 13
+1. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., Joulin, A.: Unsupervised learning of visual features by contrasting cluster assignments. In: Advances in Neural Information Processing Systems. pp. 9912-9924. Curran Associates, Inc. (2020), https://proceedings.neurips.cc/paper/2020/file/70feb62b69f16e0238f741fab228fec2-Paper.pdf 6, 7, 11, 12, 13, 14
+2. Caron, M., Touvron, H., Misra, I., Jégou, H., Mairal, J., Bojanowski, P., Joulin, A.: Emerging properties in self-supervised vision transformers (2021) 13
+3. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020) 7, 8, 9, 11, 13, 14
+4. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.E.: Big self-supervised models are strong semi-supervised learners. Advances in Neural Information Processing Systems 33, 22243-22255 (2020) 12, 14
+5. Chen, X., Fan, H., Girshick, R., He, K.: Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297 (2020) 7, 11
+6. Chen, X., He, K.: Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566 (2020) 7
+
+17. Chopra, S., Hadsell, R., LeCun, Y.: Learning a similarity metric discriminatively, with application to face verification. In: 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05). vol. 1, pp. 539-546. IEEE (2005) 14
+18. Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., Vedaldi, A.: Describing textures in the wild. In: Computer Vision and Pattern Recognition (2014) 6
+19. Cubuk, E.D., Zoph, B., Shlens, J., Le, Q.: Randaugment: Practical automated data augmentation with a reduced search space. In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M.F., Lin, H. (eds.) Advances in Neural Information Processing Systems. vol. 33, pp. 18613-18624. Curran Associates, Inc. (2020), https://proceedings.neurips.cc/paper/2020/file/d85b63ef0ccb114d0a3bb7b7d808028f-Paper.pdf 12, 13
+20. Dosovitskiy, A., Springenberg, J.T., Riedmiller, M., Brox, T.: Discriminative unsupervised feature learning with convolutional neural networks. In: Advances in neural information processing systems. pp. 766-774 (2014) 13
+21. Dwibedi, D., Aytar, Y., Tompson, J., Sermanet, P., Zisserman, A.: With a little help from my friends: Nearest-neighbor contrastive learning of visual representations (2021) 1, 7, 13
+22. Fei-Fei, L., Fergus, R., Perona, P.: Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. Computer Vision and Pattern Recognition Workshop (2004) 6
+23. Furlanello, T., Lipton, Z.C., Tschannen, M., Itti, L., Anandkumar, A.: Born again neural networks (2018) 13
+24. Gidaris, S., Bursuc, A., Puy, G., Komodakis, N., Cord, M., Perez, P.: Obow: Online bag-of-visual-words generation for self-supervised learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6830-6840 (June 2021) 7
+25. Gidaris, S., Singh, P., Komodakis, N.: Unsupervised representation learning by predicting image rotations. In: International Conference on Learning Representations (2018), https://openreview.net/forum?id=S1v4N210-13
+26. Goldberger, J., Hinton, G.E., Roweis, S., Salakhutdinov, R.R.: Neighbourhood components analysis. Advances in neural information processing systems 17, 513-520 (2004) 13
+27. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P.H., Buchatskaya, E., Doersch, C., Pires, B.A., Guo, Z.D., Azar, M.G., et al.: Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733 (2020) 1, 3, 4, 7, 8, 9, 11, 12, 13
+28. Han, T., Xie, W., Zisserman, A.: Self-supervised co-training for video representation learning (2021) 13
+29. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020) 1, 7, 13
+30. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016) 6
+31. Henaff, O.J., Srinivas, A., De Fauw, J., Razavi, A., Doersch, C., Eslami, S., Oord, A.v.d.: Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272 (2019) 8
+32. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015) 13
+
+33. Huang, J., Dong, Q., Gong, S., Zhu, X.: Unsupervised deep learning via affinity diffusion. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 11029-11036 (2020) 13
+34. Huynh, T., Kornblith, S., Walter, M.R., Maire, M., Khademi, M.: Boosting contrastive self-supervised learning with false negative cancellation. arXiv preprint arXiv:2011.11765 (2020) 1
+35. Kalantidis, Y., Sariyildiz, M.B., Pion, N., Weinzaepfel, P., Larlus, D.: Hard negative mixing for contrastive learning. Advances in Neural Information Processing Systems (2020) 1
+36. Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., Krishnan, D.: Supervised contrastive learning. Advances in Neural Information Processing Systems 33 (2020) 9, 13
+37. Koohpayegani, S.A., Tejankar, A., Pirsiavash, H.: Mean shift for self-supervised learning. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 10326-10335 (October 2021) 1, 2, 3, 4, 6, 7, 9, 11, 12, 13, 14
+38. Krause, J., Stark, M., Deng, J., Fei-Fei, L.: 3D object representations for fine-grained categorization. In: Workshop on 3D Representation and Recognition. Sydney, Australia (2013) 6
+39. Krizhevsky, A.: Learning multiple layers of features from tiny images. Tech. rep., University of Toronto (2009) 6
+40. Lee, D.H., et al.: Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In: Workshop on challenges in representation learning, ICML. vol. 3, p. 896 (2013) 14
+41. Lee, K., Zhu, Y., Sohn, K., Li, C.L., Shin, J., Lee, H.: $i$ -mix: A domain-agnostic strategy for contrastive representation learning. In: International Conference on Learning Representations (2020) 1
+42. Levin, E., Fleisher, M.: Accelerated learning in layered neural networks. Complex systems 2(625-640), 3 (1988) 9
+43. Maji, S., Rahtu, E., Kannala, J., Blaschko, M.B., Vedaldi, A.: Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151 (2013) 6
+44. Misra, I., van der Maaten, L.: Self-supervised learning of pretext-invariant representations. arXiv preprint arXiv:1912.01991 (2019) 11
+45. Müller, R., Kornblith, S., Hinton, G.: When does label smoothing help? (2020) 13
+46. Nilsback, M.E., Zisserman, A.: Automated flower classification over a large number of classes. In: Indian Conference on Computer Vision, Graphics and Image Processing (2008) 6
+47. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: European Conference on Computer Vision. pp. 69-84. Springer (2016) 13
+48. Noroozi, M., Piriavash, H., Favaro, P.: Representation learning by learning to count. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 5898-5906 (2017) 13
+49. Parkhi, O.M., Vedaldi, A., Zisserman, A., Jawahar, C.V.: Cats and dogs. In: Computer Vision and Pattern Recognition (2012) 6
+50. Pham, H., Dai, Z., Xie, Q., Le, Q.V.: Meta pseudo labels. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11557-11568 (2021) 12, 14
+51. Reed, C.J., Metzger, S., Srinivas, A., Darrell, T., Keutzer, K.: Selfaugment: Automatic augmentation policies for self-supervised learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2674-2683 (2021) 1
+
+52. Rumelhart, D.E., Hinton, G.E., Williams, R.J.: Learning representations by backpropagating errors. nature 323(6088), 533-536 (1986) 9
+53. Salakhutdinov, R., Hinton, G.: Learning a nonlinear embedding by preserving class neighbourhood structure. In: Artificial Intelligence and Statistics. pp. 412-419. PMLR (2007) 13
+54. Schroff, F., Kalenichenko, D., Philbin, J.: Facenet: A unified embedding for face recognition and clustering. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 815-823 (2015) 14
+55. Snell, J., Swersky, K., Zemel, R.S.: Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175 (2017) 9, 14
+56. Sohn, K.: Improved deep metric learning with multi-class n-pair loss objective. In: Proceedings of the 30th International Conference on Neural Information Processing Systems. pp. 1857-1865 (2016) 14
+57. Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C.A., Cubuk, E.D., Kurakin, A., Li, C.L.: Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Advances in Neural Information Processing Systems 33 (2020) 12, 14
+58. Sukhbaatar, S., Bruna, J., Paluri, M., Bourdev, L., Fergus, R.: Training convolutional networks with noisy labels (2015) 13
+59. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z.: Rethinking the inception architecture for computer vision (2015) 13
+60. Tejankar, A., Koohpayegani, S.A., Pillai, V., Favaro, P., Pirsiavash, H.: Isd: Self-supervised learning by iterative similarity distillation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 9609-9618 (October 2021) 7, 11
+61. Tian, Y., Krishnan, D., Isola, P.: Contrastive multiview coding. arXiv preprint arXiv:1906.05849 (2019) 10
+62. Tian, Y., Sun, C., Poole, B., Krishnan, D., Schmid, C., Isola, P.: What makes for good views for contrastive learning? In: Advances in Neural Information Processing Systems. vol. 33, pp. 6827-6839. Curran Associates, Inc. (2020), https://proceedings.neurips.cc/paper/2020/file/4c2e5eaae9152079b9e95845750bb9ab-Paper.pdf 1
+63. Touvron, H., Sablayrolles, A., Douze, M., Cord, M., Jégou, H.: Grafit: Learning fine-grained image representations with coarse labels (2020) 13
+64. Tsai, Y.H.H., Li, T., Liu, W., Liao, P., Salakhutdinov, R., Morency, L.P.: Integrating auxiliary information in self-supervised learning (2021) 13
+65. Vinyals, O., Blundell, C., Lillicrap, T., Kavukcuoglu, K., Wierstra, D.: Matching networks for one shot learning (2017) 14
+66. Wang, F., Liu, H., Guo, D., Fuchun, S.: Unsupervised representation learning by invariance propagation. In: Advances in Neural Information Processing Systems. vol. 33, pp. 3510-3520. Curran Associates, Inc. (2020), https://proceedings.neurips.cc/paper/2020/file/23af4b45f1e166141a790d1a3126e77a-Paper.pdf 7, 11
+67. Wang, G., Wang, K., Wang, G., Torr, P.H.S., Lin, L.: Solving inefficiency of self-supervised representation learning (2021) 1, 7
+68. Wang, X., Liu, Z., Yu, S.X.: Unsupervised feature learning by cross-level instance-group discrimination. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 12586-12595 (June 2021) 13
+69. Wei, C., Wang, H., Shen, W., Yuille, A.: Co2: Consistent contrast for unsupervised visual representation learning. arXiv preprint arXiv:2010.02217 (2020) 7, 11
+
+70. Weinberger, K.Q., Blitzer, J., Saul, L.K.: Distance metric learning for large margin nearest neighbor classification. In: Advances in neural information processing systems. pp. 1473-1480 (2006) 14
+71. Wu, C.Y., Manmatha, R., Smola, A.J., Krahenbuhl, P.: Sampling matters in deep embedding learning. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (Oct 2017) 14
+72. Wu, Z., Efros, A.A., Yu, S.X.: Improving generalization via scalable neighborhood component analysis (2018) 13
+73. Xiao, J., Hays, J., Ehinger, K.A., Oliva, A., Torralba, A.: Sun database: Large-scale scene recognition from abbey to zoo. In: Computer Vision and Pattern Recognition (2010) 6
+74. Xie, Q., Dai, Z., Hovy, E., Luong, M.T., Le, Q.V.: Unsupervised data augmentation for consistency training. NeurIPS (2020) 12, 14
+75. Xu, Y., Qian, Q., Li, H., Jin, R., Hu, J.: Weakly supervised representation learning with coarse labels (2021) 13
+76. YM., A., C., R., A., V.: Self-labelling via simultaneous clustering and representation learning. In: International Conference on Learning Representations (2020), https://openreview.net/forum?id=Hyx-jyBFPr 7
+77. Yun, S., Han, D., Oh, S.J., Chun, S., Choe, J., Yoo, Y.: Cutmix: Regularization strategy to train strong classifiers with localizable features (2019) 13
+78. Zhai, X., Oliver, A., Kolesnikov, A., Beyer, L.: S41: Self-supervised semi-supervised learning. In: The IEEE International Conference on Computer Vision (ICCV) (October 2019) 12, 14
+79. Zhang, H., Cisse, M., Dauphin, Y.N., Lopez-Paz, D.: mixup: Beyond empirical risk minimization (2018) 13
+80. Zhang, R., Isola, P., Efros, A.A.: Colorful image colorization. In: European conference on computer vision. pp. 649-666. Springer (2016) 13
+81. Zhang, Z., Sabuncu, M.R.: Generalized cross entropy loss for training deep neural networks with noisy labels. arXiv preprint arXiv:1805.07836 (2018) 13
+82. Zhuang, C., Zhai, A.L., Yamins, D.: Local aggregation for unsupervised learning of visual embeddings. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 6002-6012 (2019) 13
\ No newline at end of file
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/images.zip b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..42a2c77e7e54ea578a54b4be3e78315679a9edfd
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1df28a5d30ecdfa447f5e682b6aff3091660598be7e85d55411891c3d4c5a43c
+size 565926
diff --git a/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/layout.json b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9ebf379a196bb9d045459d88f1638270961a26e8
--- /dev/null
+++ b/constrainedmeanshiftusingdistantyetrelatedneighborsforrepresentationlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:644585ebe15c856c52de819bc380705fff7d36113f3dbc88c86b0750399634ec
+size 540162
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_content_list.json b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..978db7190fde0d03097ab1d0141cbd80e63ac999
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ef53be65524edceff53bf32a3009914713a9156f8a645fc0fd1ac670980671c0
+size 85702
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_model.json b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..cd26b17acb2788774597ac25da1b612abe420f80
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dda9dd9bdb25c4e752b547813b6e82b1851a7afabba260cc07c8318fe54b7f28
+size 109668
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_origin.pdf b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4ebf7eb5beda3588e4b4a27e8149701a58529165
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/d6249dd4-b3f3-4414-9a44-c0672926f459_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79d40d60224666b14d85c494994418603b2b8bfa9beadcfd933b219d56417d5f
+size 704485
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/full.md b/constructingbalancefromimbalanceforlongtailedimagerecognition/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..41daab3aab3c077d4b783a59941884c84c9c65b0
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/full.md
@@ -0,0 +1,340 @@
+# Constructing Balance from Imbalance for Long-tailed Image Recognition
+
+Yue $\mathrm{Xu}^{1}$ $\mathbb{D}^{\star}$ , Yong-Lu $\mathrm{Li}^{1,2}$ $\mathbb{D}^{\star}$ , Jiefeng $\mathrm{Li}^{1}$ , and Cewu $\mathrm{Lu}^{1}$ $\mathbb{D}^{\star\star}$
+
+$^{1}$ Shanghai Jiao Tong University
+ $^{2}$ Hong Kong University of Science and Technology
+{silicxuyue,yonglu-li,ljf likit,lucewu}@sjtu.edu.cn
+
+Abstract. Long-tailed image recognition presents massive challenges to deep learning systems since the imbalance between majority (head) classes and minority (tail) classes severely skews the data-driven deep neural networks. Previous methods tackle with data imbalance from the viewpoints of data distribution, feature space, and model design, etc. In this work, instead of directly learning a recognition model, we suggest confronting the bottleneck of head-to-tail bias before classifier learning, from the previously omitted perspective of balancing label space. To alleviate the head-to-tail bias, we propose a concise paradigm by progressively adjusting label space and dividing the head classes and tail classes, dynamically constructing balance from imbalance to facilitate the classification. With flexible data filtering and label space mapping, we can easily embed our approach to most classification models, especially the decoupled training methods. Besides, we find the separability of head-tail classes varies among different features with different inductive biases. Hence, our proposed model also provides a feature evaluation method and paves the way for long-tailed feature learning. Extensive experiments show that our method can boost the performance of state-of-the-arts of different types on widely-used benchmarks. Code is available at https://github.com/silicx/DLSA.
+
+Keywords: Image Classification, Long-Tailed Recognition, Normalizing Flows
+
+# 1 Introduction
+
+Deep learning shows its superiority in various computer vision tasks [53,32,17], especially in balanced data scenarios. Though, real-world data is usually severely imbalanced, following a long-tailed distribution [71,55,34,35], i.e., very few frequent classes take up the majority of data (head) while most classes are infrequent (tail). The highly biased data skews classifier learning and leads to performance drop on tail classes. As shown in Fig. 1, most errors stem from the
+
+
+(a) Linear Classifier
+
+
+(b) PaCo [9]
+Fig. 1: Confusion matrices of models on ImageNet-LT [38] test set, indicating the severe head-tail bias and that tail classes are particularly prone to confusion with head classes (high density at right-top). The correct samples are omitted for clarity. The classes are ordered by their frequency and merged into 20 bins.
+
+head-to-tail bias and a large number of tail samples are misclassified as head classes, even with the very recent long-tail learning technique [9].
+
+Many approaches have been proposed to re-balance long-tail learning by balancing the data distribution [24,15,1,2,6,33], balancing the output logits [41,67], balancing the training losses [19,20,60,3,46,50,54], balancing the feature space [63,26,58,25,9] or with balanced training strategy [27,70,22]. However, as it is the definition of class labels to blame for the long-tailed data distribution, there are very few works tackling long-tailed recognition from the perspective of balancing the label space. Samuel et al [48] decompose the class labels into semantic class descriptors and exploit its familiarity effect, which is commonly used in zero-shot learning. Wu et al [61] reorganize the class labels into a tree hierarchy by realistic taxonomy. Both methods partly alleviate the label imbalance but are restricted by the class setting (semantics, hierarchy). Here, we want to dynamically adjust the label space according to the imbalance of realistic data distribution to fit long-tail learning.
+
+We can speculate from Fig. 1 that if the head and tail classes are ideally separated, the tail-to-head errors and the complexity of imbalanced learning can be significantly reduced. Thus, we conduct a simple probing to analyze the effect of head-tail separation in Fig. 2 (detailed in supplementary materials: Supp. Sec. 1). We separate the test samples into two groups (head: classes with $>50$ samples; tail: the rest classes) before individually classifying the groups. Fig. 2 shows that accurate head-tail separation can help long-tail learning. In light of this, we incorporate a Dynamic Label Space Adjustment (DLSA) method as shown in Fig. 3. We propose to first confront the bottleneck of head-to-tail bias and deal with long-tailed recognition in a two-stage fashion: first adjust the label space and separate the head and tail samples, and then apply classification for the divided groups respectively. In virtue of the inductive bias of deep learning
+
+
+Fig.3: Demonstration of our dynamic label space adjustment (DLSA). $H_{i}$ stands for a head class and $T_{j}$ is a tail class. We re-define label space for imbalanced data and divide head and tail classes into two groups progressively to reduce head-to-tail bias, seeking balance from the new data sub-space. DLSA not only separates head and tail but also redefines the label space for the convenience of classifiers. So some of the head samples may be tail classes in new label space due to the $\mathcal{L}_{bal}$ constraint.
+
+
+Fig.2: The performance curve of linear classifier on ImageNet- LT [38] with different head-tail separation accuracy (50%: random separation; 100%: ideal separation). The separation model divides the classes into head and tail, and then we classify within the two individual groups. Better separation leads to a higher overall accuracy.
+
+feature models (e.g., pretrained backbone), we could define the new label space as the initial clusters of features and approach head-tail separation. Moreover, we hope the clusters in the new label space are balanced and contain only a few classes. We formulate these assumptions on the latent space as: 1) Head-Tail Separability: the head and tail are separated during the adjustment; 2) Cluster Balancedness: the clusters have balanced sizes; 3) Purity: samples in each cluster are pure, i.e., belong to as few classes as possible.
+
+Specifically, we propose a plug-and-play module which can be embedded in most two-stage learning methods [27]. We use Gaussian mixture to model the pretrained features and produce clusters. Then the samples are divided into two groups and classified independently, where head and tail classes are desired to be separated. In practice, multiple modules can be linked to a cascade model to progressively separate head and tail classes and reduce the imbalance bias. Experiments show that the dataset partition and label re-assignment can effectively alleviate label bias. On top of that, we find backbone models with various inductive biases have different head-tail class separability. With DLSA, we can qualitatively evaluate the feature learning of the backbones from the perspective of head-to-tail bias, which can facilitate long-tailed recognition in practice.
+
+Our main contributions are: 1) Proposing a dynamic label space adjustment paradigm for long-tail learning. 2) Our method is plug-and-play and can boost the performances of the state-of-the-arts on widely-adopted benchmarks. 3) Our method can also act as an evaluation of feature model selection to guide long-tailed feature learning and recognition.
+
+# 2 Related Work
+
+# 2.1 Long-Tailed Recognition
+
+Real-world data are long-tailed distributed, which skews machine learning models. Numerous tasks face the challenge of long-tailed data, including object detection [14], attribute recognition [36] and action understanding [4,37]. There is increasing literature trying to alleviate the bias brought by imbalanced data.
+
+Some small adjustments to the model components can alleviate imbalanced learning. The most intuitive approach is re-balance the data distribution, either by over-sampling the minority [1,2], or under-sampling of majority [24,15,1]. Data augmentation and generation [6,33,7] also flattens the long-tailed distribution and helps tail learning. Re-balancing by loss function adjust the significance of samples on each class [19,20,60,3,46,50,54]. Instead of weighting the losses, some methods balance the output logits [41,29,67] after training.
+
+There are also methods to modify the whole training process. One of the paths is knowledge transfer from head classes to tail classes [38,64,27,70,22,30]. Liu et al [38] enhance the feature of minority classes with a memory module. Zhang et al [64] distill the tail-centric teacher models into the general student network to facilitate tail learning while keeping the head performance. Some works involve specific balanced training strategy for imbalanced learning. Kang et al [27] exploit the two-stage approach by first training a feature extractor and then re-train a balanced classifier. Zhou et al [70] combine uniform sampling and reversed sampling in a curriculum learning fashion. Jamal et al [22] estimate class weights with meta-learning to modulate classification loss.
+
+Recently, self-supervised learning is applied in long-tailed recognition for feature space re-balancing, among which contrastive learning is the most trendy technique [42,5,16]. Yang and Xu [63] first use self-supervised pretraining to overcome long-tailed label bias. Kang et al [26] systematically compare contrastive learning with traditional supervised learning and find that the contrastive model learns a more balanced feature space which alleviates the bias brought by data imbalance. Here, our DLSA provides another strong proof for this conclusion (Sec. 4.4). Wang et al [58] combine contrastive feature learning and cross-entropy-based classifier training with a curriculum learning strategy. Jiang et al [25] exploit the contrast of the network and its pruned competitor to overcome the forgetting of the minority class. Cui et al [9] propose parametric contrastive learning to rebalance the sampling process in contrastive learning.
+
+However, very few works deal with long-tail bias from the perspective of balancing label space. Samuel et al [48] incorporate semantic class descriptors and enhance minority learning with the familiarity effect of the descriptors. Wu et al [61] reorganize the label space into tree hierarchy with semantics. In this paper, we propose DLSA to filter the balance subset from imbalanced data.
+
+# 2.2 Normalizing Flows
+
+Normalizing flows [47,31,43,12] are a family of invertible networks and are widely adopted in density estimation and generative models. Specifically, a normalizing
+
+
+Fig. 4: Method overview. The features $x$ are extracted by pretrained backbones and sent to Gaussian Mixture Flow Filter. The Flow Filter maps the samples to a Gaussian mixture latent space $\mathcal{Z}$ with three constraints: cluster balancedness, purity, and head-tail separability to balance the label space and separate head and tail classes. Then we re-group the data according to the likelihood of each sample. The samples that are more conforming to the Gaussian mixture (dots) are classified by Cluster-aided Classifier with cluster prior information. The samples with low likelihoods (red crosses) are progressively solved by Flow Filters or classified by a regular classifier at the last layer.
+
+flow $g$ is a cascaded transforms data $x \in \mathcal{X}$ to representation $u$ in latent space $\mathcal{U}$ : $u = g^{-1}(x)$ . By assuming a tractable latent distribution, we can recover the data distribution with the change of variable formula:
+
+$$
+P (x) = P (u) \cdot | \mathbf {J} (g ^ {- 1} (x)) |, \tag {1}
+$$
+
+where $\mathbf{J}(\cdot)$ is the Jacobian determinant of a transformation and is a crucial concern in the design of normalizing flows due to its high complexity. Rezende and Mohamed [47] propose some cascaded normalizing flows and their basic blocks have linear-time Jacobian computation. Real NVP [12] updates only part of the input vector in the normalizing flow block with a simple bijection, which is more capable of modeling high-dimension data distribution. IAF [31] and MAF [43] are more general than Real NVP, incorporating autoregressive transformations. In practical applications of density estimation, the latent distribution $\mathcal{U}$ is usually unit Gaussian for simplicity. Some works [21] exploit Gaussian mixture to explicitly capture the cluster structure of data. In this work, we also use a unit Gaussian mixture to simultaneously transform data and clusters.
+
+# 3 Approach
+
+# 3.1 Preliminaries
+
+Long-tailed recognition is to learn a model that predict labels $y = 1,2,\dots ,\mathcal{C}$ of the data sample $x\in \mathcal{X}$ , while the training sample numbers of each class
+
+$n_i = |\{x|y = i, x \in X_{train}\}|$ is highly imbalanced. The imbalancesness of data are measured by imbalance factor $\beta = \max(n_i) / \min(n_i)$ and the $\beta$ of typical long-tailed datasets ranges from 10 to 1000.
+
+Since the head-tail separation is a well-known key for long-tail learning, our idea is to separate head and tail samples recursively and classify in a divide-and-conquer manner. So the longtailedness is reduced in each partition of data and, in this sense, we construct balance from imbalance. We first divide head and tail classes, by re-defining a more balanced label space $h = 1,2,\dots ,K$ . As discussed, if we can ideally map the data and labels to a balanced space and separate head and tail classes, it will be easier to learn classifiers. However, it is impractical to achieve an absolutely balanced space. So we propose to progressively map and cluster samples, and filter out the samples that are well subject to the balanced distributions. During the clustering, we force the model to learn head-tail class separability. In this paradigm, the complexity of long-tail learning is partially transferred to the label space learning and latent space mapping process, while these can be more easily settled with the help of the inductive biases of pretrained features and the transformation ability of normalizing flows [47].
+
+Backbone Models. Different inductive biases exist in the various deep learning models and training schemes. Cross-entropy-based supervised learning imposes class separability on deep feature learning. As previously studied [27], for deep supervised learning, the data imbalance is mainly detrimental to the classifiers while the feature learning suffers less. Self-supervised contrastive learning methods [42,5] introduce instance-level transformation invariance to deep models, leading to a more balanced feature since there are no labels involved. Further supervised contrastive learning [63,26] combines the two aspects and incorporates both instance-level multi-view invariance and class-wise contrast. We compare the main-stream pretrained models with different inductive biases in Sec. 4.4 and supervised contrastive learning shows its superiority over the rest.
+
+Normalizing Flow. As introduced in Sec. 2.2, normalizing flows are invertible transformations and are suitable for density estimation and distribution mapping. We utilize normalizing flows to simultaneously map the data $x$ to representations $z$ in a more balanced latent space and estimate the new class label $h$ . The mathematical beauty of normalizing flow enables the maximum likelihood estimation and the learning of data mapping. We also design multiple constraints for the normalizing flows to re-balance the latent space.
+
+# 3.2 Overview
+
+Fig. 4 depicts the pipeline of our method. We apply our DLSA in feature space and the initial features are extracted by pretrained self-supervised models. There are mainly two types of modules arranged in a cascaded manner. Gaussian Mixture Flow Filter (Sec. 3.3) clusters the input data in latent space and assigns new cluster labels. Then, the samples are divided into two groups. The well-clustered samples are filtered out to mitigate the head-to-tail bias and learning complexity, and are sent to a dedicated Cluster-aided Classifier (Sec. 3.4)
+
+which exploits the cluster information in classification. The rest outliers are either forwarded to the next normalizing flow or regularly classified.
+
+Specifically, the input features are transformed by normalizing flows to a Gaussian mixture distribution to obtain cluster labels. For better separability in the long-tailed scenario, besides the maximum likelihood objective of Gaussian mixture, the flow model is constrained by three additional objectives: 1) Head-tail Separability: head and tail classes should be separated; 2) Cluster Balancedness: the sizes of latent clusters should be as balanced as possible; 3) Purity: the samples in each cluster should belong to as few classes as possible.
+
+# 3.3 Gaussian Mixture Flow Filter
+
+Gaussian Mixture Flow Filter modules transform data to a desired latent distribution, perform clustering and filter the samples. Without loss of generality, we take the first Flow Filter (magnified in Fig. 4) as an example.
+
+The filter module incorporates a normalizing flow model $g_{\theta}^{-1}: \mathcal{X} \to \mathcal{Z}$ with trainable parameter $\theta$ , mapping data samples $x \in \mathcal{X}$ to latent distribution $z \in \mathcal{Z}$ . To cluster the input samples into $K$ clusters, we assume the latent distribution $P(z)$ is a Gaussian mixture and each component corresponds to a cluster:
+
+$$
+P (z) = \sum_ {k = 1} ^ {K} P (h = k) P (z | h = k), \tag {2}
+$$
+
+where $h$ is the random variable of cluster index. $P(z|h = k) = \mathcal{N}(z|\mu_k,I)$ is a Gaussian probability density with mean vectors $\mu_{k}$ and identity covariance matrix. The $\mu_{k}$ are randomly sampled from a normal distribution and fixed during training [21]. A proper assumption on prior probability $P(h)$ is required for a tractable optimization methods of NF with GMM. Since $P(h)$ in GMM determines the "size" of a Gaussian component, with the balancedness assumptions, the prior probability $P(h)$ can be set to uniform distribution, thus:
+
+$$
+P (z) = \frac {1}{K} \sum_ {k = 1} ^ {K} P (z | h = k), \tag {3}
+$$
+
+and the prediction of sample $x$ is given by Bayes' theorem:
+
+$$
+P (k | x) = \frac {P (z | h = k)}{\sum_ {k ^ {\prime} = 1} ^ {K} P (z | h = k ^ {\prime})}, \quad \hat {h} = \underset {k} {\operatorname {a r g m a x}} P (k | x). \tag {4}
+$$
+
+We train the normalizing flow model with end-to-end gradient descent optimization with the following objectives.
+
+Maximum Likelihood Loss and Head-tail Separability. We propose a weighted maximum likelihood loss to simultaneously train the cluster model and learn head-tail class separation. With the elegant invertible property of
+
+normalizing flow and change of variable formula Eq. 1, we can painlessly obtain the Gaussian mixture likelihood of data sample $x$ :
+
+$$
+L (\theta ; x) = \sum_ {k = 1} ^ {K} \frac {1}{K} \mathcal {N} \left(g _ {\theta} ^ {- 1} (x) \mid \mu_ {k}, I\right) \left| \mathbf {J} \left(g _ {\theta} ^ {- 1} (x)\right) \right|. \tag {5}
+$$
+
+The maximum likelihood estimation (MLE) of parameter $\theta$ will produce a clustering model. To enhance the separability of head and tail classes of the Flow Filter, we incorporate sample weighting and impose higher weights on tail samples than head samples. In DLSA, samples in class $i$ are weighted by:
+
+$$
+\omega (i) = \frac {n _ {i} ^ {- q}}{\sum_ {j} n _ {j} ^ {- q}}, \tag {6}
+$$
+
+where $n_i$ is the training sample size of class $i$ . $q$ is a positive number usually ranging from 1 to 2, hence the tail samples receive larger weights. The weighted $L(\theta; x)$ will impose higher likelihoods on tail samples than head samples, therefore tail classes are more likely to be filtered out by Flow Filter and separated with head classes. The weighted maximum likelihood loss is constructed with the negative log-likelihood of a data batch $\mathcal{B}$ :
+
+$$
+\mathcal {L} _ {M L E} (\mathcal {B}) = - \sum_ {x \in \mathcal {B}} \omega (y) \log L (\theta ; x). \tag {7}
+$$
+
+Training the flow model with a single MLE constraint may result in trivial solutions or a latent distribution that is not suitable for long-tailed recognition, e.g., $g_{\theta}^{-1}$ maps all samples to one cluster (Fig. 5 and 6). To avoid model collapse and degeneration, we introduce two more objectives for the flow filter.
+
+Cluster Balancedness Loss. Though the prior distribution $P(h)$ has been set to uniform, the posterior after observing data samples $X$ :
+
+$$
+P (h = k | X) = \sum_ {x \in X} P (x | X) P (h = k | x) = \sum_ {x \in X} \frac {1}{| X |} P (h = k | x), \tag {8}
+$$
+
+can still be imbalanced; if so, the actual cluster sizes would be biased or even severely long-tailed distributed. To promote cluster balance, we introduce
+
+$$
+\mathcal {L} _ {b a l} (X) = \mathbb {E} _ {h} \left[ \log P (h | X) \right], \tag {9}
+$$
+
+a cluster balancedness loss which is the negative entropy of the posterior. It is also equivalent to the KL divergence between $P(k|X)$ and a discrete uniform distribution, whose simple proof is shown in Supp. Sec. 2.1. So minimizing the loss will force the cluster sizes to be more even. As shown in Fig. 5, balancedness loss can significantly reduce the unbalancedness of the cluster sizes.
+
+In practice, the optimization of $\mathcal{L}_{bal}$ can be unstable, especially with minibatch based optimizer [28]. For each mini-batch $\mathcal{B}_t$ at $t^{th}$ iteration, $\hat{p} = P(h = k|\mathcal{B}_t)$ is an unbiased estimator of the posterior $P(h = k|X)$ . But small batch
+
+
+Fig.5: Cluster sizes of DLSA w/ or w/o $\mathcal{L}_{bal}$ on ImageNet-LT [27].
+
+
+Fig.6: Cluster purity of DLSA w/ or w/o $\mathcal{L}_{pure}$ on ImageNet-LT [27].
+
+size can lead to large variance of $\hat{p}$ . Therefore, we propose to exploit the history information and incorporate a momentum-based estimator: $\tilde{p}_t = \eta \tilde{p}_{t-1} + (1 - \eta)P(h = k|\mathcal{B}_t)$ , where $\eta$ is decay factor. $\tilde{p}_{t-1}$ is the estimation of last batch and we set $\tilde{p}_0$ to 0. Thus, the bias-corrected estimator $\frac{\tilde{p}_t}{1 - \eta^t}$ is an unbiased and more efficient estimator than $\hat{p}$ , and is more stable during mini-batch training. The proof of its unbiasedness and efficiency is shown in Supp. Sec. 2.2.
+
+Purity Loss. We define a scalar "purity" $Purity(k)$ as the sample proportion of the largest class in the cluster $k$ . To enhance the class purity in each clusters, we repeatedly randomly sample a pair of samples $x_{i}$ , $x_{j}$ from two different classes $i$ , $j$ and suppressing their similarity in cluster predictions:
+
+$$
+\mathcal {L} _ {\text {p u r e}} \left(x _ {i}, x _ {j}\right) = \sum_ {k = 1} ^ {K} P (h = k \mid x _ {i}) \log P (h = k \mid x _ {j}). \tag {10}
+$$
+
+By minimizing the purity loss, we increase the cross-entropy between $P(h|x_{i})$ and $P(h|x_{j})$ , thus pushing the two samples farther. Fig. 6 indicates purity loss effectively increases the purity of the clusters. Different sampling strategies can be applied to the purity loss. Our experiments show that the best practice is sampling with equal probability for each class.
+
+Overall, the total loss of Flow Filter module is:
+
+$$
+\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\text {M L E}} + \lambda_ {\text {b a l}} \mathcal {L} _ {\text {b a l}} + \lambda_ {\text {p u r e}} \mathcal {L} _ {\text {p u r e}}. \tag {11}
+$$
+
+Among the constraints, $\mathcal{L}_{MLE}$ is for learning the data distribution and its sample-wise weights make the model lean to head samples, enabling head-tail separation with sample likelihood $P(x)$ . $\mathcal{L}_{pure}$ ensures that each cluster in GMM belongs to only one class, so we can use cluster information to enhance classification. $\mathcal{L}_{bal}$ reduces the longtailedness in clusters and prevents the model from trivial solutions, e.g., most samples go to one cluster. $\mathcal{L}_{pure}$ and $\mathcal{L}_{bal}$ ensure the training stability and enhance the separability learned by $\mathcal{L}_{MLE}$ .
+
+Filtering The Flow Filter implements the divide step in the DLSA pipeline. After training, some samples do not belong to any cluster and become outliers of the Gaussian mixture. We use a likelihood threshold $\alpha$ to separate the well-clustered samples and outliers. As shown in Fig. 4, the samples with higher
+
+confidence $(P(x) \leq \alpha$ , green and blue) are closer to the cluster centers and the rest $(P(x) > \alpha$ , red) are outliers of any clusters so they are sent to next adjustment module to further decrease the training difficulty. Accordingly, the samples are divided into two groups to separate head and tail classes.
+
+In practice, we set the threshold $\alpha$ to a quantile of $P(x)$ on training data, so that a certain proportion of data will be filtered out.
+
+# 3.4 Cluster-Aided Classifier
+
+The high-confidence samples filtered out by the Flow Filter are sent to a Cluster-aided Classifier. Under ideal conditions, each cluster $h$ in the Flow Filter contains only one class $y$ , so the prediction can be directly obtained by a simple label-class mapping. However, the learned Gaussian mixture is rather noisy and besides a majority class $y$ in one cluster, there are some samples from other classes. To compensate for these noise samples, we introduce a softer label-class mapping method. As demonstrated in Fig. 4, for each sample $x_{i}$ , we first compute cluster prior $P(y|h = \hat{k}_i)$ , which is the class frequency of training samples belonging to the sample's predicted cluster $\hat{k}_i$ . The cluster prior vector and the concatenation of feature $x_{i}$ and latent representation $z_{i}$ are forwarded to two independent fully-connected layers (FC). Their outputs are added and we take its Softmax as output probability: $P(y|x,z) = \text{Softmax}\left(FC[x,z] + FC[P(y|h = \hat{k}_i)]\right)$ .
+
+# 4 Experiment
+
+# 4.1 Datasets
+
+We evaluate our approach on three main-stream benchmarks: ImageNet-LT [38], Places-LT [38], and iNaturalist18 [56]. ImageNet-LT [38] and Places-LT [38] are long-tailed subsets of ImageNet [11] and Places-365 [69], with 1,000 and 365 categories and about $186\mathrm{K}$ and $106\mathrm{K}$ images respectively. Both datasets have Pareto distributed train sets and balanced test sets and the imbalanced factor $\beta$ is 256 and 996. iNaturalist18 [56] is a fine-grained image classification dataset which is naturally highly imbalanced ( $\beta = 500$ ), with 8,142 categories and over $437\mathrm{K}$ images. Following [38], we report overall accuracy on all datasets, and Many-shot (classes with over 100 images), Medium-shot (classes with 20-100 images), Few-shot (classes with fewer than 20 images) accuracy. We also use Matthews correlation coefficient (MCC) [40] and normalized mutual information (NMI) [10] to measure the performance in long-tailed scenario.
+
+# 4.2 Baselines
+
+We embed and evaluate our models in multiple two-stage [27] long-tail learning methods, with different trending feature learning and classifier learning. The involved methods cover various long-tail learning strategies, including data rebalancing, loss balancing, feature space balancing, and decision boundary adjusting.
+
+Feature Learning. (1) Supervised Cross-Entropy (CE): a baseline backbone trained with vanilla cross-entropy loss. (2) Class-balance Sampler (CBS) [52]: a balanced data sampler where each class has equal sampling probability. (3) PaCo [9]: supervised contrastive learning model based on MoCo [16] It manages to alleviate the sampling bias in contrastive learning. PaCo is currently the state-of-the-art approach on the two mentioned benchmarks. Following the original implementation, it is integrated with Balanced Softmax [46]. We reproduce the two-stage training version of PaCo and RandAug [8] is not applied in classifier learning for a fair comparison with other features.
+
+Classifier Learning. (1) BalSoftmax [46]: an adjusted Softmax-cross-entropy loss for imbalanced learning, by adding $\log(n_j)$ to logit of class $j$ during training, where $n_j$ is the training sample size of class $j$ . (2) Class-balance Sampler (CBS) [52]: same as CBS in Feature Learning. (3) Cosine classifier (Cosine) [44,13]: predicting according to the cosine distance of features $x$ and class embeddings $w_i$ . Or namely, normalize the features $x$ and weight vector $w_i$ of each class $i$ of a linear classifier: $\hat{y} = \mathrm{argmin}_i\{\cos\langle w_i, x\rangle\}$ (4) M2M [30] transfers head information to tail by resampling strategies. (5) RIDE [59] trains multiple diversified expert classifier and dynamically select the best expert for each sample. We use RIDE with two experts.
+
+# 4.3 Implementation Details
+
+We use 2-layered MAF [43] as the Flow Filter model. The Gaussian mixture centers are randomly sampled from $\mathcal{N}(0,0.05^2)$ and the details of variance selection please refer to Supp. Sec. 3. The model is trained with a SGD optimizer and the decay rate for balancedness loss momentum $\eta = 0.7$ . By default, the weight $q$ in the $\mathcal{L}_{MLE}$ is 2.0, and $30\%$ samples are filtered to Cluster-aided Classifiers in each division step. We reproduce the baselines with decoupled strategy [27]. The detailed hyper-parameters of each dataset are listed in Supp. Sec. 5.
+
+# 4.4 Results
+
+We evaluate the methods on some baselines in Tab. 1, 2 and 3. Supp. Sec. 6 shows the detailed results on iNaturalist18. Our method promotes the accuracy of all the baselines. On state-of-art method PaCo [9] + BalSoftmax [46], we achieve accuracy gain of $1.4\%$ , $1.2\%$ , $1.0\%$ on the datasets respectively. Especially, on few-shot classes, the method brings over $1.5\%$ accuracy bonus. Though iNaturalist18 is a large-scale, realistic, and severely imbalanced dataset, DLSA still brings $1\%$ improvement with PaCo representations. DLSA also brings about $1\%$ and $0.5\%$ gain on MCC and NMI score.
+
+Comparison of classifiers. In Tab. 1 and 2, we compare different classifier learning models on same pretrained features (last 10 rows of Tab. 1 and rows beginning with "CE+" in Tab. 2). On each dataset, all the classifier methods use a same trained Flow Filter model since we incorporate two-stage training in DLSA and the learning of Flow Filters only depends on the feature models. DLSA brings comparable improvement on different classifiers (1.2%, 1.4%, 1.2%,
+
+Table 1: Results on ImageNet-LT [38] with ResNet-50 [17] backbone.
+
+| Feature | Classifier | Overall | Many | Medium | Few | MCC | MNI |
| CE | BalSoftmax [46] | 42.8 | 54.1 | 39.4 | 23.2 | 42.7 | 70.1 |
| BalSoftmax [46] + DLSA | 43.9 (+1.1) | 54.5 | 41.0 | 24.0 | 43.8 | 70.3 |
| CBS [52] | BalSoftmax [46] | 42.2 | 55.8 | 38.3 | 17.6 | 42.2 | 69.9 |
| BalSoftmax [46] + DLSA | 43.1 (+0.9) | 55.3 | 40.2 | 18.9 | 43.1 | 70.2 |
| PaCo [9] | CBS [52] | 54.4 | 61.7 | 52.0 | 42.5 | 54.4 | 74.5 |
| CBS [52] + DLSA | 55.6 (+1.2) | 62.9 | 52.7 | 45.1 | 55.6 | 74.9 |
| BalSoftmax [46] | 54.9 | 67.0 | 50.1 | 38.0 | 54.9 | 74.9 |
| BalSoftmax [46] + DLSA | 56.3 (+1.4) | 67.2 | 52.1 | 40.2 | 56.1 | 75.4 |
| Cosine [44,13] | 55.7 | 64.9 | 53.0 | 39.5 | 55.7 | 75.2 |
| Cosine [44,13] + DLSA | 56.9 (+1.2) | 64.6 | 54.9 | 41.8 | 56.8 | 75.7 |
| M2M [30] | 55.8 | 67.3 | 52.1 | 36.5 | 55.8 | 75.3 |
| M2M [30] + DLSA | 56.7 (+0.9) | 68.0 | 52.8 | 38.2 | 56.6 | 75.7 |
| RIDE [59] | 56.5 | 67.3 | 53.3 | 37.3 | 56.5 | 75.6 |
| RIDE [59] + DLSA | 57.5 (+1.0) | 67.8 | 54.5 | 38.8 | 57.5 | 75.9 |
+
+0.9%, 1.0% on ImageNet-LT; 1.2%, 1.2%, 1.0% on Places-LT). The performance improvement of our model mainly depends on the initial structure of the features.
+
+Feature model comparison and evaluation. With DLSA, models with different feature models have comparable overall accuracy improvement (1.1%, 0.9%, 1.4% with BalSoftmax classifier on ImageNet-LT), but the improvement on few-shot classes differs (0.8%, 1.3%, 2.2% with BalSoftmax classifier). This is due to the different head-tail separability of pretrained features with different inductive biases. Thus, we compare the head-tail separation accuracy of DLSA on the three feature models. We analyze the samples filtered out by Flow Filters and compute the accuracy of these samples being tail classes. As discussed in Sec. 1, an ideal separation with 100% accuracy will significantly boost the long-tailed recognition. On PaCo+BalSoftmax, 100% accurate head-tail sep
+
+aration brings $\sim 10\%$ improvement. Fig. 7 shows the accuracy of head-tail classes separation of models with different features. At all three Flow Filter layers, features of PaCo show superior separability than feature models pretrained with CE or CBS, thus PaCo has more potential of enhancing tail recognition. We also evaluate the DLSA on CLIP [45] features of ImageNet-LT. It achieves $65.2\%$ overall accuracy and over $75\%$ separation accuracy, surpassing all baselines, showing the potential of DLSA in the latest feature spaces. These also strongly support the conclusion of [26], that contrastive learning generates a more balanced feature space and enhances generalization capability. The positive correlation between
+
+
+Fig. 7: The accuracy of head-tail separation of DLSA on different feature models. The threshold of head/tail is 50.
+
+Table 2: Results on Places-LT [38] with ImageNet [11]-pretrained ResNet-152 [17].
+
+| Feature | Overall | Many | Medium | Few | MCC | NMI |
| Joint (baseline) [27] | 30.2 | 45.7 | 27.3 | 8.2 | - | - |
| cRT [27] | 36.7 | 42.0 | 37.6 | 24.9 | - | - |
| τ-norm [27] | 37.9 | 37.8 | 40.7 | 31.8 | - | - |
| LWS [27] | 37.6 | 40.6 | 39.1 | 28.6 | - | - |
| MetaDA [23] | 37.1 | - | - | - | - | - |
| LFME [62] | 36.2 | 39.3 | 39.6 | 24.2 | - | - |
| FeatAug [7] | 36.4 | 42.8 | 37.5 | 22.7 | - | - |
| BALMS [46] | 38.7 | 41.2 | 39.8 | 31.6 | - | - |
| RSG [57] | 39.3 | 41.9 | 41.4 | 32.0 | - | - |
| DisAlign [65] | 39.3 | 40.4 | 42.4 | 30.1 | - | - |
| CE+BalSoftmax [46] | 37.8 | 40.0 | 40.2 | 28.5 | 37.7 | 58.1 |
| CE+BalSoftmax [46] + DLSA | 39.0 (+1.2) | 42.0 | 39.8 | 31.3 | 38.8 | 58.6 |
| CE+Cosine [44,13] | 37.0 | 39.2 | 37.7 | 31.4 | 36.8 | 57.8 |
| CE+Cosine [44,13] + DLSA | 38.2 (+1.2) | 39.7 | 39.2 | 33.3 | 38.1 | 58.3 |
| CE+RIDE [59] | 41.2 | 44.4 | 43.2 | 31.1 | 41.1 | 59.7 |
| CE+RIDE [59] + DLSA | 42.2 (+1.0) | 45.8 | 43.0 | 33.7 | 42.0 | 60.2 |
| PaCo+BalSoftmax [9] | 40.9 | 44.5 | 42.7 | 30.4 | 40.8 | 59.6 |
| PaCo+BalSoftmax [9] + DLSA | 42.1 (+1.2) | 44.4 | 44.6 | 32.3 | 42.0 | 59.7 |
+
+
+Fig. 8: Sample separation process of PaCo [9] + BalSoftmax [46] on ImageNet-LT [38] test set. The red and blue points are head and tail samples respectively. The grey boxes are Flow Filters and blue boxes are Cluster-aided Classifiers.
+
+head-tail separability and performance gain indicates that our proposed DLSA is a practical tool for feature analysis and evaluation with long-tailed data.
+
+# 4.5 Visualization
+
+We visualize our cascade division process in Fig. 8 via t-SNE [39]. We take the $\mathrm{PaCo + BalSoftmax}$ as the example. Our method can effectively divide the samples of head and tail classes gradually. The samples filtered out to Cluster-aided Classifiers (in the blue rectangles) are mainly tail samples, while the samples passed to the next Flow Filters (in the grey rectangles) are mixed.
+
+# 4.6 Ablation Study
+
+We conduct ablation studies and look into the model components on the test set of ImageNet-LT [38] with PaCo [9] + BalSoftmax [46] model, from the following
+
+Table 3: Results on iNaturalist-18 [56] with ResNet-50 [17].
+
+| Feature | Overall |
| LWS [27] | 69.5 |
| MetaDA [23] | 67.6 |
| Deep-RTC [61] | 64.0 |
| Remix [6] | 70.5 |
| FeatAug [7] | 65.9 |
| smDRAGON [49] | 69.1 |
| KCL [26] | 68.6 |
| MiSLAS [68] | 71.6 |
| DisAlign [65] | 70.6 |
| Hybrid-PSC [58] | 70.4 |
| FSR [66] | 65.5 |
| DRO-LT [51] | 69.7 |
| DiVE [18] | 71.7 |
| PaCo [9] | 71.8 |
| PaCo [9] + Ours | 72.8 (+1.0) |
+
+Table 4: Ablation study on ImageNetLT [38] with PaCo [9] + BalSoftmax [46] model and ResNet-50 [17] backbone.
+
+| Method | Overall | Many | Medium | Few |
| Full model | 56.3 | 67.2 | 52.1 | 40.2 |
| w/o LMLE | 54.7 | 66.1 | 50.8 | 36.3 |
| w/o Lbal | 55.2 | 65.8 | 51.2 | 38.9 |
| w/o Lpure | 55.4 | 66.1 | 51.5 | 39.2 |
| 300 clusters | 55.5 | 66.1 | 51.3 | 39.3 |
| 1000 clusters | 55.1 | 66.5 | 50.3 | 39.6 |
| 2 blocks | 55.4 | 66.3 | 51.2 | 39.3 |
| 4 blocks | 55.8 | 66.5 | 51.7 | 39.2 |
+
+aspects. The results are reported in Tab. 4. The extended ablation studies on Places-LT are shown in Supp. Sec. 7.
+
+Objectives. We evaluate the three objectives $\mathcal{L}_{MLE}$ , $\mathcal{L}_{bal}$ , $\mathcal{L}_{pure}$ by removing one of them. Removing any loss leads to a significant performance drop, which indicates the necessity of all objectives. Among these losses, w/o $\mathcal{L}_{pure}$ shows the least degradation since the pretrained backbones have moderately learned intra-class similarity and $\mathcal{L}_{pure}$ aim to explicitly enhance the compactness.
+
+Cluster number. Models with less/more clusters perform worse than default 500 clusters. Larger cluster number results in slow training and inference too.
+
+Filter block number. Models with more Flow Filter blocks can separate head and tail classes more finely. But excessive division operations lead to few training samples for the clustering model and classifiers. Due to this trade-off, the default model with 3 blocks outperforms that with 2 or 4 blocks.
+
+# 5 Conclusions
+
+In this paper, we propose to confront the head-to-tail bias by re-balancing the label space and separating head and tail classes. We present a plug-and-play module DLSA, which automatically adjusts the data distribution and constructs new label space to facilitate the recognition. We embed DLSA in various types of long-tailed recognition state-of-the-arts and boost their performances. We observe that DLSA is also capable of evaluating the different feature learning models. Our future work may extend to combining our paradigm with end-to-end models and more tasks, e.g., object detection and segmentation.
+
+Acknowledgement This work was supported by the National Key R&D Program of China (No. 2021ZD0110700), Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102), Shanghai Qi Zhi Institute, and SHEITC (2018-RGZN-02046).
+
+# References
+
+1. Buda, M., Maki, A., Mazurowski, M.A.: A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks 106, 249-259 (2018)
+2. Byrd, J., Lipton, Z.: What is the effect of importance weighting in deep learning? In: International Conference on Machine Learning. pp. 872-881. PMLR (2019)
+3. Cao, K., Wei, C., Gaidon, A., Arechiga, N., Ma, T.: Learning imbalanced datasets with label-distribution-aware margin loss. arXiv preprint arXiv:1906.07413 (2019)
+4. Chao, Y.W., Wang, Z., He, Y., Wang, J., Deng, J.: Hico: A benchmark for recognizing human-object interactions in images. In: Proceedings of the IEEE international conference on computer vision. pp. 1017-1025 (2015)
+5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+6. Chou, H.P., Chang, S.C., Pan, J.Y., Wei, W., Juan, D.C.: Remix: Rebalanced mixup. In: European Conference on Computer Vision. pp. 95-110. Springer (2020)
+7. Chu, P., Bian, X., Liu, S., Ling, H.: Feature space augmentation for long-tailed data. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXIX 16. pp. 694-710. Springer (2020)
+8. Cubuk, E.D., Zoph, B., Shlens, J., Le, Q.V.: Randaugment: Practical automated data augmentation with a reduced search space. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 702-703 (2020)
+9. Cui, J., Zhong, Z., Liu, S., Yu, B., Jia, J.: Parametric contrastive learning. arXiv preprint arXiv:2107.12028 (2021)
+10. Danon, L., Diaz-Guilera, A., Duch, J., Arenas, A.: Comparing community structure identification. Journal of statistical mechanics: Theory and experiment 2005(09), P09008 (2005)
+1. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition. pp. 248-255. IEEE (2009)
+2. Dinh, L., Sohl-Dickstein, J., Bengio, S.: Density estimation using real nvp. arXiv preprint arXiv:1605.08803 (2016)
+3. Gidaris, S., Komodakis, N.: Dynamic few-shot visual learning without forgetting. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4367-4375 (2018)
+4. Gupta, A., Dollar, P., Girshick, R.: Lvis: A dataset for large vocabulary instance segmentation. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 5356-5364 (2019)
+5. He, H., Garcia, E.A.: Learning from imbalanced data. IEEE Transactions on knowledge and data engineering 21(9), 1263-1284 (2009)
+6. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722 (2019)
+7. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+8. He, Y.Y., Wu, J., Wei, X.S.: Distilling virtual examples for long-tailed recognition. arXiv preprint arXiv:2103.15042 (2021)
+9. Huang, C., Li, Y., Loy, C.C., Tang, X.: Learning deep representation for imbalanced classification. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5375-5384 (2016)
+
+20. Huang, C., Li, Y., Loy, C.C., Tang, X.: Deep imbalanced learning for face recognition and attribute prediction. IEEE transactions on pattern analysis and machine intelligence 42(11), 2781-2794 (2019)
+21. Izmailov, P., Kirichenko, P., Finzi, M., Wilson, A.G.: Semi-supervised learning with normalizing flows. In: International Conference on Machine Learning. pp. 4615-4630. PMLR (2020)
+22. Jamal, M.A., Brown, M., Yang, M.H., Wang, L., Gong, B.: Rethinking classbalanced methods for long-tailed visual recognition from a domain adaptation perspective. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7610-7619 (2020)
+23. Jamal, M.A., Brown, M., Yang, M.H., Wang, L., Gong, B.: Rethinking classbalanced methods for long-tailed visual recognition from a domain adaptation perspective. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7610-7619 (2020)
+24. Japkowicz, N., Stephen, S.: The class imbalance problem: A systematic study. Intelligent data analysis 6(5), 429-449 (2002)
+25. Jiang, Z., Chen, T., Mortazavi, B., Wang, Z.: Self-damaging contrastive learning. arXiv preprint arXiv:2106.02990 (2021)
+26. Kang, B., Li, Y., Xie, S., Yuan, Z., Feng, J.: Exploring balanced feature spaces for representation learning. In: International Conference on Learning Representations (2020)
+27. Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., Kalantidis, Y.: Decoupling representation and classifier for long-tailed recognition. arXiv preprint arXiv:1910.09217 (2019)
+28. Kiefer, J., Wolfowitz, J.: Stochastic estimation of the maximum of a regression function. The Annals of Mathematical Statistics pp. 462-466 (1952)
+29. Kim, B., Kim, J.: Adjusting decision boundary for class imbalanced learning. IEEE Access 8, 81674-81685 (2020)
+30. Kim, J., Jeong, J., Shin, J.: M2m: Imbalanced classification via major-to-minor translation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13896-13905 (2020)
+31. Kingma, D.P., Salimans, T., Jozefowicz, R., Chen, X., Sutskever, I., Welling, M.: Improved variational inference with inverse autoregressive flow. Advances in neural information processing systems 29, 4743-4751 (2016)
+32. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25, 1097-1105 (2012)
+33. Li, S., Gong, K., Liu, C.H., Wang, Y., Qiao, F., Cheng, X.: Metasaug: Meta semantic augmentation for long-tailed visual recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5212-5221 (2021)
+34. Li, Y.L., Liu, X., Wu, X., Li, Y., Qiu, Z., Xu, L., Xu, Y., Fang, H.S., Lu, C.: Hake: A knowledge engine foundation for human activity understanding. arXiv preprint arXiv:2202.06851 (2022)
+35. Li, Y.L., Xu, L., Liu, X., Huang, X., Xu, Y., Wang, S., Fang, H.S., Ma, Z., Chen, M., Lu, C.: Pastanet: Toward human activity knowledge engine. In: CVPR (2020)
+36. Li, Y.L., Xu, Y., Mao, X., Lu, C.: Symmetry and group in attribute-object compositions. In: CVPR (2020)
+37. Li, Y.L., Zhou, S., Huang, X., Xu, L., Ma, Z., Fang, H.S., Wang, Y., Lu, C.: Transferable interactiveness knowledge for human-object interaction detection. In: CVPR (2019)
+
+38. Liu, Z., Miao, Z., Zhan, X., Wang, J., Gong, B., Yu, S.X.: Large-scale long-tailed recognition in an open world. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2537-2546 (2019)
+39. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008)
+40. Matthews, B.W.: Comparison of the predicted and observed secondary structure of t4 phage lysozyme. Biochimica et Biophysica Acta (BBA)-Protein Structure 405(2), 442-451 (1975)
+41. Menon, A.K., Jayasumana, S., Rawat, A.S., Jain, H., Veit, A., Kumar, S.: Long-tail learning via logit adjustment. arXiv preprint arXiv:2007.07314 (2020)
+42. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018)
+43. Papamakarios, G., Pavlakou, T., Murray, I.: Masked autoregressive flow for density estimation. arXiv preprint arXiv:1705.07057 (2017)
+44. Qi, H., Brown, M., Lowe, D.G.: Low-shot learning with imprinted weights. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5822-5830 (2018)
+45. Radford, A., Kim, J.W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al.: Learning transferable visual models from natural language supervision. In: International Conference on Machine Learning. pp. 8748-8763. PMLR (2021)
+46. Ren, J., Yu, C., Sheng, S., Ma, X., Zhao, H., Yi, S., Li, H.: Balanced meta-softmax for long-tailed visual recognition. arXiv preprint arXiv:2007.10740 (2020)
+47. Rezende, D., Mohamed, S.: Variational inference with normalizing flows. In: International conference on machine learning. pp. 1530-1538. PMLR (2015)
+48. Samuel, D., Atzmon, Y., Chechik, G.: From generalized zero-shot learning to long-tail with class descriptors. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 286-295 (2021)
+49. Samuel, D., Atzmon, Y., Chechik, G.: From generalized zero-shot learning to long-tail with class descriptors. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 286-295 (2021)
+50. Samuel, D., Chechik, G.: Distributional robustness loss for long-tail learning. arXiv preprint arXiv:2104.03066 (2021)
+51. Samuel, D., Chechik, G.: Distributional robustness loss for long-tail learning. arXiv preprint arXiv:2104.03066 (2021)
+52. Shen, L., Lin, Z., Huang, Q.: Relay backpropagation for effective learning of deep convolutional neural networks. In: European conference on computer vision. pp. 467-482. Springer (2016)
+53. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+54. Sinha, S., Ohashi, H., Nakamura, K.: Class-wise difficulty-balanced loss for solving class-imbalance. In: Proceedings of the Asian Conference on Computer Vision (2020)
+55. Spain, M., Perona, P.: Measuring and predicting importance of objects in our visual world (2007)
+56. Van Horn, G., Mac Aodha, O., Song, Y., Cui, Y., Sun, C., Shepard, A., Adam, H., Perona, P., Belongie, S.: The inaturalist species classification and detection dataset. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 8769-8778 (2018)
+
+57. Wang, J., Lukasiewicz, T., Hu, X., Cai, J., Xu, Z.: Rsg: A simple but effective module for learning imbalanced datasets. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3784-3793 (2021)
+58. Wang, P., Han, K., Wei, X.S., Zhang, L., Wang, L.: Contrastive learning based hybrid networks for long-tailed image classification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 943-952 (2021)
+59. Wang, X., Lian, L., Miao, Z., Liu, Z., Yu, S.X.: Long-tailed recognition by routing diverse distribution-aware experts. arXiv preprint arXiv:2010.01809 (2020)
+60. Wang, Y.X., Ramanan, D., Hebert, M.: Learning to model the tail. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. pp. 7032-7042 (2017)
+61. Wu, T.Y., Morgado, P., Wang, P., Ho, C.H., Vasconcelos, N.: Solving long-tailed recognition with deep realistic taxonomic classifier. In: European Conference on Computer Vision. pp. 171-189. Springer (2020)
+62. Xiang, L., Ding, G., Han, J.: Learning from multiple experts: Self-paced knowledge distillation for long-tailed classification. In: European Conference on Computer Vision. pp. 247-263. Springer (2020)
+63. Yang, Y., Xu, Z.: Rethinking the value of labels for improving class-imbalanced learning. arXiv preprint arXiv:2006.07529 (2020)
+64. Zhang, S., Chen, C., Hu, X., Peng, S.: Balanced knowledge distillation for long-tailed learning. arXiv preprint arXiv:2104.10510 (2021)
+65. Zhang, S., Li, Z., Yan, S., He, X., Sun, J.: Distribution alignment: A unified framework for long-tail visual recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2361-2370 (2021)
+66. Zhang, Z., Pfister, T.: Learning fast sample re-weighting without reward data. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 725-734 (2021)
+67. Zhong, Z., Cui, J., Liu, S., Jia, J.: Improving calibration for long-tailed recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16489-16498 (2021)
+68. Zhong, Z., Cui, J., Liu, S., Jia, J.: Improving calibration for long-tailed recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16489-16498 (2021)
+69. Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., Torralba, A.: Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence 40(6), 1452-1464 (2017)
+70. Zhou, B., Cui, Q., Wei, X.S., Chen, Z.M.: Bbn: Bilateral-branch network with cumulative learning for long-tailed visual recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9719–9728 (2020)
+71.Zipf,G.K.:The psycho-biology of language:An introduction to dynamic philology. Routledge (2013)
\ No newline at end of file
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/images.zip b/constructingbalancefromimbalanceforlongtailedimagerecognition/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6b96ea2a217bcbc1b6beca51d67e8416dcef73b0
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c853aa2891c8afdbb714d788c5f84ef654190c8114133429817ad9fba53bef3d
+size 417844
diff --git a/constructingbalancefromimbalanceforlongtailedimagerecognition/layout.json b/constructingbalancefromimbalanceforlongtailedimagerecognition/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..6e6a08871765f98b7d077bb0ee8fbc0d77fb4a8c
--- /dev/null
+++ b/constructingbalancefromimbalanceforlongtailedimagerecognition/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:06f4794e34a3c0200168b3de2e0b0bc71201e0f33ec09e6ff159ee44993cf736
+size 474851
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_content_list.json b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..34f7bce1360e225d14a69d26fc573558b8e430c1
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c8f2bbdaae7e191955d4674b84062478f5f0a47af9b5e9c0ddd194338035b068
+size 78531
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_model.json b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..dcdacabdfa4a44118f4c36ca05ef53e8f4b35385
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d79d4f11f3ac5a0e6766f4ff238b70c3564c7e25b4bfc07f42110e07c3d87bf
+size 98596
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_origin.pdf b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4442bc7f7c2e85e59967eb88d2cd88ad4bfe63e8
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/c14e68dc-2b2c-4858-abbd-e8b15d589910_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8b8f82d8cf68245602bda893f0be6a1172a8d0e9c6cce10e116e5aacfc22094f
+size 2615278
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/full.md b/contentadaptivelatentsanddecoderforneuralimagecompression/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2920dfbb1f12e4be2cd7739405e561b815da0ee8
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/full.md
@@ -0,0 +1,295 @@
+# Content Adaptive Latents and Decoder for Neural Image Compression
+
+Guanbo Pan $^{1}$ , Guo Lu $^{2}$ , Zhihao Hu $^{1}$ , and Dong Xu $^{3(\boxtimes)}$
+
+1 School of Software, Beihang University
+
+$^{2}$ School of Computer Science and Technology, Beijing Institute of Technology
+
+3 Department of Computer Science, The University of Hong Kong dongxudongxu@gmail.com
+
+Abstract. In recent years, neural image compression (NIC) algorithms have shown powerful coding performance. However, most of them are not adaptive to the image content. Although several content adaptive methods have been proposed by updating the encoder-side components, the adaptability of both latents and the decoder is not well exploited. In this work, we propose a new NIC framework that improves the content adaptability on both latents and the decoder. Specifically, to remove redundancy in the latents, our content adaptive channel dropping (CACD) method automatically selects the optimal quality levels for the latents spatially and drops the redundant channels. Additionally, we propose the content adaptive feature transformation (CAFT) method to improve decoder-side content adaptability by extracting the characteristic information of the image content, which is then used to transform the features in the decoder side. Experimental results demonstrate that our proposed methods with the encoder-side updating algorithm achieve the state-of-the-art performance.
+
+Keywords: Neural Image Compression, Content Adaptive Coding
+
+# 1 Introduction
+
+Data compression has been studied for decades as an essential issue to alleviate data storage and transmission burden. The traditionalCodec, such as JPEG [39], JPEG2000 [34], BPG [9] for image compression and H.264 [43], H.265 [36], H.266 [11] for video compression, still prevail nowadays. In recent years, neural image compression (NIC) has shown promising coding performance due to its powerful nonlinear transformation capability and end-to-end optimization strategy. The recent state-of-the-art NIC methods like [46] outperform the latest traditional compression standard Versatile Video Coding (VVC) [11] on various datasets including the Kodak [1] and Tecnick [4] datasets. These approaches generally reduce the redundancy of the images by using an autoencoder architecture, which learns a mapping between the RGB color space and the learned latent space. The latent representation of the image is then quantized into a discrete-valued version, which is further compressed by the lossless entropy coding methods.
+
+Neural data compression methods learn a generalized model to ensure the coding performance during performance evaluation. However, domain shift between the training and testing data and lack of adaptability to the visual content degrade the performance when compressing unseen data samples. Therefore, some works [12, 49, 27, 40] were proposed to improve the adaptability for neural image compression and neural video compression (NVC) by updating the encoder-side components. Those methods aim at generating more compressible latents and estimating more accurate entropy model parameters for each data instance by fine-tuning the latents [12, 49], the encoder [27] or the input image [40]. However, such fine-tuning process is extremely time-consuming and the adaptability is still limited due to the fixed decoder.
+
+To exploit the adaptability at the decoder, some full-model over-fitting methods [33] entropy encode and transmit the updates of the decoder parameters along with the quantized latents to the receiver side for better and consistent reconstruction. However, the design of additional model compression is quite complex and the updating approach is also time-consuming. Another limitation in NIC is that the number of channels of the latents is not adapted to the rate-distortion (RD) trade-offs and the image content. Most works train multiple models with the same network architecture based on different RD trade-offs for rate control, which generate the latents with the same channel number for different RD trade-offs and spatial locations. However, this leads to redundant elements in the latents.
+
+In this work, we propose a content adaptive NIC framework to improve the adaptability on both latents and the decoder. To improve the adaptability on latent codes, we propose the content adaptive channel dropping (CACD) method, which selects the optimal quality level at each spatial location for the latents and drops redundant elements along the channel dimension. In order to improve decoder-side content adaptability, we propose the content adaptive feature transformation (CAFT) method for the decoder, which extracts characteristic information of the image content in the decoder side and utilizes it to adapt each upsampled feature to the image content by using the Spatial Feature Transform (SFT) [41] strategy.
+
+The experiments demonstrate that our proposed methods improve the performance of the baseline framework [29] in terms of both latents and the decoder. Our proposed content adaptive methods are also complementary to those encoder-side updating methods. Experimental results on the Kodak dataset demonstrate that our framework equipped with the encoder-side updating method Stochastic Gumbel Annealing (SGA) [49] achieves comparable overall results to the recent state-of-the-art NIC methods [46, 45] and outperforms them at high bit-rates. Additionally, the experimental results also indicate that our methods are general and can be readily applied to NVC for better coding performance. The contributions of our work are summarized as follows:
+
+codes. Our CACD automatically selects the optimal quality level at each spatial location, and then drops redundant elements for bit-rate saving.
+
+- To exploit the adaptability at the decoder side, our content adaptive feature transformation (CAFT) method modulates the output features at multiple levels by considering the characteristic information of the image content.
+
+- Experimental results demonstrate that our methods improve the performance by adapting both latents and the decoder without any additional updating steps during performance evaluation, which are also complementary to the encoder-side updating methods.
+
+# 2 Related Work
+
+# 2.1 Neural Image Compression
+
+In recent years, neural image compression (NIC) performance has been improved significantly, which are mostly based on recurrent neural networks (RNNs) [22, 37, 38], convolutional neural networks (CNNs) [6, 7, 29, 15, 45, 13, 50], or invertible neural networks (INNs) [46]. In most works, CNN-based autoencoder is selected as the basic framework. Balle et al. [6] proposed an end-to-end optimized image compression framework based on nonlinear transformation, the additive noise quantization proxy and the fully factorized entropy model. Subsequently, the researchers focus more on improving the accuracy of the estimated entropy model using hyperprior [7], auto-regressive context model [29] and Gaussian Mixture Model (GMM) [15]. Different transformations are also proposed to enhance the expression capability of the latent space, such as residual blocks with attention module [15] and INN [46]. Some works [22, 24] applied the spatially variant bit allocation strategy as a post-process [22] or by using importance map [24]. Our method is also based on the convolutional autoencoder approach, but we improve the content adaptability of the baseline method [29].
+
+# 2.2 Content Adaptive Data Compression
+
+The effectiveness of neural data compression relies on the generalization capability to unseen data in the evaluation process. However, domain shift between training and testing data and lack of adaptability may degrade the coding performance when compressing various types of testing data. To solve this issue, a straightforward idea is to over-fit the encoder-side components. In this way, the model can adapt to test samples during performance evaluation, and does not affect the reconstruction quality because the encoder is not involved in the decoding process. To this end, Campos et al. [12] refined the latents by directly back propagating them, and Yang et al. [49] further closed the discretization gap by replacing the differentiable approximation for quantization with Stochastic Gumbel Annealing (SGA) when refining the latents. Moreover, Lu et al. [27] updated the encoder on each test frame for neural video compression (NVC), which generates content adaptive latent codes by using the over-fitted encoder.
+
+Recently, some full-model adaption methods for NVC have been proposed to adapt the decoder. The work in [33] updated both encoder and decoder when compressing I frames, and then transmitted the updates of the decoder parameters along with the compressed video sequences. These updating methods require hundreds or thousands of back propagation steps for each sample, which is extremely time-consuming. In summary, the encoder-side approaches do not utilize the adaptability of decoders and the full-model approach is often complex due to the additional model compression process.
+
+Our proposed content adaptive methods adapt the latents and the decoder to the image content in a non-updating way. Our methods are also complementary to those encoder-side updating methods, which leads to a fully-adapted solution to address the issues of both domain shift and lack of adaptability.
+
+# 2.3 Neural Video Compression
+
+In recent years, significant progress has also been achieved for neural video compression (NVC). Increasing number of learning based approaches [44, 28, 3, 19, 25, 16, 17, 21, 14, 20] have been proposed. Lu et al. [28] first proposed an end-to-end video compression framework DVC that follows the traditional hybrid coding framework and implements the key components with neural networks. Some subsequent works improved the motion compensation [3] or motion compression [19] for better optical flow based motion compensation. Recently, more works [16, 17, 21] were proposed to perform the operations in the feature space. Hu et al. [21] proposed the FVC framework where motion compensation and residual coding are performed in the feature space rather than the pixel space.
+
+# 3 Proposed Method
+
+# 3.1 Overall Architecture of Neural Image Compression
+
+We use the state-of-the-art neural image compression (NIC) method [29] as our baseline method and apply our methods on top of both context version and the non-context version. The overview of the baseline framework is provided in Fig. 1(a). We also describe the details of the baseline method as follows.
+
+At the encoder side, the input image $x$ is first transformed into the latent representation $y$ by using the encoder network, which consists of several convolution layers and uses the generalized divisive normalization (GDN) [5] layer as activation. The hyper-encoder captures the spatial dependencies of $y$ and produces the hyperprior $z$ . Then $y$ and $z$ are quantized into discrete-valued version $\hat{y}$ and $\hat{z}$ respectively by using the round operation, which is replaced by adding uniform noise [6] as an approximation during the training process. After that, the quantized features $\hat{y}$ and $\hat{z}$ are entropy coded into bit-stream. Each element in $\hat{z}$ is modeled as a factorized model $p_{\hat{z}}$ and each element in $\hat{y}$ is modeled as a Gaussian distribution $p_{\hat{y}|\hat{z}}$ conditioned on $\hat{z}$ .
+
+At the decoder side, the quantized hyperprior $\hat{z}$ is first entropy decoded and used to estimate the distribution of the quantized latent representation $\hat{y}$ .
+
+
+Fig. 1. Overview of our proposed framework based on [29] (a), the details in our content adaptive channel dropping (CACD) method for the latents (b) and the network architecture of our content adaptive feature transformation (CAFT) method for the decoder (c). For simplicity, the hyper-decoder and auto-regressive context model are denoted as "Entropy Parameters" and AC denotes arithmetic coding in the pipeline (a). The operation and modules with dashed container (i.e., the CACD and the decoder in (a)) along with the dashed data flow are our newly proposed modules. In CACD (b), the features with different channel widths are firstly generated from the quantized latent representation $\hat{y}$ . Then the rate-distortion (RD) based selection technique is applied to select the optimal channel number for each spatial location, which is stored in a binary mask $m^a$ . Channel dropping is then completed by element-wise multiplication of the latents $\hat{y}$ and the mask $m^a$ , which is also used to generate $\hat{z}^a$ (please see section 3.2 for more details). In CAFT (c), we modulate each upsampled feature by using the Spatial Feature Transform (SFT) layer, which is conditioned on characteristic information of the image content. The multi-level characteristic information is generated by using the latents $\hat{y}^a$ and the hyperprior $\hat{z}^a$ (see section 3.3 for more details). Conv(C, K, S) denotes the convolution layer with the output channel $C$ , the kernel size $K \times K$ and the stride $S$ . LReLU denotes the LeakyReLU activation for simplicity. The network architecture of Conditioned SFT and Resblock is illustrated in Fig. 3.
+
+In the non-context version of [29], $\hat{z}$ is fed into the hyper-decoder to estimate the mean and standard deviation of $\hat{y}$ . While in the context version, an autoregressive context model is added to utilize the entropy-decoded parts of $\hat{y}$ for more accurate entropy parameter estimation. Finally, the decoder takes $\hat{y}$ as the input to generate the reconstructed image $\hat{x}$ by using several deconvolution layers and inverse generalized divisive normalization (IGDN) layers.
+
+During the training process of NIC, a rate-distortion optimization (RDO) problem is formulated to minimize the bit-rate cost and the distortion between the original image $x$ and its reconstruction image $\hat{x}$ . A Lagrange multiplier $\lambda$ is used to control the trade-off between the bit-rate cost and the distortion. The loss function is formulated as follows:
+
+$$
+R + \lambda D = H (\hat {y}) + H (\hat {z}) + \lambda d (x, \hat {x}) \tag {1}
+$$
+
+where $H(\hat{y})$ and $H(\hat{z})$ denote the bit costs to compress $\hat{y}$ and $\hat{z}$ , $d(x, \hat{x})$ denotes the distortion between the reconstructed image and the input image, where mean squared error (MSE) is usually used.
+
+In our approach, we propose new operations and modules for the latents and the decoder. The channel dropping algorithm selects the optimal quality level at each spatial location for the latents $\hat{y}$ by minimizing the rate-distortion (RD) value. Then the latents $\hat{y}$ and the hyperprior $\hat{z}$ are replaced with their channel-adapted version $\hat{y}^a$ and $\hat{z}^a$ before entropy coding for bit-rate saving, where the exceeding channels are dropped (see section 3.2 for more details). In the decoder, we modulate the upsampled features after each IGDN layer by using the Spatial Feature Transform (SFT) [41] layer conditioned on characteristic information of the image content, which is extracted from the latents $\hat{y}^a$ and the hyperprior $\hat{z}^a$ (see section 3.3 for more details).
+
+# 3.2 Content Adaptive Channel Dropping for the Latents
+
+In neural image compression, rate control is implemented by training the models with different trade-offs (i.e., different $\lambda$ values) between bit-rate cost and reconstruction distortion. It is well-known that the more bits we use, the better reconstruction quality we can achieve. We also observe that the ability of converting extra bits to reconstruction quality (i.e., the quality gain when assigning similar additional bits) is different among image blocks. To this end, we quantify this ability as "bit conversion ratio", which is formulated as follows:
+
+$$
+\eta (x, \lambda^ {l}, \lambda^ {h}) _ {i} = \frac {P S N R (x , \lambda^ {h}) _ {i} - P S N R (x , \lambda^ {l}) _ {i}}{R (x , \lambda^ {h}) _ {i} - R (x , \lambda^ {l}) _ {i}} \tag {2}
+$$
+
+where $PSNR(x, \lambda)$ denotes the peak signal-to-noise ratio (PSNR) between the input image $x$ and its reconstructed image produced by the model trained with $\lambda$ , $R(x, \lambda)$ denotes the bit-rate cost of the latents and the hyperprior generated by the model trained with $\lambda$ , $\lambda^l$ and $\lambda^h$ denote the relatively lower and higher $\lambda$ values respectively, and $i$ denotes the $i$ th spatial block of the image.
+
+In Fig. 2, we provide a visualization example about bit conversion ratio on an image from the Kodak dataset [1]. Fig. 2(a) visualizes two images decoded by [29] trained with two different $\lambda$ values. It is observed that the grains of both woodwork (i.e., the wooden door and windows) and the bricks are constructed with more details in the bottom image with high bit-rate. In Fig. 2(b), we observe that the bit conversion ratio of the wooden areas is much higher than that of the brick areas. To achieve better rate-distortion (RD) performance, it is therefore
+
+
+
+
+(a) Decoded images from different $\lambda$ values.
+Fig. 2. An example of bit conversion ratio calculation on an image from the Kodak dataset based on the existing method [29].
+
+
+(b) Bit conversion ratio calculated from (a).
+
+reasonable to assign more bits for the areas with higher bit conversion ratio. To this end, we aim at compressing each image block with the suitable quality level, at which the RD cost is minimal among all the alternative quality levels.
+
+Before selecting the quality level at each spatial location for the latents $\hat{y}$ , our content adaptive channel dropping (CACD) method need to enable multiple quality levels in one single model. For each $\lambda$ value, we first decide the corresponding maximum channel number $g(\lambda)$ (also called the optimal channel width in this work), where the RD performance saturates at this channel width even if more number of channels is allowed for this $\lambda$ value [48]. Then we train our model with multiple rate-distortion optimization (MRDO) loss [48]. Note that we only set the additional elements in the channel dimension as zero instead of directly reducing the number of channels as in the slimmable implementation [48]. Specifically, for the original target $\lambda$ value, we have $K\lambda$ values (i.e., $K$ quality levels) including its original $\lambda$ value and $K - 1$ smaller $\lambda$ values ( $K$ is set as 3 in this work). A mask $m^{g(\lambda)}$ is generated by setting the value to zero for the channel locations exceeding the channel width $g(\lambda)$ , and one otherwise. The latent representation with level $\lambda$ is generated by the element-wise multiplication operation between the latents $\hat{y}$ and the corresponding mask $m^{g(\lambda)}$ (i.e., $\hat{y}^{g(\lambda)} \gets \hat{y} \odot m^{g(\lambda)})$ , and the hyperprior is also mapped in the same way (i.e., $\hat{z}^{g(\lambda)} \gets \hat{z} \odot m^{g(\lambda)})$ . The MRDO loss is then formulated as follows,
+
+$$
+\sum_ {\lambda \in \Lambda} R (\hat {y} ^ {g (\lambda)}, \hat {z} ^ {g (\lambda)}) + \lambda D (\hat {y} ^ {g (\lambda)}) \tag {3}
+$$
+
+where $\Lambda$ denotes the set of $K\lambda$ values, $R$ and $D$ denote the rate cost and the distortion in Eq.(1) respectively, and they are calculated by using the features with different quality levels.
+
+
+(a) Conditioned SFT
+
+
+(b) Resblock(M, K)
+Fig. 3. The network architecture of the conditioned SFT module (a) in our proposed content adaptive feature transformation and Resblock module (b). In each conditioned SFT, the extracted characteristic information $c^l$ at level $l$ is fed into the convolution layers to predict the adaptive parameters $\gamma^l$ and $\beta^l$ . In (b), Resblock(M, K) denotes the convolution layers with the output channel $M$ and the kernel size $K \times K$ .
+
+As the model can compress the image with $K$ quality levels, we adopt the block-based RD selection strategy, which selects the optimal channel width among alternatives for the smallest RD value at each spatial location. Specifically, at each spatial location, we calculate $K$ RD values by using the features with the channel widths $g(\lambda)$ among alternative quality levels and store the channel width corresponding to the smallest RD value in the channel allocation vector $a$ . We further generate the adaptation mask $m^a$ by setting the value to zero for the channel locations exceeding the allocated channel width, and one otherwise. Then the adapted features are generated by the element-wise multiplication operation with the adaption mask $m^a$ (i.e., $\hat{y}^a \gets \hat{y} \odot m^a$ , $\hat{z}^a \gets \hat{z} \odot m^a$ ). Therefore, our CACD method for the latents can automatically drop redundant elements at each spatial location and thus reduce the bit-rate cost.
+
+# 3.3 Content Adaptive Feature Transformation for the Decoder
+
+Domain shift between the training and testing data is a common problem for learning-based algorithms. Different from most tasks, the ground truth in neural image compression is exactly the same as the input image. Thus the model can be fine-tuned with the whole target domain dataset or even a target sample. Generally, only the encoder-side components are adapted because the change in the decoder will result in inconsistent reconstruction at the receiver side, which can not exploit the adaptability in the decoder. Although some works [33] synchronize the decoder to the receiver by transmitting the parameter changes, it is a non-trivial task to compress such parameter changes.
+
+Recently, Spatial Feature Transform (SFT) [41] has shown efficient spatial adaptability for various vision tasks including image super-resolution [41], semantic image synthesis [32] and variable-rate image compression [35]. Inspired by these works, we propose the content adaptive feature transformation (CAFT) method for the decoder, which uses the SFT layers conditioned on the relatively high-level characteristic information to adapt the decoder to the image content.
+
+As shown in Fig. 1(c), we first extract the characteristic information of the image content from the latents $\hat{y}$ and the hyperprior $\hat{z}$ by using the image characteristic extractor, which is denoted in the dashed cyan box (C is set as 192 in this work). To adapt the features with different resolutions, we then use the SFT layer after each IGDN layer, which is conditioned on the multi-level characteristic information $c^l$ produced in the module denoted in the dashed purple box, where $l = 1\dots L$ (L is set as 3 in this work).
+
+The detailed network structure of conditioned SFT is shown in Fig. 3(a). The conditioned SFT layer generates the affine transformation parameters $(\gamma^l, \beta^l)$ by learning the mapping function $\varPsi(c^l) \mapsto (\gamma^l, \beta^l)$ . The input feature $f^l$ is then transformed by using the learned parameters $(\gamma^l, \beta^l)$ to produce the content adapted feature $f_a^l$ :
+
+$$
+f _ {a} ^ {l} = f ^ {l} \odot \gamma^ {l} + \beta^ {l} \tag {4}
+$$
+
+where $\odot$ denotes the element-wise multiplication operation. Our CAFT modulates the features by using the conditioned SFT layer whose condition is the relatively high-level characteristic information of the image content to improve decoder-side content adaptability.
+
+# 4 Experiments
+
+# 4.1 Experimental Setup
+
+Datasets. We adopt the Flicker 2W dataset from [26] as our training dataset, which consists of 20,745 images. Each image is randomly cropped into $256 \times 256$ patches for data augmentation. The rate-distortion performance of our method is evaluated on the Kodak [1] and Tecnick [4] datasets.
+
+Implementation Details. We apply our proposed content adaptive methods on both [29] and its non-context version. We train our models with seven $\lambda$ values (i.e., $\lambda = 128$ , 256, 512, 1024, 2048, 4096 and 6144). We use $N = M = 192$ for the three lower $\lambda$ values and $N = M = 320$ for the four higher values. We first train two models with higher $\lambda$ values ( $\lambda = 1024$ for low bit-rates and $\lambda = 8192$ for high bit-rates). Other models are then fine-tuned from its corresponding pretrained model with their $\lambda$ values.
+
+To train our model with content adaptive channel dropping (CACD), we first use the multi rate-distortion optimization (MRDO) technology (Eq.(3)) to achieve its original performance with multiple quality levels. Then the CACD module is activated to select the optimal channel width in the subsequent fine-tuning iterations.
+
+We use the Adam [23] optimizer and set the batch size as 4. The initial learning rate is set as $5e - 5$ . Each fine-tuning step requires 1,000,000 iterations, which uses the initial learning rate for the first 500,000 iterations and $5e - 6$ for the remaining iterations. For MS-SSIM [42] based rate-distortion performance evaluation, we further fine-tune our model with the learning rate of $5e - 6$ for 500,000 iterations by using MS-SSIM as the distortion loss.
+
+
+Fig. 4. Rate-distortion performance evaluation results on the Kodak dataset.
+
+
+
+
+Fig.5. Rate-distortion performance evaluation results on the Tecnick dataset.
+
+
+Fig.6. BD rate saving $(\%)$ of our CACD and CAFT methods on the Tecnick dataset. We use [29] without the auto-regressive context model as our baseline method.
+
+# 4.2 Rate-Distortion Performance
+
+In Fig. 4, we report the performance of traditional image codec [9, 31], the state-of-the-art image compression methods [29, 15, 49, 30, 46, 50, 18, 45] and our proposed methods (denoted as "Ours") on the Kodak dataset. VVC is evaluated by VTM-12.1 [2] on the CompressAI [8] evaluation platform. We evaluate our methods on both [29] and its non-context version (denoted as a suffix of "w/o Context"). We observe that our methods improve the rate-distortion performance on both versions of the baseline method in terms of both PSNR and MS-SSIM [42]. It is worth mentioning that our method is compatible with state-of-the-art updating-based adaption method Stochastic Gumbel Annealing (SGA) [49]. We also report the fully-adapted result by combining our methods and SGA, which is
+
+denoted as "Ours + SGA". It is obvious that our fully-adapted method achieves comparable results as the recent state-of-the-art methods [45, 18] and outperforms them at high bit-rates. For example, our fully-adapted method achieves 0.4dB improvement at 1.2bpp when compared with the current state-of-the-art methods Xie (ACMMM21) [46] and Wu (TCSVT21) [45].
+
+In Fig. 5, we also report the coding performance of different methods on the Tecnick dataset. We have similar observations as on the Kodak dataset that our fully-adapted method achieves the state-of-the-art performance at all bitrates and achieves 0.4dB improvement at 0.7bpp when compared with current state-of-the-art methods Minnen (ICIP20) [30] and Xie (ACMMM21) [46]. The experimental results clearly demonstrate the effectiveness of our proposed fully-adapted method.
+
+# 4.3 Ablation Study and Model Analysis
+
+Effectiveness of the Proposed Methods. To demonstrate the effectiveness of our proposed content adaptive methods for the latents and the decoder, we conduct ablation study on the Tecnick dataset. To fairly compare our work with the updating-based adaption method SGA [49], we take the non-context version of [29] as the baseline method. We provide the BD rate saving result of our proposed methods over the baseline method based on the piecewise BDBR [10] results. As shown in Fig. 6, the alternative method equipped with our content adaptive feature transformation (i.e., Baseline + CAFT) outperforms the baseline method with the BD rate saving from $4\%$ to $8\%$ at all bit-rates. Additionally, the alternative method equipped with our content adaptive channel dropping strategy (i.e., Baseline + CACD) generally achieves better performance than the baseline method. Our method equipped with both CAFT and CACD achieves the best performance and outperforms all other methods, which saves about $10\%$ bit-rate in low PSNR range. When compared with the baseline method, we achieve the BDBR results of $-1.51\%$ , $-5.90\%$ and $-7.78\%$ for “Baseline + CACD”, “Baseline + CAFT” and “Ours” respectively, which clearly demonstrates improvement of our proposed methods over the baseline method. The ablation study results demonstrate that our overall framework is able to adapt to the image content on both latents and the decoder for better compression performance.
+
+Compatibility with Updating-based Method in the Encoder Side. Our methods adapt to the image content on both latents and the decoder, which is also compatible with the updating-based adaption method SGA [49]. To demonstrate the compatibility, we provide the BDBR [10] results on the Kodak and the Tecnick datasets in Table 1. Although our method (i.e., "Ours w/o Context") saves less bit-rates than "SGA", our method in combination with SGA (i.e., "Ours w/o Context + SGA") outperforms "SGA", which indicates that our content adaptive approach is complementary to SGA.
+
+Table 1. BDBR(\%) results about the compatibility of our method and SGA [49] on different datasets. Negative values indicate bit-rate saving. We use [29] without the auto-regressive context model as the anchor method to calculate the BDBR results.
+
+| Methods | Kodak | Tecnick |
| SGA | -15.17 | -18.72 |
| Ours w/o Context | -6.64 | -7.44 |
| Ours w/o Context + SGA | -21.44 | -24.50 |
+
+
+Ground Truth
+
+
+BPG
+
+
+Ground Truth
+
+
+
+
+BPG
+
+
+
+
+Minnen et al. [29]
+0.1558bpp, 26.33dB, 0.9005
+Fig. 7. Qualitative comparison results of the traditional codes BPG [9], neural image compression method Minnen et al. [29] and our method.
+
+
+0.1570bpp, 25.90dB, 0.8812
+Ours
+0.1518bpp, 26.77dB, 0.9045
+
+
+Minnen et al. [29]
+
+
+Ours
+
+
+
+Qualitative Results. As shown in Fig. 7, we provide the visualization results of the reconstructed image $\text{kodim14}$ from the Kodak dataset for qualitative comparison. It is observed that our method clearly improves the reconstruction quality over the baseline method [29] and achieves better performance than BPG. Our method preserves more details of the image content. For example, the artifacts can be clearly observed in both Minnen et al. [29] and BPG on the red life jacket, which are less obvious in our method. Additionally, the letters in front of the boat reconstructed by our proposed method are more clear than those reconstructed by other baseline algorithms with similar bit-rates.
+
+Visualization of Content Adaptive Channel Dropping. In Fig. 8, we visualize the allocated channel number selected by our method CACD. Fig. 8(a) is the reconstructed image of $\text{kodim}21$ from the Kodak dataset and Fig. 8(b)
+
+
+(a) Reconstructed image $\text{kodim}21$ from the Kodak dataset.
+(b) Visualization of the channel allocation results. Lighter color indicates more channels.
+
+
+Fig. 8. Visualization of the channel width selection results by using our method CACD for the latents. In (b), the white, red, black colors represent the quality levels from the highest level (i.e., the most channel number) to the lowest level (i.e., the least channel number).
+
+visualizes the quality level selection results for the latents. The white, red, black colors represent three quality levels from high to low. It is observed that less channels are allocated in the sky area because the sky area is smooth and needs less bits for reconstruction, while full channels are allocated to preserve more details in the sharp areas like the rocks, houses and the lighthouse.
+
+# 4.4 Experiments for Neural Video Compression
+
+Datasets. We train our methods on the Vimeo-90k [47] dataset, which is used as the training dataset in DVC [28]. For performance evaluation, we use the video sequences from the HEVC Class B and Class C [36] datasets.
+
+Implementation Details. We use an enhanced version of DVC [28] called "DVC*" as our baseline method, where the entropy models of both motion vector (MV) feature and residual feature are modeled by the mean-scale hyperprior. We train the models in a similar way as in neural image compression. We first pretrain a model with the $\lambda$ value of 2048. The learning rate is set as 1e-4 for the first 1,800,000 steps and 1e-5 for the following 200,000 steps. Then we fine-tune the pretrained model with other $\lambda$ values (i.e., 256, 512 and 1024) for 500,000 steps. For the adapted decoder with content adaptive feature transformation, we fine-tune the baseline model for another 600,000 steps to adjust the decoder parameter with the learning rate as 1e-4 for the first 400,000 steps and 1e-5 for the remaining steps. We use the Adam [23] optimizer and set the batch size as 4 for all the training procedures.
+
+
+Fig. 9. Rate-distortion performance evaluation results on the HEVC Class B and Class C test sequences.
+
+
+
+Rate-Distortion Performance. Fig. 9 compares the rate-distortion performance between our method CAFT and the baseline method DVC*. It is observed that our method improves the PSNR by about 0.4 dB at three low bit-rates and by about 0.3 dB at the highest bit-rate on the HEVC Class C test sequence. Similar results can also be observed on the HEVC Class B test sequence, which has larger resolution than the HEVC Class C test sequence. The experimental results demonstrate that our CAFT is general and can be readily used for neural video compression.
+
+# 5 Conclusions
+
+In this work, we have proposed the content adaptive methods for both latents and the decoder to improve the content adaptability for neural image compression. Our newly proposed content adaptive channel dropping (CACD) method is able to adaptively compress different locations with different quality levels by dropping redundant channels for better bit-rate saving. Our newly proposed content adaptive feature transformation (CAFT) method in the decoder side can extract the characteristic information of the image content, which can be further regraded as the condition to transform the features in the decoder. Experimental results demonstrate that our content adaptive methods are general to different compression pipelines and are also complementary to the encoder-side updating-based content adaptive methods.
+
+# Acknowledgement
+
+This work was supported by the National Key Research and Development Project of China (No. 2018AAA0101900).
+
+# References
+
+1. Kodak lossless true color image suite. URL http://r0k.us/graphics/kodak/
+2. VVC Official Test Model VTM. URL https://vccgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM-/tree/VTM-12.1
+3. Agustsson, E., Minnen, D., Johnston, N., Balle, J., Hwang, S.J., Toderici, G.: Scale-space flow for end-to-end optimized video compression. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020. pp. 8500-8509. Computer Vision Foundation / IEEE (2020)
+4. Asuni, N., Giachetti, A.: TESTIMAGES: a large-scale archive for testing visual devices and basic image processing algorithms. In: Giachetti, A. (ed.) Italian Chapter Conference 2014 - Smart Tools and Apps in computer Graphics, STAG 2014, Cagliari, Italy, September 22-23, 2014. pp. 63-70. Eurographics (2014)
+5. Balle, J., Laparra, V., Simoncelli, E.P.: Density modeling of images using a generalized normalization transformation. In: Bengio, Y., LeCun, Y. (eds.) 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings (2016)
+6. Balle, J., Laparra, V., Simoncelli, E.P.: End-to-end optimized image compression. In: 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net (2017)
+7. Balle, J., Minnen, D., Singh, S., Hwang, S.J., Johnston, N.: Variational image compression with a scale hyperprior. In: 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net (2018)
+8. Bégaint, J., Racapé, F., Feltman, S., Pushparaja, A.: Compressai: a pytorch library and evaluation platform for end-to-end compression research. arXiv preprint arXiv:2011.03029 (2020)
+9. Bellard, F.: Bpg image format. URL https://bellard.org/bpg (2015)
+10. Bjontegaard, G.: Calculation of average psnr differences between rd-curves. ITU-T VCEG-M33, April, 2001 (2001)
+1. Bross, B., Wang, Y., Ye, Y., Liu, S., Chen, J., Sullivan, G.J., Ohm, J.: Overview of the versatile video coding (VVC) standard and its applications. IEEE Trans. Circuits Syst. Video Technol. 31(10), 3736-3764 (2021)
+2. Campos, J., Meierhans, S., Djelouah, A., Schroers, C.: Content adaptive optimization for neural image compression. In: IEEE Conference on Computer Vision and Pattern Recognition Workshops, CVPR Workshops 2019, Long Beach, CA, USA, June 16-20, 2019. p. 0. Computer Vision Foundation / IEEE (2019)
+3. Chen, Z., Gu, S., Lu, G., Xu, D.: Exploiting intra-slice and inter-slice redundancy for learning-based lossless volumetric image compression. IEEE Transactions on Image Processing 31, 1697-1707 (2022)
+4. Chen, Z., Lu, G., Hu, Z., Liu, S., Jiang, W., Xu, D.: Lsvc: A learning-based stereo video compression framework. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6073-6082 (2022)
+5. Cheng, Z., Sun, H., Takeuchi, M., Katto, J.: Learned image compression with discretized gaussian mixture likelihoods and attention modules. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020. pp. 7936-7945. Computer Vision Foundation / IEEE (2020)
+
+16. Djelouah, A., Campos, J., Schaub-Meyer, S., Schroers, C.: Neural inter-frame compression for video coding. In: 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019. pp. 6420-6428. IEEE (2019)
+17. Feng, R., Wu, Y., Guo, Z., Zhang, Z., Chen, Z.: Learned video compression with feature-level residuals. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR Workshops 2020, Seattle, WA, USA, June 14-19, 2020. pp. 529-532. Computer Vision Foundation / IEEE (2020)
+18. Guo, Z., Zhang, Z., Feng, R., Chen, Z.: Causal contextual prediction for learned image compression. IEEE Trans. Circuits Syst. Video Technol. 32(4), 2329-2341 (2022)
+19. Hu, Z., Chen, Z., Xu, D., Lu, G., Ouyang, W., Gu, S.: Improving deep video compression by resolution-adaptive flow coding. In: Vedaldi, A., Bischof, H., Brox, T., Frahm, J. (eds.) Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II. Lecture Notes in Computer Science, vol. 12347, pp. 193-209. Springer (2020)
+20. Hu, Z., Lu, G., Guo, J., Liu, S., Jiang, W., Xu, D.: Coarse-to-fine deep video coding with hyperprior-guided mode prediction. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5921-5930 (2022)
+21. Hu, Z., Lu, G., Xu, D.: FVC: A new framework towards deep video compression in feature space. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 1502-1511. Computer Vision Foundation / IEEE (2021)
+22. Johnston, N., Vincent, D., Minnen, D., Covell, M., Singh, S., Chinen, T.T., Hwang, S.J., Shor, J., Toderici, G.: Improved lossy image compression with priming and spatially adaptive bit rates for recurrent networks. In: 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018. pp. 4385-4393. Computer Vision Foundation / IEEE Computer Society (2018)
+23. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: Bengio, Y., LeCun, Y. (eds.) 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings (2015)
+24. Li, M., Zuo, W., Gu, S., You, J., Zhang, D.: Learning content-weighted deep image compression. IEEE Trans. Pattern Anal. Mach. Intell. 43(10), 3446-3461 (2021)
+25. Lin, J., Liu, D., Li, H., Wu, F.: M-LVC: multiple frames prediction for learned video compression. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020. pp. 3543-3551. Computer Vision Foundation / IEEE (2020)
+26. Liu, J., Lu, G., Hu, Z., Xu, D.: A unified end-to-end framework for efficient deep image compression. arXiv preprint arXiv:2002.03370 (2020)
+27. Lu, G., Cai, C., Zhang, X., Chen, L., Ouyang, W., Xu, D., Gao, Z.: Content adaptive and error propagation aware deep video compression. In: Vedaldi, A., Bischof, H., Brox, T., Frahm, J. (eds.) Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II. Lecture Notes in Computer Science, vol. 12347, pp. 456-472. Springer (2020)
+28. Lu, G., Ouyang, W., Xu, D., Zhang, X., Cai, C., Gao, Z.: DVC: an end-to-end deep video compression framework. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019. pp. 11006-11015. Computer Vision Foundation / IEEE (2019)
+
+29. Minnen, D., Balle, J., Toderici, G.: Joint autoregressive and hierarchical priors for learned image compression. In: Bengio, S., Wallach, H.M., Larochelle, H., Grauman, K., Cesa-Bianchi, N., Garnett, R. (eds.) Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada. pp. 10794-10803 (2018)
+30. Minnen, D., Singh, S.: Channel-wise autoregressive entropy models for learned image compression. In: IEEE International Conference on Image Processing, ICIP 2020, Abu Dhabi, United Arab Emirates, October 25-28, 2020. pp. 3339-3343. IEEE (2020)
+31. Ohm, J.R., Sullivan, G.J.: Versatile video coding-towards the next generation of video compression. In: Picture Coding Symposium. vol. 2018 (2018)
+32. Park, T., Liu, M., Wang, T., Zhu, J.: Semantic image synthesis with spatially-adaptive normalization. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019. pp. 2337-2346. Computer Vision Foundation / IEEE (2019)
+33. van Rozendaal, T., Huijben, I.A.M., Cohen, T.: Overfitting for fun and profit: Instance-adaptive data compression. In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net (2021)
+34. Skodras, A., Christopoulos, C.A., Ebrahimi, T.: The JPEG 2000 still image compression standard. IEEE Signal Process. Mag. 18(5), 36-58 (2001)
+35. Song, M., Choi, J., Han, B.: Variable-rate deep image compression through spatially-adaptive feature transform. In: 2021 IEEE/CVF International Conference on Computer Vision, ICCV 2021, Montreal, QC, Canada, October 10-17, 2021. pp. 2360-2369. IEEE (2021)
+36. Sullivan, G.J., Ohm, J., Han, W., Wiegand, T.: Overview of the high efficiency video coding (HEVC) standard. IEEE Trans. Circuits Syst. Video Technol. 22(12), 1649-1668 (2012)
+37. Toderici, G., O'Malley, S.M., Hwang, S.J., Vincent, D., Minnen, D., Baluja, S., Covell, M., Sukthankar, R.: Variable rate image compression with recurrent neural networks. In: Bengio, Y., LeCun, Y. (eds.) 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings (2016)
+38. Toderici, G., Vincent, D., Johnston, N., Hwang, S.J., Minnen, D., Shor, J., Covell, M.: Full resolution image compression with recurrent neural networks. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017. pp. 5435-5443. IEEE Computer Society (2017)
+39. Wallace, G.K.: The JPEG still picture compression standard. Commun. ACM 34(4), 30-44 (1991)
+40. Wang, X., Jiang, W., Wang, W., Liu, S., Kulis, B., Chin, P.: Substitutional neural image compression. CoRR abs/2105.07512 (2021), https://arxiv.org/abs/2105.07512
+41. Wang, X., Yu, K., Dong, C., Loy, C.C.: Recovering realistic texture in image superresolution by deep spatial feature transform. In: 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018. pp. 606-615. Computer Vision Foundation / IEEE Computer Society (2018)
+42. Wang, Z., Simoncelli, E.P., Bovik, A.C.: Multiscale structural similarity for image quality assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003. vol. 2, pp. 1398-1402. IEEE (2003)
+
+43. Wiegand, T., Sullivan, G.J., Bjøntegaard, G., Luthra, A.: Overview of the H.264/AVC video coding standard. IEEE Trans. Circuits Syst. Video Technol. 13(7), 560-576 (2003)
+44. Wu, C., Singhal, N., Krahenbuhl, P.: Video compression through image interpolation. In: Ferrari, V., Hebert, M., Sminchisescu, C., Weiss, Y. (eds.) Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part VIII. Lecture Notes in Computer Science, vol. 11212, pp. 425-440. Springer (2018)
+45. Wu, Y., Li, X., Zhang, Z., Jin, X., Chen, Z.: Learned block-based hybrid image compression. IEEE Trans. Circuits Syst. Video Technol. 32(6), 3978-3990 (2022)
+46. Xie, Y., Cheng, K.L., Chen, Q.: Enhanced invertible encoding for learned image compression. In: Shen, H.T., Zhuang, Y., Smith, J.R., Yang, Y., Cesar, P., Metze, F., Prabhakaran, B. (eds.) MM '21: ACM Multimedia Conference, Virtual Event, China, October 20 - 24, 2021. pp. 162-170. ACM (2021)
+47. Xue, T., Chen, B., Wu, J., Wei, D., Freeman, W.T.: Video enhancement with task-oriented flow. International Journal of Computer Vision 127(8), 1106-1125 (2019)
+48. Yang, F., Herranz, L., Cheng, Y., Mozerov, M.G.: Slimmable compressive autoencoders for practical neural image compression. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 4998-5007. Computer Vision Foundation / IEEE (2021)
+49. Yang, Y., Bamler, R., Mandt, S.: Improving inference for neural image compression. In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., Lin, H. (eds.) Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual (2020)
+50. Zhu, Y., Yang, Y., Cohen, T.: Transformer-based transform coding. In: International Conference on Learning Representations (2022)
\ No newline at end of file
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/images.zip b/contentadaptivelatentsanddecoderforneuralimagecompression/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..71dcd1c0d698fa910c04eb59e9b72a8eb3f7950e
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0ba3618b6eb06aae0d08e4421713190614414f7bbcf7eebc11d071f6837e0e7
+size 482224
diff --git a/contentadaptivelatentsanddecoderforneuralimagecompression/layout.json b/contentadaptivelatentsanddecoderforneuralimagecompression/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b9c29135500544e200479a533ce8b24e191debde
--- /dev/null
+++ b/contentadaptivelatentsanddecoderforneuralimagecompression/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:abf48c7e837ffd443e00ec5cd3f8e04f9ebedbc1a1d40e6ef46ca421c14022d0
+size 456404
diff --git a/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_content_list.json b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..10ff799e20412a826b07989fb7f40137a6236d48
--- /dev/null
+++ b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b70464c9f5091db16eae10c2b29e6d910d6c63548c8cf0fe4be3a319ad56cac7
+size 69926
diff --git a/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_model.json b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7429c6bef1972f604683f4b9a2ef2452a9e4f30e
--- /dev/null
+++ b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:edfbfae253dfa63332105fed2d3f47bcdaa28ba58f467e11034c81780409b7fc
+size 83062
diff --git a/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_origin.pdf b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ee29f15260865a60c38669300b8b75a0a6e5c9b4
--- /dev/null
+++ b/contentorientedlearnedimagecompression/c3d9ceca-25a3-43d9-93d3-ffbf4c134d4f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10298bd74b4fc62aa0e006cec69f2a83913d071701790eb4c820a9520bf73ff4
+size 6269990
diff --git a/contentorientedlearnedimagecompression/full.md b/contentorientedlearnedimagecompression/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..133a48f5058f6e57f5efb08cb06f02740e7ced57
--- /dev/null
+++ b/contentorientedlearnedimagecompression/full.md
@@ -0,0 +1,303 @@
+# Content-Oriented Learned Image Compression
+
+Meng Li, Shangyin Gao, Yihui Feng, Yibo Shi, and Jing Wang
+
+Huawei Technologies, Beijing, China
+
+wangjing215@huawei.com
+
+Abstract. In recent years, with the development of deep neural networks, end-to-end optimized image compression has made significant progress and exceeded the classic methods in terms of rate-distortion performance. However, most learning-based image compression methods are unlabeled and do not consider image semantics or content when optimizing the model. In fact, human eyes have different sensitivities to different content, so the image content also needs to be considered. In this paper, we propose a content-oriented image compression method, which handles different kinds of image contents with different strategies. Extensive experiments show that the proposed method achieves competitive subjective results compared with state-of-the-art end-to-end learned image compression methods or classic methods.
+
+Keywords: Image compression $\cdot$ Content-oriented $\cdot$ Loss metric.
+
+# 1 Introduction
+
+An uncompressed image usually contains tremendous data that is expensive to store or transmit. Therefore, image compression, or image codec, which aims to reduce redundant information in image data for efficient storage and transmission, is an essential part of real-world applications. The frameworks of traditional image compression methods such as JPEG [25], JPEG2000 [24] and BPG [6] are sophisticated designed, which usually include modules of prediction, transformation, quantization, and entropy coding. However, each module in the frameworks is optimized separately, making it hard to achieve global optimality.
+
+In recent years, with the development of deep learning, end-to-end (E2E) learned image compression methods are proposed. Compared with traditional CODECs, the biggest advantage of E2E methods is that the whole framework can be jointly optimized, making it has a greater potential in compression efficiency. Impressively, it takes only five years for E2E image compression to outpace the traditional methods that have developed for 30 years in terms of rate-distortion performance. Mainstream E2E image compression methods rely on the variational autoencoder(VAE) [3] [4] [15] [21] or generative adversarial network (GAN) [1] [2] [20] [22] to compress images, and various loss metrics such as Mean Squared Error (MSE), Multi-Scale Structural Similarity Index (MS-SSIM) [27], Learned Perceptual Image Patch Similarity (LPIPS) [28], etc. are used to optimize the model. Most existing methods optimized all regions of
+
+
+Fig. 1. Reconstructed image with different methods at a similar bitrate.
+
+the image in the same way, and have different distortions at low bit rates. For example, Minnen [21] used MSE metric to train a VAE image compression network. In this optimization, structural information such as text and lines are correctly perserved, but the reconstructed image will become too blurry. Mentzer [20] tried to improve the image quality by introducing GAN and LPIPS. In this optimization, the informative details are well preserved, but the structural information is distorted, such as distorted text, warped face (demonstrate in the left part of Fig.1).
+
+Image content plays an important role in human perception, and human eyes have different sensitivities to different content. However, the influence of image content has been largely ignored in learning-based image compression. Different regions of the images have different properties, so the training strategy should also be different. For example, pixels in flat or texture regions are strongly correlated, and it is better to use loss metrics with a large receptive field. In contrast, pixels in edge or structure regions have little correlation with their neighborhoods, and it is better to use loss metrics with a small receptive field. The usage of paintbrushes is a good analogy to describe it, large paintbrushes are usually used to make large textures and to lay large color blocks, while small paintbrushes are usually used to draw fine lines and color dots. Besides, for some special regions, like small face, it is needed to use more strict constraints to avoid deformation. As a result, to address the problems above, we propose a content-oriented image compression scheme, which is suitable for most of the existing frameworks. Specifically, in the training stage, we divide the image into different regions, and use different loss metrics according to their characteristics.
+
+To the best of our knowledge, this is the first content-oriented image compression method that improves the visual perceptual quality without changing the architecture. An instance is shown in Fig. 1, which demonstrates the superiority of our method. The contributions of this paper are summarized as follows:
+
+1. We propose a content-oriented E2E image compression scheme, in which we use different loss metrics in different regions. The region masks are used only in the training stage, and no extra information is needed in the encoding and decoding stage.
+
+2. To evaluate the scheme, we design a GAN-based architecture as an instance to show the effectiveness. Several classic and E2E methods are used for comparison, and our method shows the best performance.
+
+# 2 Related Work
+
+# 2.1 Loss metrics
+
+MAE/MSE Loss MSE and the mean absolute error (MAE) are two of the most commonly used loss metrics in image compression. MAE and MSE metrics assume pixel-wise independence, and constrains the accuracy of the corresponding pixels. However, the main drawback of MSE loss metric mostly yields an oversmoothed reconstruction, which results in a lack of high-frequency details in the edges and textures. Given an image $x$ and its reconstructed version $\tilde{x}$ , the MAE and MSE loss are computed by:
+
+$$
+\begin{array}{l} \mathcal {L} _ {m a e} = \mathbb {E} \| x - \tilde {x} \| _ {1} \\ \vdots \\ \mathbb {E} ^ {\prime \prime} \sim^ {\prime \prime} 2 \end{array} \tag {1}
+$$
+
+$$
+\mathcal {L} _ {m s e} = \mathbb {E} \| x - \tilde {x} \| _ {2} ^ {2}
+$$
+
+Laplacian Loss Laplacian is a differential operator given by the divergence of the gradient, which is always used to detect the high-frenquency component of images. The Laplacian loss is defined as the mean-squared distance between their Laplacians:
+
+$$
+\mathcal {L} _ {l a p} = \mathbb {E} \| L (x) - L (\tilde {x}) \| _ {2} ^ {2} \tag {2}
+$$
+
+Where $\mathcal{L}_{\mathrm{lap}}$ is the Laplacian loss value. As shown in Eq.2, it is also a point-to-point loss metric, which constrains the Laplacians of the corresponding location. By doing this, the high-frenquency component of the area is preserved.
+
+LPIPS Loss LPIPS is a state-of-the-art perceptual metric proposed by Zhang [28]. He uses architectures trained for classification as feature extractors, and leverages the power of the features to judge the similarity between the reconstructed image and the original one, which is computed by:
+
+$$
+\mathcal {L} _ {l p i p s} = \sum_ {k} \tau^ {k} \left(f ^ {k} (x) - f ^ {k} (\tilde {x})\right) \tag {3}
+$$
+
+where $f$ denotes the feature extractor, and $\tau^k$ computes the score of features from the k-th layer of the architecture. The LPIPS value is the averaged score of all layers. It is a loss metric with a large receptive field, which constrains the
+
+distribution of corresponding location. The LPIPS metrics makes images more semantically similar, which is more consistent with human perception. However, the absence of point to point constraints may result in geometric distortion.
+
+GAN Loss GAN is widely used for perceptual image compression. By taking advantage of adversarial training, GAN-based architectures can produce more photo-realistic images. It contains two rivaling networks: the generator $\mathrm{G}$ is used to generate an image $\tilde{x} = G(\hat{y})$ that is consistent with the input image distribution $p_{\boldsymbol{x}}$ , and the discriminator $\mathrm{D}$ is used to predict if the input image is an image generated by $\mathrm{G}$ . The goal of GAN for $\mathrm{G}$ is to produce images that are real enough to fool $\mathrm{D}$ . In the procedure of training, the image produced by $\mathrm{G}$ becomes more and more authentic, and $\mathrm{D}$ becomes more and more discriminating, finally reaching a balance.
+
+# 2.2 learned image compression methods
+
+Many E2E image compression methods take advantage of VAE as its backbone, which usually consists of four components: the encoder, the quantizer, the entropy module and the decoder. The encoder is used to encode the input image $x$ into a latent representation $y$ , which is then quantized to $\hat{y}$ by the quantizer. The entropy module, which is used to estimate the distribution of $\hat{y}$ , plays an important role in minimizing the rate-distortion cost. Finally, the quantified feature $\hat{y}$ is transformed to reconstruct the image $\tilde{x}$ . The framework is directly optimized for the rate-distortion trade-off, that is: $\mathcal{L}_{RD} = R + \lambda d$ . Where $R$ represents the bitrate which is lower-bounded by the entropy of the discrete probability distribution of $\hat{y}$ , $d$ is the reconstruction distortion, $\lambda$ controls the trade-off. The framework is first proposed by Balle in reference [3], where they introduced the widely used generalized divisive normalization (GDN) transform. In their following works, they proposed the hyper prior [4] to better exploit the probability distribution of the latent feature. And in [21] and [15], spacial context structure is proposed to improve the performance of the entropy module.
+
+On the basis of above works, some researchers proposed to use GAN and some perceptual metrics (e.g. LPIPS) to improve the visual perceptual quality. Rippel [22] first introduced the effectiveness of GAN in generating perceptual friendly images at an extremely low bitrate. In the following works, Agustsson [1], Akutsu [2], Dash [10] also make use of GAN loss to improve the perceptual quality of reconstruction images. According to rate-distortion-perception theory presented in [5], Mentzer combines MSE (Mean squared error), LPIPS and GAN loss to generate images of competitive perceptual quality [20]. In this paper, we also use a GAN-based architecture, and what distinguishes us from previous works is that we take the image contents into consideration, and adopt different strategies on different target regions.
+
+Another related topic of the work is content-related image compression. Li introduced a content-weighted importance map to guide the allocation of local bit rate [17]. Similarly, Cai proposed a CNN based ROI image compression
+
+method to allocate more bits to the ROI areas [7]. Besides, Zhang proposed an attention-guided dual-layer image compression, which employs a CNN module to predict those pixels on and near a saliency sketch within ROI that are critical to perceptual quality [29]. However, most of the existing content-related works need to change the architecture and allocate more bits in important fields, thus increasing the network complexity and reducing the compression efficiency. Different from above, we proposed a content-oriented image compression method by adopting different loss strategies on different areas. The advantage is that our scheme can be applied in most of the previous works without changing the architecture. Besides, the image content masks are learned by the network during the training, so no extra information is needed when encoding or decoding an image.
+
+# 3 Method
+
+# 3.1 Framework of our method
+
+
+Fig. 2. Framework of our method.
+
+From Section 2.1, it is easy to deduce that different loss functions are suitable for different image contents. However, existing learned image compression always optimizes the whole image with the same loss function. In existing content-related image compression methods, important maps [17], ROI masks [7], or other extra information need to be encoded as part of the codestream. One the one hand, such methods require changing the encoder-decoder structure to make the architecture more complex by adding a special module to extract the important maps or ROI masks, on the other hand, they also increase the extra
+
+bits that inevitably degrade the coding efficiency. This problem can be overcome if the architecture is 'clever' enough to distinguish different image contents and employ different compression strategies. The whole framework of our method is shown in Fig.2. The mask information is only used to select different loss functions during the training phase and not needed in the inference phase.
+
+As shown in Fig.2, E2E image compression is transformed from unlabeled to labeled learning. The choice of the loss functions depends on the classification of image regions. According to the previous analysis, we divide the image into three image regions, namely texture region, structure region, and small face region.
+
+Structure Region Structure regions usually have strong gradients and have little statistical correlation with very close neighborhoods due to the abrupt changes in pixels. And loss function with large receptive field will introduce additional noise, which is not acceptable for a precise edge reconstruction. The human eye is sensitive to the sharpness and the pixel-wise correctness of the structure, so a point-wise loss function is more suitable. However, MSE will lead to a blurred reconstruction, affecting the subjective visual perception. As shown in Fig.3 [19], considering a simple 1-dimensional case. If the model is only optimized in image space by the L1 or MSE loss, we usually get a reconstructed sequence as Fig.3(b) given an input testing sequence whose ground-truth is a sharp edge as Fig.3(a). The model fails to recover sharp edges for the reason that the model tends to give a statistical average. If a second-order gradient constraint is added to the optimization objective as Fig.3(f), the probability of recovering Fig.3(c) is increased significantly. As a result, we choose the Laplacian loss in structure region. The structure loss function is as follows:
+
+$$
+\mathcal {L} _ {s t r u} = M _ {s t r u} \circ \mathcal {L} _ {l a p} \tag {4}
+$$
+
+where $M_{stru}$ denotes the mask of the structure region, $\mathcal{L}_{lap}$ is computed with Eq.2. We use Laplacian edge detector to generate the $M_{stru}$ , which will be introduced in Section 4.1.
+
+
+Fig.3. An illumination of a simple 1-D case. The first row shows the pixel sequences and the second row shows their corresponding gradients.
+
+Texture Region Unlike structure regions, texture regions always have more details and domain pixels are highly correlated. It is difficult for the human eyes to perceive pixel-by-pixel correctness, and people are more concerned about the distribution of the texture. Existing perceptual optimization based methods [20] have achieved very compelling texture reconstruction results. Therefore, we use the perceptual loss in this region. In our work, the perceptual loss is constituted of three parts: MAE loss, LPIPS loss, and GAN loss. The formulation can be denoted by:
+
+$$
+\mathcal {L} _ {p e r} = M _ {t e x} \circ (\alpha \cdot \mathcal {L} _ {m a e} + \beta \cdot \mathcal {L} _ {L P I P S} + \delta \cdot \mathcal {L} _ {G A N}) \tag {5}
+$$
+
+where $M_{tex}$ denotes the mask of the texture region, $\mathcal{L}_{mae}$ , $\mathcal{L}_{LPIPS}$ are computed with Eqs.1, 3, $\mathcal{L}_{GAN}$ will be introduced in Section 3.2. In our work, the VGG [23] network is chosen as the backbone to compute the LPIPS loss.
+
+Small Face Region In our framework, the facial regions will be classified as texture regions and optimised with perceptual loss if not intervened. In this case, larger faces can be well reconstructed, but small faces may be warped, as shown on the left side of Fig.1. Therefore, we adopt a different loss function for regions of the small faces. Generally, people are very sensitive to the correctness of the face structure, for which an accurate reconstruction is necessary. Therefore, we use a stricter constraint loss, the MSE loss, for the facial image reconstruction.
+
+$$
+\mathcal {L} _ {s f a c e} = M _ {s f a c e} \circ \mathcal {L} _ {m s e} \tag {6}
+$$
+
+where the $M_{\text{face}}$ denotes the mask of the small face regions, and $\mathcal{L}_{mse}$ is computed with Eq.1. We use the well-known YOLO-face to detect the faces in the image, and $\mathcal{L}_{\text{face}}$ is only adopted to small faces. The bitrate of the quantized latent representation $\hat{y}$ is estimated by the entropy module denoted by P, $R(\hat{y}) = -\log(P(\hat{y}))$ . Finally, the loss function of the whole image is summarized as:
+
+$$
+\mathcal {L} _ {\text {t o t a l}} = \eta R (\hat {y}) + \epsilon \mathcal {L} _ {\text {s t r u}} + \mathcal {L} _ {\text {p e r}} + \gamma \mathcal {L} _ {\text {s f a c e}} \tag {7}
+$$
+
+where $\eta$ , $\epsilon$ and $\gamma$ are weights of corresponding loss metrics. Because people usually pay more attention to faces of the images, we intentionally allocate more bits on small faces by using a larger $\gamma$ . Note that the masks are binary-valued and mutually exclusive. And the priority of the masks is different, specifically, from high to low: the facial mask, the structure mask and the texture mask. In other words, the structure mask doesn't cover the facial areas, and the texture mask doesn't cover the facial and structure areas.
+
+# 3.2 Architecture
+
+To prove the effectiveness of our method, we design an E2E image compression architecture, as shown in Fig.4. It consists of four parts: the encoder $\mathrm{E}$ , the decoder/generator $\mathrm{G}$ , the entropy module $\mathrm{P}$ , and the discriminator $\mathrm{D}$ .
+
+
+Fig. 4. The architecture of our method. Conv192 - 5 × 5 is a convolution with 192 output channels, with 5 × 5 filters. DeConv is a deconvolution operation. s2 means the stride of this convolution or deconvolution is 2. Ave means average pooling. GDN or ReLU is used to increase the non-linearity.
+
+Autoencoder For the encoder and generator/decoder, GDN [3] is used to normalize the intermediate feature and also play a role of non-linearity element. Besides, to capture the global dependencies between features, we introduced the attention module (the residual non-local attention block, RNAB) [30] integrated into the architecture. It is well-known that deconvolution operation, or transposed convolution always generates checkerboard artifacts on the reconstructed image. The main reason is, the up-sampled feature map generated by deconvolution can be considered as the result of periodical shuffling of multiple intermediate feature maps computed from the input feature map by independent convolutions [12]. As a result, adjacent pixels on the output feature map are not directly related, resulting in checkerboard artifacts. To alleviate this issue, we add an extra average pooling layer after every deconvolution layer to strengthen the association between adjacent pixels.
+
+Entropy model We adopt the context-based model [21] to extract side information $z$ , which is used to model the distribution of latent representation $\hat{y}$ . And uniform noise $\mathrm{U}(-1/2, 1/2)$ is used to simulate quantization in the hyper-encoder and when estimating $p(\hat{y} | z)$ . The distribution of $\hat{y}$ is modeled with an asymmetric Gaussian entropy model [9], which can be denoted by:
+
+$$
+p _ {\hat {y} | \hat {z}} (\hat {y} \mid \hat {z}) \sim N \left(\mu , \sigma_ {l} ^ {2}, \sigma_ {r} ^ {2}\right) \tag {8}
+$$
+
+where $\mu$ represents the mean of the latent representation, $\sigma_l^2$ and $\sigma_r^2$ represent the estimated left-scale and right-scale parameter, respectively. The asymmetric
+
+Gaussian model has stronger representation ability when the entropy estimation do not obey the Gaussian distribution.
+
+Discriminator In our framework, adversarial training is adopted to improve the perceptual quality of the reconstructed images. Instead of a standard discriminator, we borrow the relativistic average discriminator [13] used in [26], which tries to predict the probability that a groundtruth image $x$ is relatively more realistic than a generated one $\tilde{x}$ , on average. The loss is divided into two parts, the generator loss $\mathcal{L}_D^{Ra}$ , and the discriminator loss $\mathcal{L}_G^{Ra}$ :
+
+$$
+\begin{array}{l} \mathcal {L} _ {D} ^ {R a} = - \mathbb {E} _ {x} \left[ \log \left(D _ {R a} (x, \tilde {x})\right) \right] - \mathbb {E} _ {\tilde {x}} \left[ \log \left(1 - D _ {R a} (\tilde {x}, x)\right) \right] \\ \mathcal {L} _ {G} ^ {R a} = - \mathbb {E} _ {x} \left[ \log \left(1 - D _ {R a} (x, \tilde {x})\right) \right] - \mathbb {E} _ {\tilde {x}} \left[ \log \left(D _ {R a} (\tilde {x}, x)\right) \right] \\ \end{array}
+$$
+
+where $D_{Ra}(x, \tilde{x}) = \sigma(C(x) - \mathbb{E}_{\tilde{x}}[C(\tilde{x})])$ . $C(x)$ and $C(\tilde{x})$ are the nontransformed discriminator output. $\sigma$ is the sigmoid function, and $\mathbb{E}_x[\cdot]$ computes the average output. Moreover, the PatchGAN discriminator [16], which has been proven to improve the quality of the generated images, is also utilized in our architecture. The PatchGAN has fewer parameters. And it not only preserves more texture but can also be applied to images of arbitrary sizes. The detailed architecture of our discriminator is shown in Fig.5.
+
+
+Fig. 5. The architecture of discriminator. Same notation is used as in Fig.4.
+
+# 3.3 Implementation of masked perceptual loss
+
+Usually, Adding a pixel-level mask to MSE or MAE is easy with simple pointwise multiplication. But it is a little harder to used on LPIPS or GAN losses, because these two loss functions compute the feature losses and cannot correspond to mask pixel-to-pixel. In this section, we propose a method called 'real value replacement' to solve the problem.
+
+Consider the mask $M_{\text{tex}}$ , the original image $x$ , and the reconstructed image
+
+$\tilde{x}$ , we replace the value of the mask part of $\tilde{x}$ with the corresponding value of $x$ to get the replaced reconstructed image $\tilde{x}^{\prime}$ :
+
+$$
+\tilde {x} ^ {\prime} = \left(1 - M _ {t e x}\right) \circ x + M _ {t e x} \circ \tilde {x} \tag {10}
+$$
+
+Then calculate the loss function directly with $x$ and $\tilde{x}'$ to estimate the masked loss:
+
+$$
+\begin{array}{l} M _ {t e x} \circ \mathcal {L} _ {L P I P S} (x, \tilde {x}) \approx \mathcal {L} _ {L P I P S} (x, \tilde {x} ^ {\prime}) \\ M _ {t e x} + \mathcal {L} _ {m a x} (x, \tilde {x}) + \mathcal {L} _ {m a x} (x, \tilde {x} ^ {\prime}) \end{array} \tag {11}
+$$
+
+$$
+M _ {t e x} \circ \mathcal {L} _ {G A N} (x, \tilde {x}) \approx \mathcal {L} _ {G A N} (x, \tilde {x} ^ {\prime})
+$$
+
+# 4 Experiment
+
+# 4.1 Training Details
+
+Due to the adoption of face loss, a large number of face images are required for training. For this purpose, we use the well-known MSCOCO dataset [18] as our training set, and Kodak dataset [14] as our testing set. It is notoriously hard to train GANs for image generation, so the training procedure is divided into two stages. In the first stage, we only use the MSE as the distortion loss to guide the optimization at the pixel level reconstruction. The optimization target in the first stage is to minimize $\mathcal{L}_{RD} = \eta R + \mathcal{L}_{mse}$ . Using the first stage result as the pre-trained model, we can train the perceptual optimized model with the loss function Eq.7 mentioned in section 3.2 in the second stage. During the training phase, we randomly crop the images into patches of size $256 \times 256$ and set the batch size to 8. The initial learning rate is set to 0.0001 and halved at 160k and 500k iteration. We use kaiming initialization [11] to initialize all our models. The weights of the loss are set: $\alpha = 0.01$ , $\beta = 1$ , $\gamma = 0.2$ , $\delta = 0.0005$ , and $\epsilon = 0.3$ . We only modify $\eta$ for different target bit-rates.
+
+In order to use different loss metrics on different regions of the images, the masks of different content regions are required. In our experiment, the faces in the images are detected using the well-knownYOLO-face [8]. Then the coordinate information of the faces is stored in an XML file, which is used to generate the face masks in the training phase. By doing this, we can save the face detection time during training the model. For structure region masks, due to the low complexity of edge detection, we do not generate masks in advance, but directly use Laplacian edge detectors to detect structure regions during training.
+
+# 4.2 Ablation Study
+
+Ablation on the loss metric In order to show the effectiveness of the proposed, we conduct several comparative experiments as follows.
+
+Case 1, the model is optimized only with MSE loss. (MSE)
+- Case 2, the model is optimized with MAE, LPIPS and GAN loss. (Perceptual)
+- Case 3, the model is optimized with MAE, LPIPS, GAN and Laplacian loss. (Perceptual + Lap)
+
+
+Fig. 6. Comparison of different loss strategies.
+
+
+(a) with HIFIC discriminator
+
+
+(b) with our discriminator
+
+
+(a) without average pooling
+Fig. 7. Comparison of the discriminators. Fig. 8. Ablation on the average pooling.
+
+
+(b) with average pooling
+
+- Case 4, the model is optimized with MAE, LPIPS, GAN, Laplacian and face loss. (Perceptual + Lap & face)
+
+Take the image kodim14 an example, the visual comparison of different cases is shown in Fig.6. All of these cases are compressed at a similar bitrate, around 0.2 bpp. Overall, it can be clearly observed that the reconstructed image in case 5 has high-fidelity facial features, clear and correct text, informatively detailed backgrounds and an overall harmonious visual quality. Specifically, in case 1, the faces and water waves are too blurred, which attributes to the property of the MSE loss function. In case 2, with the help of additional loss functions GAN and LPIPS, the informative details of water waves are restored, but the facial features and text are severely warped. In case 3, with the help of additional edge loss, not only the informative details of water waves are restored, but the text distortion phenomenon also disappears. However, the facial distortion remains. Until all the losses are added, in case 5, the best visual effect is achieve in all the areas. Through the ablation study, we can draw two conclusions: (1) the architecture proposed in 3.3 is able to distinguish different image contents; (2) adopting appropriate loss function for different image content helps improve the visual quality of reconstructed images.
+
+
+Fig. 9. Compressed results of kodim18 using different methods.
+
+Ablation on the architecture In order to get better result, we choose the better components in our architecture, such as the asymmetric Gaussian entropy model, the relatively average discriminator, and the average pooling. We have done relevant experiments to demonstrate the effectiveness of our architecture. The results show that with the help of the asymmetric Gaussian model, we achieve about $0.68\%$ BD-rate reduction compared with the general Gaussian entropy model. We also tested the effectiveness of our discriminator, and the result shown in Fig.7 proves that our discriminator can preserve more details than that of HIFIC. Besides, Fig.8 shows that the average polling can alleviate the checkerboard artifacts.
+
+# 4.3 Visual Results
+
+To show the advantage of our method, we compare our method (named COLIC) with BPG, Asymmetric Gained Deep Image Compression (AGDIC) optimized with MSE [9] and High-Fidelity Generative Image Compression (HIFIC, SOTA
+
+perceptual optimized method) [20]. Since BPG and AGDIC are not perceptual-optimized, we select relatively higher bitrates for them. The visual results are shown in Fig.9, in which the cropped blocks highlight the reconstruction of certain regions, such as textures, texts, and small faces. As can be seen from Fig.9, although BPG and AGDIC can maintain the correct facial structure and achieve relatively better results in text area, the texture results are over-smoothed. As shown in the third row, the background generated by BPG and AGDIP is too blurry. On the contrary, although HIFIC can reconstruct the informative details, it will lead to the distortion of face and text. As shown in the second and fifth rows, the face and text generated by HIFIC are overwarpped. Compared to these results, it is clear that our proposed COLIC achieves the best visual effects. It handles all these situations better, recovering more texture detail, correct small face and text structure.
+
+More examples of comparison with HIFIC are shown in Fig.10. Compared with HIFIC, COLIC can not only recover similar informative texture regions, such as the spray, but also better structured regions such as lines, textures and small faces. In a word, COLIC can achieve better visual effects.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Fig. 10. Compressed results of kdim18 using different methods.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Fig. 11. Rate-distortion and -perception curves on Kodak. Arrows indicate whether lower is better $(\downarrow)$ , or higher is better $(\uparrow)$ .
+
+
+
+
+
+# 4.4 Statistics result
+
+In this section, we use metrics such as PSNR, SSIM, and FID to quantify our results. PSNR and SSIM are widely used in various digital image evaluations, which compute the average pixel-wise distance and structural similarity between the two images. Unlike PSNR, SSIM, which measure the similarity between individual images pairs, FID assesses the similarity between the distribution of the reference images and the generated/distorted images. FID is a good metric for evaluating the subjective results and is widely used for super-resolution or generative tasks.
+
+The R-D curves of COLIC, BPG, AGDIC and HIFIC are shown in Fig.11. Compared with BPG and AGDIC, as expected, COLIC and HIFIC dominate in perceptual metric FID, but relatively poor on objective metrics PSNR and SSIM, which can be explained by the rate-distortion-perception theory [5] that they sacrifice some objective performance to improve the perceptual quality. In order to improve the visual quality, we sacrifice some of the objective metrics. Compared with HIFIC, COLIC achieves better results on both objective and perceptual metrics. It attributes to the better optimization loss that imposes the correct constraints on the structure region, the better network structure that with better reconstruction ability, and better training strategy.
+
+# 5 Conclusion
+
+In this work, we propose a content-oriented image compression scheme, which can be used in most existing methods. We suggest that different loss metrics should be used on different image contents according to their characteristics. And a GAN-based architecture is designed to prove the effectiveness of our scheme. Experiments clearly show the superiority of our method on visual quality as well as different metrics. In fact, the effectiveness of this method demonstrates that existing encoders and decoders are 'smart' enough to distinguish different image regions and employ different reconstruction strategies with the guidance of different training loss. Therefore, human perceptual priors can be better utilized through supervised training methods to obtain better subjective results.
+
+# References
+
+1. Agustsson, E., Tschannen, M., Mentzer, F., Timofte, R., Van Gool, L.: Generative adversarial networks for extreme learned image compression. In: 2019 IEEE/CVF International Conference on Computer Vision (ICCV). pp. 221-231 (2019). https://doi.org/10.1109/ICCV.2019.00031
+2. Akutsu, H., Suzuki, A., Zhong, Z., Aizawa, K.: Ultra low bitrate learned image compression by selective detail decoding. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). pp. 524-528 (2020). https://doi.org/10.1109/CVPRW50498.2020.00067
+3. Balle, J., Laparra, V., Simoncelli, E.: End-to-end optimized image compression. In: Proceedings of the International Conference on Learning Representations (ICLR) (April 2017)
+4. Balle, J., Minnen, D., Singh, S., Hwang, S., Johnston, N.: Variational image compression with a scale hyperprior. In: Proceedings of the International Conference on Learning Representations (ICLR) (April 2018)
+5. Blau, Y., Michaeli, T.: Rethinking lossy compression: The rate-distortion-perception tradeoff. In: Chaudhuri, K., Salakhutdinov, R. (eds.) Proceedings of the 36th International Conference on Machine Learning. vol. 97, pp. 675-685 (Jun 2019)
+6. BPG: Bpg image format (2014), accessed 7 March 2022. https://bellard.org/bpg/
+7. Cai, C., Chen, L., Zhang, X., Gao, Z.: End-to-end optimized roi image compression. IEEE Transactions on Image Processing 29, 3442-3457 (2020). https://doi.org/10.1109/TIP.2019.2960869
+8. Chen, W., Huang, H., Peng, S., Zhou, C., Zhang, C.: Yolo-face: a real-time face detector. The Visual Computer 37 (04 2021). https://doi.org/10.1007/s00371-020-01831-7
+9. Cui, Z., Wang, J., Gao, S., Guo, T., Feng, Y., Bai, B.: Asymmetric gained deep image compression with continuous rate adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 10532-10541 (June 2021)
+0. Dash, S., Kumaravelu, G., Naganoor, V., Raman, S.K., Ramesh, A., Lee, H.: Compressnet: Generative compression at extremely low bitrates. In: 2020 IEEE Winter Conference on Applications of Computer Vision (WACV). pp. 2314-2322 (2020). https://doi.org/10.1109/WACV45572.2020.9093415
+1. He, K., Zhang, X., Ren, S., Sun, J.: Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In: 2015 IEEE International Conference on Computer Vision (ICCV). pp. 1026-1034 (2015). https://doi.org/10.1109/ICCV.2015.123
+2. Hongyang, G., Hao, Y., Zhengyang, W., Shuiwang, J.: Pixel deconvolutional networks. In: Proceedings of the International Conference on Learning Representations (ICLR) (April 2018)
+3. Jolicoeur-Martineau, A.: The relativistic discriminator: a key element missing from standard gan. In: Proceedings of the International Conference on Learning Representations (ICLR) (May 2019)
+4. Kodak, E.: Kodak lossless true color image suite: Photocd pcd0992 (1993), accessed 7 March 2022. http://r0k.us/graphics/kodak/
+5. Lee, J., Cho, S., Beach, S.K.: Context-adaptive entropy model for end-to-end optimized image compression. In: Proceedings of the International Conference on Learning Representations (ICLR) (August 2018)
+
+16. Li, C., Wand, M.: Precomputed real-time texture synthesis with markovian generative adversarial networks. In: European Conference on Computer Vision (ECCV). pp. 702-716 (September 2016)
+17. Li, M., Zuo, W., Gu, S., Zhao, D., Zhang, D.: Learning convolutional networks for content-weighted image compression. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3214-3223 (2018). https://doi.org/10.1109/CVPR.2018.00339
+18. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dólar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European Conference on Computer Vision (ECCV). pp. 740-755. Springer International Publishing (2014)
+19. Ma, C., Rao, Y., Cheng, Y., Chen, C., Lu, J., Zhou, J.: Structure-preserving super resolution with gradient guidance. pp. 7766-7775 (06 2020). https://doi.org/10.1109/CVPR42600.2020.00779
+20. Mentzer, F., Toderici, G., Tschannen, M., Agustsson, E.: High-fidelity generative image compression. In: Advances in Neural Information Processing Systems (NeurIPS) (06 2020)
+21. Minnen, D., Balle, J., Toderici, G.: Joint autoregressive and hierarchical priors for learned image compression. In: Proceedings of the 32nd International Conference on Neural Information Processing Systems. p. 10794-10803 (2018)
+22. Rippel, O., Bourdev, L.: Real-time adaptive image compression. In: Proceedings of the 34th International Conference on Machine Learning. vol. 70, pp. 2922-2930. PMLR (August 2017)
+23. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. In: International Conference on Learning Representations (2015)
+24. Taubman, David, S.: Jpeg2000: Image compression fundamentals, standards and practice. Journal of Electronic Imaging 11(2), 286 (2002)
+25. Wallace, G.: The JPEG still picture compression standard. IEEE Transactions on Consumer Electronics 38(1), 18-34 (1992). https://doi.org/10.1109/30.125072
+26. Wang, X., Yu, K., Wu, S., Gu, J., Liu, Y., Dong, C., Qiao, Y., Change Loy, C.: Esrgan: Enhanced super-resolution generative adversarial networks. In: Proceedings of the European Conference on Computer Vision (ECCV) Workshops (September 2018)
+27. Wang, Z., Simoncelli, E., Bovik, A.: Multiscale structural similarity for image quality assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems Computers, 2003. vol. 2, pp. 1398-1402 Vol.2 (2003). https://doi.org/10.1109/ACSSC.2003.1292216
+28. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (June 2018)
+29. Zhang, X., Wu, X.: Attention-guided image compression by deep reconstruction of compressive sensed saliency skeleton. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 13354-13364 (June 2021)
+30. Zhang, Y., Li, K., Li, K., Zhong, B., Fu, Y.R.: Residual non-local attention networks for image restoration. ArXiv abs/1903.10082 (2019)
\ No newline at end of file
diff --git a/contentorientedlearnedimagecompression/images.zip b/contentorientedlearnedimagecompression/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c2512cbb061b1575d22ed53e536497a7e98d7c10
--- /dev/null
+++ b/contentorientedlearnedimagecompression/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:831306d326e0581a54bef1c088d524e1190dd6bae10f71929dee40cc4292b8a9
+size 684954
diff --git a/contentorientedlearnedimagecompression/layout.json b/contentorientedlearnedimagecompression/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7985c622532e271ca7b2d59f8446bce43323df50
--- /dev/null
+++ b/contentorientedlearnedimagecompression/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fc407826f458fc6c1eac81f6bde933b5625111d282d69846b6c3698e6acef78d
+size 365219
diff --git a/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_content_list.json b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..95bd5b628441f4c551b47d2d653bafa06049e09a
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb4dfc97c3536d456f7db81ae8362ce667e4958bab19de01229903bfa704a441
+size 77679
diff --git a/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_model.json b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..bfb274466fb72852525d575c8a2a200a5cb2c040
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7979693887f58e2ca149076f224ab5f54af64cbf79b19de0703245bb13558774
+size 97324
diff --git a/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_origin.pdf b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5b53ed56902bedbdfdf3b52b525d4ed118eb324d
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/b5e565b7-fc0b-4a49-8fce-6c97df4658ac_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de1a6024340e0a8116b9f7fb34088ccf70d6566acfa7619e641c4252c1d21038
+size 7154828
diff --git a/contextawarestreamingperceptionindynamicenvironments/full.md b/contextawarestreamingperceptionindynamicenvironments/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b072329cfab024669cebf91ffd8a99c1acc3a0f1
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/full.md
@@ -0,0 +1,289 @@
+# Context-Aware Streaming Perception in Dynamic Environments
+
+Gur-Eyal Sela1, Ionel Gog1*, Justin Wong1, Kumar Krishna Agrawal1, Xiangxi Mo1, Sukrit Kalra1, Peter Schafhalter1, Eric Leong1, Xin Wang2, Bharathan Balaji3*, Joseph Gonzalez1, and Ion Stoica1
+
+1 University of California, Berkeley
+
+2 Microsoft Research
+
+3 Amazon
+
+Abstract. Efficient vision works maximize accuracy under a latency budget. These works evaluate accuracy offline, one image at a time. However, real-time vision applications like autonomous driving operate in streaming settings, where ground truth changes between inference start and finish. This results in a significant accuracy drop. Therefore, a recent work proposed to maximize accuracy in streaming settings on average. In this paper, we propose to maximize streaming accuracy for every environment context. We posit that scenario difficulty influences the initial (offline) accuracy difference, while obstacle displacement in the scene affects the subsequent accuracy degradation. Our method, Octopus, uses these scenario properties to select configurations that maximize streaming accuracy at test time. Our method improves tracking performance (S-MOTA) by $7.4\%$ over the conventional static approach. Further, performance improvement using our method comes in addition to, and not instead of, advances in offline accuracy.
+
+# 1 Introduction
+
+Recent works like EfficientDet [26], YOLO [3], and SSD [16] were designed for real-time computer vision applications that require high accuracy in the presence of latency constraints. However, these solutions are evaluated offline, one image at a time, and do not consider the impact of increase in inference latency on the application performance. In real-time systems such as autonomous vehicles, the models are deployed in an online streaming setting where the ground truth changes during inference time as shown in Figure 1a. To evaluate performance in streaming settings, Li et al. [12] proposed a modified metric that measures the model performance against the ground truth at the end of inference. They evaluated object detection models in a streaming fashion, and found that the average precision of the best performing model drops from 38.0 to 6.2, and picking the model that maximizes streaming average precision reduces the drop to 17.8.
+
+
+(a) In online streaming settings, the environment changes during inference. Streaming accuracy is computed by evaluating the prediction run on ground truth A against ground truth B.
+
+
+(b) Offline and streaming accuracy of a tracker of increasing model size. While the offline MOTA (orange, y-axis) of the model increases as inference latency (x-axis) increases, its streaming MOTA (S-MOTA in blue, y-axis) decreases.
+Fig.1: Streaming accuracy deviates from offline accuracy because the ground truth changes during inference.
+
+We confirm the findings of Li et al. [12], and extend their analysis to object tracking. The standard metric for object tracking is MOTA (multiple object tracking accuracy) [18,11], and we refer to its streaming counterpart as S-MOTA. Figure 1b shows that larger models with higher MOTA deteriorate in S-MOTA for the Waymo dataset [28] as the higher latency widens the gap between ground truth between inference start and finish. The MOTA of the largest model (EfficientDet-D7x) is 38.9 while the S-MOTA is 16.2. The model that maximizes S-MOTA is EfficientDet-D4 with MOTA of 32.1 and S-MOTA of 26.7.
+
+Since environment context varies, to further analyze the tradeoffs between latency and accuracy, we identify the model that maximizes the S-MOTA of 1-second video segment scenarios in the Waymo dataset. We observe that the best performing model varies widely from scenario to scenario (Figure 2). Scenarios that are difficult (e.g., sun glare, drops on camera and reflection) and still (e.g., standing cars in intersection) show (Figure 2 center) benefit from stronger perception while incurring marginal penalty from the latency increase. On the other hand, simple and fast scenes with rapid movement (e.g., turning, in Figure 2 left), behave the opposite, where performance degrades sharply with latency. As a result, at the video segment-level the optimization landscape of streaming accuracy looks vastly different than on aggregate (Figure 1b).
+
+In this paper, we propose leveraging contextual cues to optimize S-MOTA dynamically at test time. The object detection model is just one of several choices that we refer to as metaparameters to consider in an object tracking system. Our method, called Octopus, optimizes S-MOTA at test time by dynamically tuning the metaparameters. Concretely, we train a light-weight second-order model to switch between the metaparameters using a battery of environment features extracted from video segments, like obstacle movement speed, obstacle proximity, and time of day.
+
+Our contributions in this work can be summarized as:
+
+- We are the first to analyze object tracking in a streaming setting. We show that the models that maximize S-MOTA change per scenario and propose that
+
+
+Fig. 2: Offline and streaming accuracies in three different scenarios. While offline MOTA (orange, y-axis) of the EfficientDet [26] models increases as inference latency (x-axis) increases, streaming MOTA (S-MOTA in blue, y-axis), responds depending on the scenario context (frames). Compare these plots to Fig. 1b, which shows the same on average over the entire dataset.
+
+the optimization tradeoffs are a result of scene difficulty as well as obstacle displacement.
+
+- We present a novel method of S-MOTA optimization that leverages contextual features to switch the object tracking configuration at test-time.
+- Our policy improves tracking performance (S-MOTA) by $7.4\%$ over a static approach by evaluating it on the Waymo dataset [28]. We improve S-MOTA by $3.4\%$ when we apply this approach on the Argoverse dataset [5].
+
+# 2 Related Works
+
+Latency vs. accuracy. Prior works have recognized the tension between latency and accuracy in perception models [3,7,9,26], and examined facets of the tradeoff between decision speed vs. accuracy [24]. However, these works study this tradeoff in offline static settings. Li et al [12] examine this tradeoff in streaming settings, where the ground truth of the world changes continuously. They show that conventional accuracy misrepresents perception performance in such settings, and proposed streaming accuracy. Their results were shown in detection (as well as semantic segmentation [6]), so we first verified that the idea also holds in tracking. Further, while Li et al. maximize streaming accuracy on average, we expose how the environment context plays a crucial role on its behavior. We leverage the context to dynamically maximize streaming accuracy at test time.
+
+Model serving optimization and dynamic test-time adaptation. To reduce the inference latency, techniques such as model pruning [8,13,17] and quantization [23,29,31] have been proposed. While these techniques focus on effectively reducing the size of the models, our focus is on the policy: when and where to do it, in order to optimize accuracy in streaming settings. These techniques could be applied to reduce the latency of the models we use. Most similar to our setting are works that leverage context to dynamically adjust model architecture at test time to reduce resource consumption [10,27] or to improve throughput [25]. This work employs a similar approach in leveraging insight about latency vs. accuracy tradeoff in AV (autonomous vehicle) perception.
+
+Inferring configuration performance without running. Several existing works achieve resource savings by modeling from data how a candidate configuration would perform without actually running it. Hyperstar [19] learns to approximate how a candidate hyperparameter configuration would perform on a
+
+dataset without training. Chameleon [10] reduces profiling cost of configurations for surveillance camera detection by assuming temporal locality among profiles. One key differentiating factor with our work is that the prior works were designed for a hybrid setting where some profiling is allowed. In our case, the strict time and compute constraints in the AV setting [14] restrict this approach, requiring an approximation-only method like Octopus.
+
+# 3 Problem Setup
+
+We first lay out the problem formulation (§3.1). Next, after an introduction of the Octopus dataset (§3.2), we measure the accuracy opportunity gap between the global best policy [12] and the optimal dynamic policy (§3.3). Finally, we perform a breakdown analysis of the components needed in order to optimize streaming accuracy at test time (§3.4).
+
+# 3.1 Problem formulation
+
+Given real-time video stream as a series of images, we consider the inference of an AV pipeline (obstacle detection and tracking) on this stream. Let $\mathbb{S}$ denote the mean S-MOTA score of the tracking model, which depends on the values of the metaparameters $\mathcal{H}$ , such as object detection model architecture and maximum age of tracked objects. Currently, the metaparameters $h\in \mathcal{H}$ are chosen using offline datasets, and are kept constant during deployment [12]. We refer to this method as the global best approach for statically choosing global metaparameters $(h_{global})$ , which are expected to be best across all driving scenarios.
+
+In contrast, in this work we study whether the S-MOTA score $\mathbb{S}$ can be improved by dynamically changing $h$ every $\Delta \tau$ at test time. The metaparameters we choose at each time period $[\tau, \tau + \Delta \tau)$ is $h_{\tau}$ , and the corresponding score-optimal values is $h_{\tau}^{*}$ .
+
+# 3.2 The Octopus dataset
+
+To generate the Octopus dataset $(\mathcal{D})$ , we divide each video of a driving dataset into consecutive segments of duration $\Delta \tau$ . We run the perception pipeline with a range of values of metaparameters $\mathcal{H}$ , and record the S-MOTA score for each segment $s_{\tau}^{h}$ . We assign the optimal $h_{\tau}^{*}$ to the metaparameters that achieve the highest S-MOTA score (i.e., the optimal S-MOTA score $s_{\tau}^{*}$ ). The segment duration $\Delta \tau$ is chosen to be short. This allows more accurately studying the performance potential of dynamic streaming accuracy optimization, because decision-making over smaller intervals generally performs better.
+
+We generate the Octopus dataset by recording metaparameter values $h_{\tau}$ and the corresponding S-MOTA scores $s_{\tau}^{h}$ of the Pylot AV pipeline [7] for the Argoverse and Waymo datasets [5,28]. We execute Pylot's perception consisting of a suite of 2D object detection models from the EfficientDet model family [26] followed by the Simple, Online, and Real-Time tracker [2]. For each video scenario, we explore the following metaparameters:
+
+Table 1: Dynamically changing metaparameters creates an accuracy opportunity gap. The streaming accuracy (S-MOTA) of the global best metaparameters $h_{global}$ is 6.1 points lower on average than that of the optimal metaparameters $h_{\tau}^{*}$ . Similarly, there is a 3.2 gap in MOTA (top).
+
+| Method | Dataset | MOTA↑ | MOTP↑ | FP↓ | FN↓ | IDsw↓ |
| Global best | Waymo | 37.3 | 78.1 | 21515 | 543193 | 11615 |
| Optimal | Waymo | 40.5 | 77.6 | 15738 | 532678 | 9137 |
| Global best | Argoverse | 63.0 | 82.1 | 6721 | 43376 | 1284 |
| Optimal | Argoverse | 70.8 | 81.0 | 5772 | 34210 | 828 |
| Method | Dataset | S-MOTA↑ | S-MOTP↑ | S-FP↓ | S-FN↓ | S-IDsw↓ |
| Global best | Waymo | 25.1 | 72.2 | 33616 | 633159 | 11212 |
| Optimal | Waymo | 31.2 | 71.0 | 28907 | 590847 | 6997 |
| Global best | Argoverse | 49.4 | 75.2 | 13485 | 55484 | 1092 |
| Optimal | Argoverse | 57.9 | 74.1 | 9562 | 48354 | 708 |
+
+- Detection model architecture: selects the model from the EfficientDet family of models, which offers different latency vs. accuracy tradeoff points.
+- Tracked obstacles' maximum age: limits the duration for which the tracker continues modeling the motion of previously-detected obstacles, under the assumption of temporary occlusion or low detection confidence (flickering).
+
+Other metaparameters had limited effect on performance (Appendix A).
+
+We run every metaparameter configuration in a Cartesian product of selected values for each metaparameter, and record latency metrics, detected objects, and tracked objects. The resulting 18 metaparameter configurations yield $\approx$ 18,000 trials. We make this dataset public (https://github.com/EyalSel/Contextual-Streaming-Perception).
+
+# 3.3 Accuracy opportunity gap
+
+In order to study if the global best metaparameters $h_{global}$ offer the best accuracy in all driving scenarios, we split the Octopus dataset $(\mathcal{D})$ into train $(\mathcal{D}_{train})$ and test $(\mathcal{D}_{test})$ sets. Next, we compute global best metaparameters $(h_{global})$ as the configuration that yields the highest mean S-MOTA score across all video segments in $\mathcal{D}_{train}$ . We denote $h_{global}$ 's mean S-MOTA scores on the train and test set as $s_{train}^{global}$ and $s_{test}^{global}$ , respectively. Similarly, we denote the mean S-MOTA scores of $h_{\tau}^{*}$ (i.e., optimally changing metaparameters) as $s_{train}^{*}$ and $s_{test}^{*}$ .
+
+We define the S-MOTA opportunity gap between the optimal dynamic metaparameters and the global best metaparameters as the upper bound of $s_{test}^{*} - s_{test}^{global}$ . We repeat the same calculation for MOTA. In Table 1, we show the opportunity gap for the Argoverse and Waymo datasets [5,28] using $\Delta \tau = 1s$ . We conclude that optimally choosing the metaparameters at test time offers a 6.1 (Waymo) and 8.5 (Argoverse) S-MOTA improvement on average, along with reductions in streaming false positives/negatives and streaming ID switches.
+
+Of note, if offline accuracy were to increase uniformly across all configurations and scenarios, the performance improvement of the dynamic approach over the static baseline is expected to persist. This applies to the opportunity gap
+
+shown above (the optimal improvement), as well as for any dynamic policy improvement in this space. This means that performance improvement achieved by dynamic optimization come in addition to, and not instead of, further advances in conventional (offline) tracking.
+
+# 3.4 Streaming accuracy analysis
+
+We approach dynamic configuration optimization as a ranking problem [15], and solve it by learning to predict the difference in score of configuration pairs in a given scenario context [30]. We decompose this learning task into predicting the difference in (i) MOTA, and (ii) accuracy degradation during inference. To our knowledge we're the first to perform this analysis.
+
+Decomposition. Streaming accuracy (S-MOTA) is tracking accuracy against ground truth at the end of inference, instead of the beginning (MOTA) [12]. Offline accuracy (MOTA) degrades as a result of change in ground truth during inference. The gap between MOTA and S-MOTA is defined here as the "degradation". Therefore, S-MOTA is expressed as $S - D$ where $S$ is MOTA and $D$ is the degradation. The difference in S-MOTA between two configurations is $(S_{1} - S_{2}) - (D_{1} - D_{2})$ . This decomposition separates the difference in S-MOTA of two configurations into two parts:
+
+- $(S_{1} - S_{2})$ is the difference in offline accuracy. This difference originates from the MOTA boost, which is affected by (i) the added modeling capacity influenced by the scene difficulty for detection, a specific case of the more general example difficulty [1], and (ii) the max-age choice which depends on the scene obstacle displacement [32].
+- $(D_{1} - D_{2})$ is the difference in accuracy degradation. This may be derived from: a. the difference configuration latencies and b. scene obstacle displacement.
+
+Predicting both components to optimize streaming accuracy. At test-time, $S_{1} - S_{2}$ and $D_{1} - D_{2}$ are predicted for each scenario. We find that accurately predicting both components per environment context is necessary to realize the opportunity gap (see §3.3). First, we show that perfectly predicting $D_{1} - D_{2}$ ( $\Delta D^{*}$ ) and $S_{1} - S_{2}$ ( $\Delta S^{*}$ ) (Table 2, top left) yields 31.2 S-MOTA, the same as the optimal policy $h_{\tau}^{*}$ on Waymo (Table 1 bottom panel, row 2). Then, we predict $D_{1} - D_{2}$ and $S_{1} - S_{2}$ on average across all scenarios for each configuration ( $\overline{\Delta D}$ and $\overline{\Delta S}$ respectively in Table 2). Combining $\overline{\Delta D}$ and $\overline{\Delta S}$ (Table 2, bottom-right) yields 25.1 S-MOTA, the same as the global best policy $h_{global}$ score on Waymo (Table 1 bottom panel, row 1). The hybrid-optimal policies (Table 2 top-right and bottom-left) achieve 1.8 (26.9 - 25.1) and 2.7 (27.8 - 25.1) of the 6.1 (31.2 - 25.1) optimal policy opportunity gap. Taken together, these results demonstrate the need to accurately predict both the change in MOTA ( $S_{1} - S_{2}$ ) and in degradation ( $D_{1} - D_{2}$ ) per scenario in order to optimize S-MOTA at test time.
+
+ | ΔD* | ΔD |
| ΔS* | 31.2 | 26.9 |
| ΔS | 27.8 | 25.1 |
+
+Table 2: Both streaming accuracy components must be predicted per scenario in order to realize the full dynamic policy's opportunity gap. $\Delta D^{*}$ is optimal degradation prediction, $\Delta S^{*}$ is optimal offline gap prediction. $\overline{\Delta D}$ and $\overline{\Delta S}$ are the corresponding global-static policies.
+
+# 4 Octopus: Environment-Driven Perception
+
+We propose leveraging properties of the AV environment context (e.g., ego speed, number of agents, time of day) that can be perceived from sensors in order to dynamically change metaparameters at test time. We first formally present our approach for choosing metaparameters, which uses regression to infer a ranking of metaparameter configurations ( $\S 4.1$ ). Then, we describe the environment representation that allows to effectively infer each component of the streaming accuracy ( $\S 4.2$ ).
+
+# 4.1 Configuration Ranking via Regression
+
+In order to find the metaparameters $h_{\tau}$ that maximize the S-MOTA score $s_{\tau}^{h}$ for each video segment, Octopus first learns a regression model $M$ . The model predicts $s_{\tau}^{h}$ given the metaparameters $h_{\tau}$ and the representation of the environment $e_{\tau}$ for the period $\tau$ . Following, Octopus considers all metaparameter values, and picks the metaparameters that give the highest predicted S-MOTA.
+
+Executing the model $M$ at the beginning of each segment $\tau$ requires an up-to-date representation of the environment. However, building a representation requires the output of the perception pipeline (e.g., number of obstacles). Octopus could run the current perception configuration in order to update the environment before executing the model $M$ , but this approach would greatly increase the response time of the AV. Instead, Octopus makes a Markovian assumption, and inputs the environment representation of the previous segment $e_{\tau - 1}$ to the model $M$ .
+
+$$
+M \left(h _ {\tau}, e _ {\tau - 1}\right) = \hat {s} _ {\tau} ^ {h} \tag {1}
+$$
+
+Thus, it is important to limit the segment length $\Delta \tau$ as the longer a segment is, the more challenging it is to accurately predict the scores due to using an older environment representation (see §5.1 for our methodology for choosing $\Delta \tau$ ).
+
+The model is trained using the mean squared error loss. We choose the metaparameters that the model predicts as the highest score. Let $s_{\tau}^{global}$ denote the S-MOTA score obtained with $h^{global}$ metaparameters, which by definition is a lower bound of the optimal S-MOTA score $s_{\tau}^{*}$ (i.e., $s_{\tau}^{global} \leq s_{\tau}^{*}$ ). Thus, in order to pick the best metaparameters, Octopus can only predict $s_{\tau}^{h}$ relative to $s_{\tau}^{global}$ . As a result, Octopus utilizes the following as the final loss:
+
+$$
+L = \frac {1}{N} \sum_ {i = 0} ^ {N} \left(\hat {r} _ {i} ^ {h} - c l i p ((s _ {i} ^ {h} - s _ {i} ^ {g l o b a l}), \epsilon)\right) ^ {2} \tag {2}
+$$
+
+where $\mathbf{N}$ is the size of the training data and $\hat{r}_i^h$ is the relative S-MOTA score predicted by the model $M$ , $\hat{r}_i^h = \hat{s}_i^h - s_i^{global}$ .
+
+Finally, Octopus clips by lower bounding the predictions by $s_i^{global} - \epsilon$ as the predictions significantly below $s_i^{global}$ are irrelevant to the optimization problem. Moreover, by clipping the predictions, Octopus reduces the dynamic range of the regressor and makes it easier to predict the higher S-MOTA scores.
+
+# 4.2 Environment Representation
+
+We can represent the environment context $e_{\tau}$ by capturing the characteristics of the video segment. In order to keep the decision-making latency small, we eschew more complex learned representation designs. Instead, we developed hand-engineered features from sensors and the outputs of the object detection model following prior work by Nishi et al. [20], where the features were used to predict human driving behavior. We collect the features per frame and then aggregate by averaging across frames in the video segment. Unless otherwise specified, we use the $10^{\text{th}}$ percentile, mean, and $90^{\text{th}}$ percentile of the following features:
+
+1. Bounding box speed is the distance traveled by an object in pixel space across two frames. This feature infers the speed of objects, and thus it is important for capturing obstacle displacement to predict the streaming accuracy degradation.
+2. Bounding box self IoU is the Intersection-over-Union (IoU) of an object's bounding box in the current frame relative to the previous frame. Along with the bounding speed, this feature helps isolate the change in size of an obstacle, as it moves towards or away from the ego vehicle.
+3. Number of objects is measured per frame, and indicates the complexity of a scene as the more objects in a scene, the more likely the AV is to encounter object path crossings and occlusions (scene difficulty). Therefore, this feature signals when to prioritize for high offline accuracy configurations that are robust to object occlusions.
+4. Obstacle longevity is the number of frames for which an obstacle has been tracked. Lower obstacle longevity implies more occlusion as obstacles enter and leave the scene, making perception more difficult. This feature also guides the choice of tracking metaparameters as low obstacle longevities correlate with lower tracking maximum age giving better performance.
+5. Ego driving speed is the speed at which the AV is traveling, and indicates the environment in which the AV is driving (e.g., highway vs. city).
+6. Ego turning speed is the angle change of the AV's direction between consecutive frames. This feature helps differentiate the source of apparent obstacle displacement between obstacle movement and ego movement.
+7. Time of day hints if a high-accuracy configuration is required to handle challenging scenes (e.g., night driving, sun glare at sunset).
+We compute these feature statistics for different bounding box size ranges in order to reason about obstacle behavior depending on the detection model
+
+strength needed for their accurate detection. For example, higher offline accuracy models do not confer better streaming accuracy if the obstacles in the detectable size range move too rapidly for the longer detection inference time to keep up with.
+
+Note that the choice of metaparameters in each video segment changes the configuration, and hence the outputs of the tracking pipeline. Therefore, the resulting environment representation is no longer independently and identically distributed (i.i.d), making it challenging to use traditional supervision techniques. To keep the data distribution stationary during train time, we use the object detection model as given by the global best metaparameters $h_{global}$ . While this training objective is biased considering that the features may be derived from any configuration, we find that it reduces variance during training, and works better than using features derived from the ground truth.
+
+We concatenate the metaparameters $h$ and the environment representation vector $e_{\tau}$ , and then use a supervised regression model to predict the score, optimizing using the loss given in Eq. (2).
+
+In addition, we compare our method to a conventional CNN model approach (ignoring its resource and runtime requirements) in Appendix I.
+
+# 5 Experiments
+
+Next, we analyze our proposed approach. The subsections discuss the following:
+
+1. Setup (§5.1): Description of Datasets and Model Details
+
+2. Main results (§5.2): What is the performance improvement conferred by the dynamic policy over the static baseline?
+
+3. Explainability (§5.3): I. Does the learned policy behavior match human understanding of the driving scenario? II. Where is the learned policy similar to and different from the optimal policy? III. How are scenarios clustered by metaparameter score? IV. What is the relative importance of the hand-picked features and of the metaparameters towards S-MOTA optimization?
+
+4. Ablation study (Appendix H): How do various ranking implementation choices affect the final performance?
+
+# 5.1 Methodology
+
+We evaluate on the Argoverse and Waymo datasets [5,28], covering a variety of environments, traffic, and weather conditions. We do not use the private Waymo test set as it does not support streaming metrics. However, we treat the Waymo validation set as the test set, and we perform cross validation on the training dataset (798 videos for training, and 202 videos for validation). Similarly, we divide the Argoverse videos into 75 videos for training, and 24 for validation. In addition, we follow the methodology from Li et. al [12] in order to create ground truth 2D bounding boxes and tracking IDs, which are not present in the Argoverse dataset. We generate these labels using QDTrack [22] trained on the BDD100k dataset, which is the highest offline accuracy model available.
+
+In our experiments, we run object detectors from the EfficientDet architecture [26] on NVIDIA V100 GPUs, and the SORT tracker [2] on a CPU (simulated evaluation on faster hardware is in Appendix J). We chose to use the EfficientDet models because they are especially optimized for trading off between latency and offline accuracy, and because they are close to the state-of-the-art. The EfficientDet models were further optimized using Tensor RT [21], which both reduces inference latencies to less than 250ms (the latency of the largest model, EfficientDet-D7x) and decreases resource requirements to at most 3 GPUs. We use these efficient models to investigate the effect of optimizing two metaparameters: detection model and tracking max age (see §3.2 for details). We compile 18 configurations of the AV perception pipeline by exploring the Cartesian product of the values of the two metaparameters (see Listing 1.1).
+
+1 # Metaparameters
+2 detection-model = {EfficientDet: 3, 4, 5, 6, 7, 7x}
+3 tracking-maximum-age = {1, 3, 7}
+
+# Listing 1.1: Values for detection and tracking metaparameters.
+
+We implement Octopus's policy regression model as a Random Forest [4] using Eq. (2) to choose metaparameters for video segment length $\Delta \tau = 1s$ . We describe training details in Appendix B.
+
+Policy Runtime Overhead. Every step $\Delta \tau$ , the Octopus policy applies Random Forest regression for all the 18 perception pipeline configurations in order to predict the best one to apply in the next step. Due to the lightweight policy design, inference on all 18 configurations has a latency of at most 6ms using a single Intel Xeon Platinum 8000 core. As a result, the policy decision finishes before the sensor data of the next segment arrives, and thus does not affect latency of the perception pipeline. Moreover, Octopus pre-loads the perception model weights (13.86GB in total in our experiments) and forward pass activations in the GPU memory (32GB), and thus actuates metaparameter changes quickly.
+
+# 5.2 Main results
+
+We compare the Octopus policy with the optimal policy $(h_{\tau}^{*})$ and the global best policy $(h^{global})$ as proposed by Li et al. [12]. In addition, following the discussion in §4.2, we show ablations of the Octopus policy in order to highlight the relative contribution in both the setting of predictive and close-loop metaparameter optimization. Concretely, we include the following setups that Octopus can use to optimize the metaparameters at time $t$ :
+
+- Ground truth from current segment: features are derived from the sensor data and the labels at time $t$ .
+- Ground truth from previous segment: features are derived from the sensor data and the labels at time $t - \Delta \tau$ .
+- Closed-loop prediction from previous segment: features are derived from the sensor data and the output of the perception pipeline for the previous segment (i.e., at time $t - \Delta \tau$ ).
+
+In Table 3 we show the tracking accuracy results for the Waymo and Argoverse datasets. The results show that the Octopus policy with closed-loop prediction outperforms the global best policy by 1.9 S-MOTA (Waymo) and 1.7 S-MOTA (Argoverse). Both the optimal and Octopus policies achieve further accuracy increases using features derived from the current segment, further illustrating how rapidly configuration score changes over time. The consistent accuracy improvements across the two datasets show that leveraging environment context to dynamically optimize streaming accuracy provides substantial improvements over the state-of-the-art. Moreover, as discussed in §3.3, streaming accuracy improvement over the global best policy will likely persist independently of innovation in offline accuracy of the underlying perception models.
+
+Table 3: Streaming tracking accuracy results on two datasets.
+(a) Waymo
+
+| Method | S-MOTA↑ | S-MOTP↑ | S-FP↓ | S-FN↓ | S-IDsw↓ |
| Global best | 25.1 | 72.2 | 33616 | 633159 | 11212 |
| Optimal | 31.2 | 71.0 | 28907 | 590847 | 6997 |
| Optimal from the prev. segment | 27.2 | 71.2 | 38631 | 603777 | 8092 |
| Octopus with: | | | | | |
| Ground truth from current segment | 27.9 | 72.3 | 31489 | 608870 | 8966 |
| Ground truth from prev. segment | 27.3 | 72.7 | 31056 | 612862 | 9103 |
| Prediction from prev. segment | 27.0 | 72.8 | 30272 | 615780 | 9511 |
+
+(b) Argoverse
+
+| Method | S-MOTA↑ | S-MOTP↑ | S-FP↓ | S-FN↓ | S-IDsw↓ |
| Global best | 49.4 | 75.2 | 13485 | 55484 | 1092 |
| Optimal | 57.9 | 74.1 | 9562 | 48354 | 708 |
| Optimal from the prev. segment | 51.9 | 74.0 | 12652 | 52804 | 810 |
| Octopus with: | | | | | |
| Ground truth from current segment | 53.2 | 74.9 | 11447 | 52638 | 917 |
| Ground truth from prev. segment | 51.6 | 75.1 | 11348 | 54502 | 1010 |
| Prediction from prev. segment | 51.1 | 74.9 | 12062 | 54469 | 1008 |
+
+S-MOTA vs. S-MOTP. Table 3 highlights that both Octopus and optimal policy occasionally deteriorate S-MOTP, inversely to the improvement in S-MOTA. This result reflects on a broader pattern where in streaming settings bounding boxes in general lag after the ground truth, even if by a small enough margin to be counted as true positives. S-MOTP, which is weighted by the IOU between correct predictions and the ground truth is especially hurt as a result. S-MOTA, which just counts the number of false positives, is less affected by this. We provide a longer analysis of this tradeoff/pareto-frontier between S-MOTA and S-MOTP in Appendix D.
+
+# 5.3 Explainability
+
+We survey various aspects of the metaparameter optimization problem, and qualitatively compare the global best (baseline), the optimal, and the Octopus (learned) policies.
+
+
+Fig. 3: Busy Intersection Scenario. Left: The S-MOTA score of each $\tau = 1s$ segment for the Octopus (learned), global best, and optimal policies. Right: The front-facing camera feed. Red bounding-boxes represent the ground truth, and orange represent the pipeline's predictions using the policy's configuration choice.
+
+
+Fig. 4: Policy decision frequency. The configuration choice frequency (color intensity) of the Octopus policy (left) and of the optimal policy (right). The global best configuration is EfficientDet-D4 with tracking max age of 1, emphasized with gray stripes.
+
+I. Case study: Busy Intersection. Figure 3 shows a scenario where the ego vehicle enters a busy intersection. The scenario is divided into three phases, where the learned (Octopus) policy adaptively tunes the metaparameter to varying road conditions similarly to the optimal policy plan. First, the ego vehicle approaches the intersection with oncoming traffic on the left. The vehicles in the distance cannot be picked up by any of the candidate models. The learned policy chooses D4, the same model as the global best policy. Then, as the light turns yellow and the ego vehicle comes to a stop first in the queue, the learned policy adapts by increasing the strength of the model to D7x. The perception pipeline is now able to detect the smaller vehicles in the opposing lane and adjacent to the road. The optimal policy makes a similar decision while the global best policy remains with the D4 choice, incurring a net performance loss. Finally, as vehicles in the cross-traffic start passing and occluding the vehicles in the background, the learned policy returns to the lower latency D3 model. This scenario illustrates how the learned policy can select the best model in each phase of the scenario, adapting to the change in driving environment.
+
+II. Policy action heatmap. In Figure 4, we visualize the learned policy in comparison to the optimal policy. As we expect, the learned policy often selects the global best configuration (D4-1), but expands out similarly to the optimal policy when performance can be improved by changing configurations. This result illustrates how, contrary to common belief that onboard perception must have low latency (e.g. under 100ms [28]), higher perception latencies are tolerable and even preferable in certain environments. The Octopus policy learns to take advantage of this when it opts for higher offline accuracy models.
+
+III. Scenarios are clustered by metaparameter score.
+
+
+Fig.5: The impact of the accuracy degradation incurred in online streaming context is scenario dependent. Each point is a 1s driving scenario. Its color is the model that maximizes offline accuracy (left) and streaming accuracy (right).
+
+
+Fig. 6: Three centroids of the configuration score distribution: (i) preference for low max age (left), (ii) preference for offline accuracy (middle), and (iii) preference for low latency (right). The three clusters account for $34\%$ of the dataset.
+
+Here, we evaluate whether scenarios are grouped by common metaparameter score behaviors. To this end, we first visualize the scenario score space (explained below) as a t-SNE plot and then perform more formal centroid analysis.
+
+To this end, each video segment of length $\Delta \tau = 1s$ is vectorized by computing the MOTA score difference $(S_{c} - S_{h_{global}})$ and degradation difference $(D_{c} - D_{h_{global}})$ for every metaparameter configuration $c$ and the global best configuration $h_{global}$ (see §3.4). These values are then concatenated and normalized (z-score) across each scenario.
+
+Cluster visualization. We visualize this space in a t-SNE plot in Figure 5. The scenario segment points are colored according to the model that optimizes MOTA (left) and S-MOTA (right). We observe a non-uniform impact of accuracy degradation on the optimal model choice in different video segment regions. This varying effect illustrates that S-MOTA deviates from MOTA setting on an environment context-dependent basis. For case-study analysis of points in the t-SNE please see Appendix F.
+
+Centroid analysis. We now perform a more formal clustering analysis that reveals modes of metaparameter optimality.
+
+We perform K-means clustering, with $k = 8$ on the z-score space. Figure 6 shows centroids of three representative scenario clusters (right to left): (i) scenarios that benefit from lower latency detection. (ii) scenarios that benefit from higher accuracy detection, and (iii) scenarios that primarily benefit from a lower tracking max age, and to a lesser extent from lower latency detection. These distinct modes reflect that scenarios are grouped around similar metaparameter behaviors, corroborating with variation in scene difficulty and obstacle displacement. The rest of the scenario cluster visualizations are in Appendix G.
+
+# IV. Feature and configuration metaparameter importance.
+
+Feature importance. To study the relative importance of the environment features used in our solution (described in §4.2), we show the feature importance scores derived from the trained Random Forest regressor in Table 4a. The mean bounding box self-IOU and speed together constitute over half of the normalized
+
+Table 4: Importance study
+(a) Feature importance (Regression)
+
+| Feature | Importance Score | Feature | Importance Score |
| Mean BBox self IOU | 0.304 | BBox bin [665, 1024) | 0.087 |
| Mean BBox Speed | 0.200 | BBox bin [1024, 1480) | 0.071 |
| Num. BBoxes | 0.063 | BBox bin [1480, 2000) | 0.055 |
| BBox Longevity | 0.076 | BBox bin [2000, 2565) | 0.040 |
| Ego movement | 0.096 | BBox bin [2565,∞) | 0.417 |
| Time of Day | 0.008 | | |
+
+(b) Metaparameter importance (Regression)
+
+| Metaparameter | S-MOTA↑ | S-MOTP↑ | S-FP↓ | S-FN↓ | S-IDsw↓ |
| Global best | 25.1 | 72.2 | 33616 | 633159 | 11212 |
| Detection-model | 27.6 | 72.4 | 26116 | 615771 | 11254 |
| Tracking-max-age | 25.6 | 71.9 | 39400 | 625184 | 8973 |
| Both | 27.9 | 72.3 | 31489 | 608870 | 8966 |
+
+importance score, as they are predictive of the accuracy degradation that higher-latency detection models would incur. Aggregate bounding box statistics that capture scene difficulty, such as the average number and longevity of the bounding boxes per frame, are also useful for prediction.
+
+Configuration metaparameter importance. In Table 4b, we evaluate the gains attributed to each metaparameter by only optimizing one metaparameter at a time, fixing the other parameter to the value in the global best configuration. We do this to ablate the performance shown in Table 3, where they are optimized together. In both cases, the models were trained on the ground truth and the present. Although the detection model choice is the primary contributor, the additional choice of occlusion tolerance (max age) further contributes to the achieved performance. We also observe how the performance gain when optimizing the tracker's maximum occlusion tolerance (see §3 for details) does not combine additively with the improvement in the detection model optimization.
+
+# 6 Conclusions
+
+Streaming accuracy is a much more accurate representation of tracking for real-time vision systems because it uses ground truth at the end of inference to measure performance. In this study we show the varying impact that environment context has on the deviation of streaming accuracy from offline accuracy. We propose a new method, Octopus, to leverage environment context to maximize streaming accuracy at test time. Further, we decompose streaming accuracy into two components: difference in offline accuracy MOTA and the degradation, and show that both must be inferred in every scenario to achieve optimal performance. Octopus improves streaming accuracy over the global best policy in multiple autonomous vehicle datasets.
+
+Acknowledgements. We thank Daniel Rothchild and Horia Mania for helpful discussions.
+
+# References
+
+1. Baldock, R., Maennel, H., Neyshabur, B.: Deep learning through the lens of example difficulty. Advances in Neural Information Processing Systems 34, 10876-10889 (2021) 6
+2. Bewley, A., Ge, Z., Ott, L., Ramos, F., Upcroft, B.: Simple Online and Realtime Tracking. In: Proceedings of the $23^{\text{th}}$ IEEE International Conference on Image Processing (ICIP). pp. 3464-3468 (2016) 4, 10
+3. Bochkovskiy, A., Wang, C.Y., Liao, H.Y.M.: YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv preprint arXiv:2004.10934 (2020) 1, 3
+4. Breiman, L.: Random forests. Machine learning 45(1), 5-32 (2001) 10
+5. Chang, M.F., Lambert, J., Sangkloy, P., Singh, J., Bak, S., Hartnett, A., Wang, D., Carr, P., Lucey, S., Ramanan, D., et al.: Argoverse: 3D Tracking and Forecasting with Rich Maps (2019) 3, 4, 5, 9
+6. Courdier, E., Fleuret, F.: Real-time segmentation networks should be latency aware. In: Proceedings of the Asian Conference on Computer Vision (2020) 3
+7. Gog, I., Kalra, S., Schafhalter, P., Wright, M.A., Gonzalez, J.E., Stoica, I.: Pylot: A Modular Platform for Exploring Latency-Accuracy Tradeoffs in Autonomous Vehicles. In: Proceedings of IEEE International Conference on Robotics and Automation (ICRA) (2021) 3, 4
+8. Han, S., Pool, J., Tran, J., Dally, W.J.: Learning both Weights and Connections for Efficient Neural Networks. In: Proceedings of the $28^{\text{th}}$ International Conference on Neural Information Processing (NeurIPS). pp. 1135-1143 (2015) 3
+9. Huang, J., Rathod, V., Sun, C., Zhu, M., Korattikara, A., Fathi, A., Fischer, I., Wojna, Z., Song, Y., Guadarrama, S., Murphy, K.: Speed/Accuracy Trade-Offs for Modern Convolutional Object Detectors. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 3
+0. Jiang, J., Ananthanarayanan, G., Bodik, P., Sen, S., Stoica, I.: Chameleon: Scalable Adaptation of Video Analytics. In: Proceedings of the 2018 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM). pp. 253-266 (2018) 3, 4
+1. Leal-Taixe, L., Milan, A., Schindler, K., Cremers, D., Reid, I., Roth, S.: Tracking the trackers: an analysis of the state of the art in multiple object tracking. arXiv preprint arXiv:1704.02781 (2017) 2
+2. Li, M., Wang, Y., Ramanan, D.: Towards Streaming Perception. In: Proceedings of the European Conference on Computer Vision (ECCV) (2020) 1, 2, 3, 4, 6, 9, 10
+3. Lin, J., Rao, Y., Lu, J., Zhou, J.: Runtime Neural Pruning. In: Proceedings of the $31^{\mathrm{st}}$ International Conference on Neural Information Processing Systems (NeurIPS). pp. 2178-2188 (2017) 3
+4. Lin, S.C., Zhang, Y., Hsu, C.H., Skach, M., Haque, M.E., Tang, L., Mars, J.: The Architectural Implications of Autonomous Driving: Constraints and Acceleration. In: Proceedings of the $23^{\mathrm{rd}}$ International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). pp. 751-766 (2018) 4
+5. Liu, T.Y., et al.: Learning to rank for information retrieval. Foundations and Trends® in Information Retrieval 3(3), 225-331 (2009) 6
+6. Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.Y., Berg, A.C.: SSD: Single shot multibox detector. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 21-37. Springer (2016) 1
+7. Luo, J.H., Wu, J., Lin, W.: Thinet: A Filter Level Pruning Method for Deep Neural Network Compression. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 5058-5066 (2017) 3
+
+18. Milan, A., Leal-Taixe, L., Reid, I., Roth, S., Schindler, K.: Mot16: A benchmark for multi-object tracking. arXiv preprint arXiv:1603.00831 (2016) 2
+19. Mittal, G., Liu, C., Karianakis, N., Fragoso, V., Chen, M., Fu, Y.: HyperSTAR: Task-Aware Hyperparameters for Deep Networks. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 8736-8745 (2020) 3
+20. Nishi, K., Shimosaka, M.: Fine-Grained Driving Behavior Prediction via Context-Aware Multi-Task Inverse Reinforcement Learning. In: 2020 IEEE International Conference on Robotics and Automation (ICRA). pp. 2281-2287. IEEE (2020) 8
+21. NVIDIA: Tensor RT. https://developer.nvidia.com/tensorrt 10
+22. Pang, J., Qiu, L., Li, X., Chen, H., Li, Q., Darrell, T., Yu, F.: Quasi-dense similarity learning for multiple object tracking. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 164-173 (2021) 9
+23. Park, E., Ahn, J., Yoo, S.: Weighted-entropy-based Quantization for Deep Neural Networks. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 5456-5464 (2017) 3
+24. Pleskac, T.J., Busemeyer, J.R.: Two-stage dynamic signal detection: a theory of choice, decision time, and confidence. Psychological review 117(3), 864 (2010) 3
+25. Shen, H., Han, S., Philipose, M., Krishnamurthy, A.: Fast Video Classification via Adaptive Cascading of Deep Models. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 3646-3654 (2017) 3
+26. Tan, M., Pang, R., Le, Q.V.: EfficientDet: Scalable and Efficient Object Detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2020) 1, 3, 4, 10
+27. Wang, X., Yu, F., Dou, Z.Y., Darrell, T., Gonzalez, J.E.: Skipnet: Learning Dynamic Routing in Convolutional Networks. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 409-424 (2018) 3
+28. Waymo Inc.: Waymo Open Dataset. https://waymo.com/open/ 2, 3, 4, 5, 9, 12
+29. Xu, Y., Wang, Y., Zhou, A., Lin, W., Xiong, H.: Deep Neural Network Compression with Single and Multiple Level Quantization. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 32 (2018) 3
+30. Yogatama, D., Mann, G.: Efficient transfer learning method for automatic hyperparameter tuning. In: Artificial intelligence and statistics. pp. 1077-1085. PMLR (2014) 6
+31. Zhao, R., Hu, Y., Dotzel, J., De Sa, C., Zhang, Z.: Improving Neural Network Quantization without Retraining using Outlier Channel Splitting. In: International Conference on Machine Learning (ICML). pp. 7543-7552 (2019) 3
+32. Zhou, X., Koltun, V., Krahenbuhl, P.: Tracking objects as points. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 474-490. Springer (2020) 6
\ No newline at end of file
diff --git a/contextawarestreamingperceptionindynamicenvironments/images.zip b/contextawarestreamingperceptionindynamicenvironments/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..1a148a90ea446b240371e5f4b91a430e396df029
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9287d1a9c50d2584c4ad20ae09805d7edfef41b32f67a6e5da06f166ba35fcf6
+size 340043
diff --git a/contextawarestreamingperceptionindynamicenvironments/layout.json b/contextawarestreamingperceptionindynamicenvironments/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..4495f43478a4986c793bdb2520a8a4bc3a0d0eed
--- /dev/null
+++ b/contextawarestreamingperceptionindynamicenvironments/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:25f832bb7396fd993a6947361fad75be7e89f495fdfacbb5880ed12c79bc819b
+size 417462
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_content_list.json b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8a79821b88e089a16fc275f49ed7ad18628e985e
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c1e776040e33a399684f03655df16d58f9a00d96166d275598aa745e0b8b6181
+size 77310
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_model.json b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..903459548f6f80f04d2c736300dcbd2339c870d2
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a7d9bd6ca01adf929aed3176d453b4b42b7d37cb60dcf30c47aa390199870273
+size 95887
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_origin.pdf b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..781e4133e965ea443410d443a2fcdea30cb18477
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/c2ac1f6b-df76-49a7-b83d-e81e5ecc8d13_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f458a056346f7e843fecf3ef5dbd732b06faea5e4c9fcb5e340fc0b9c14b4be
+size 2872404
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/full.md b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..e794e1fdf1580676f1231805be92e0995d173d1f
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/full.md
@@ -0,0 +1,276 @@
+# Context-Consistent Semantic Image Editing with Style-Preserved Modulation
+
+Wuyang Luo $^{1}$ , Su Yang $^{1\boxtimes}$ , Hong Wang $^{1}$ , Bo Long $^{1}$ , and Weishan Zhang $^{2}$
+
+$^{1}$ Shanghai Key Laboratory of Intelligent Information Processing, School of Computer Science, Fudan University
+$^{2}$ School of Computer Science and Technology, China University of Petroleum {wyluo18,suyang}@fudan.edu.cn https://github.com/WuyangLuo/SPMPGAN
+
+
+
+
+
+
+
+
+Fig. 1: Applications of the proposed method. Our image editing system is flexible in responding to a wide variety of editing requirements.
+
+
+
+
+
+
+
+Abstract. Semantic image editing utilizes local semantic label maps to generate the desired content in the edited region. A recent work borrows SPADE block to achieve semantic image editing. However, it cannot produce pleasing results due to style discrepancy between the edited region and surrounding pixels. We attribute this to the fact that SPADE only uses an image-independent local semantic layout but ignores the imagespecific styles included in the known pixels. To address this issue, we propose a style-preserved modulation (SPM) comprising two modulations processes: The first modulation incorporates the contextual style and semantic layout, and then generates two fused modulation parameters. The second modulation employs the fused parameters to modulate feature maps. By using such two modulations, SPM can inject the given semantic layout while preserving the image-specific context style. Moreover, we design a progressive architecture for generating the edited content in a coarse-to-fine manner. The proposed method can obtain context-consistent results and significantly alleviate the unpleasant boundary between the generated regions and the known pixels.
+
+# 1 Introduction
+
+Image editing aims to generate the desired content in a specific region under users' control. This task attracts a lot of research enthusiasm due to its wide application in social media, image and video re-creation, and virtual human-object interaction. The well-known commercial software Photoshop has achieved success in this field. However, the use of such software requires many professional skills and much manual effort.
+
+Most image editing methods fall into a few categories. The first category is low-level-guided editing methods [18,3,6,28]. They introduce low-level information such as lines and color. These methods can deal with editing simple contours or shapes but only provide very limited editing control and cannot manipulate the high-level semantics of the image. The second category is classification-based methods [9,12]. They utilize an auxiliary classifier to guide synthesis and edit images. These methods can only control discrete attributes and cannot provide spatial control. The third category methods employ GAN inversion technique [39,4,1,27], which relies on a pre-trained GAN and dissects GANs' latent spaces, finding disentangled latent codes suitable for editing. They require a powerful well-trained StyleGAN, which is impossible in many cases because training a strong StyleGAN [20,22] model is not easy, especially for complex scenes. Further, such methods lack flexibility, and the editing of each attribute may require independent training. The fourth category methods [11,32] utilize pixel-level semantic label maps, which define the class labels of pixels in edited regions to control edited content. This task is also known as Semantic Image Editing. Following this line of work, our approach can provide users with greater editing flexibility than the other three categories of methods. Our method includes the following editing capabilities: (1) Our method can be applied to complex scene editing. (2) Users can flexibly edit the image via manipulating semantic layout, such as modifying the shape of objects, adding or removing objects. (3) Edited regions can be selected at arbitrary positions, even beyond the original image boundaries. The Figure 1 demonstrates the versatility of our approach.
+
+Semantic image editing is a non-trivial task. Its challenge lies in keeping context style consistent between edited and known regions. Here, "context" refers to the non-edited region of the input image, and "style" is the features of "context" such as color/texture. The previous state-of-the-art method SESAME [32] leverages SPADE block [33] to build their generator. SPADE is remarkably effective in conditional image synthesis. Conditional image synthesis learns a mapping from the semantic map domain to the real image domain, synthesizing the entire image according to the given semantic label map. Therefore, the generator may synthesize simple textures to get visually plausible results. However, since known pixels and fake pixels coexist for the image editing task, our task becomes tougher in that the requirement is synthesizing realistic textures and retaining consistency to the context style. Aside from that, image synthesis requires a
+
+
+Fig. 2: (a) Principle difference between SPM and SPADE; (b) The structure of SPADE; (c) The structure of the proposed SPM.
+
+
+
+full semantic label map, but semantic image editing can only see the semantic layout of the edited region. Thus, if SPADE is employed directly on the editing task, only meaningless modulation parameters would be generated in the known region. Previous work [32] often causes significant style inconsistency and unpleasant boundaries for the above reasons.
+
+To address such limitations of the existing works, we propose a style-preserved modulation module (SPM). Compared with SPADE, which only utilizes one modulation operation, SPM consists of a two-stage modulation process. Inspired by the style transfer [14], which show that non-normalized feature maps contain high-level "style" information, we use non-normalized feature maps for context preserving via "bypassing norm". The principle difference between SPM and SPADE is illustrated in Figure 2(a) and their details are described in the section 3. Specifically, we first generate two parallel pairs of modulation parameters from semantic maps and a pair of modulation parameters from feature maps. Then we fuse them through the first modulation operation to generate two context-aware modulation parameters. The second stage modulation uses the context-aware modulation parameters to modulate feature maps. Through two-stage modulation, SPM can effectively integrate external semantic maps while preserving the image-specific context style.
+
+SPM involves feature maps into the modulation process for preserving contextual style. For image editing tasks, the input is empty in the edited region. The contextual information of the known region is gradually transferred to the edited region through the enlargement of the receptive field of the generator. In order to make the edited region more effectively perceive the contextual style to generate context-aware modulation parameters of SPMs, we build a coarse-to-fine structure to decompose the editing process into multiple scales in a progressive manner. Specifically, we employ multiple generators to receive inputs of different scales. A downsampled version of the input image is fed into the first generator
+
+to produce the coarsest result, which contains the coarse-grained image-specific style of the edited region. Subsequent generators can utilize previous results to effectively preserve the contextual style via SPM and refine the detailed textures. Our contributions are summarized as follows:
+
+- We propose a context style-preserved modulation for the semantic image editing task, which can inject the layout of the external semantic label map while preserving the image-specific context style. The experiment shows the remarkable effect of SPM for alleviating the inconsistency.
+- We build the progressive generative adversarial networks with SPMs for coarse-to-fine generation of edited regions.
+- Extensive qualitative and quantitative experiments conducted on several benchmark datasets indicate that our model outperforms the state-of-the-art methods, especially in the sense of contextual style consistency.
+
+# 2 Related Works
+
+# 2.1 Image-to-Image Translation
+
+Image translation attempts to learn a mapping from a source domain to a target domain. It can be applied to various tasks, such as image synthesis [48,46,47], image editing [11,3,18], style transfer [7,14], image inpainting [34,45,44], image extension [38,43], and image super-resolution [24,25]. Existing works utilize different conditional inputs as source domains such as semantic label maps, scene layouts, key points, and edge maps. Among them, the most relevant subtask is semantic image synthesis, which aims at generating photo-realistic images conditioned on semantic label maps.
+
+Semantic image synthesis has achieved remarkable progress benefiting from GAN [8]. Pix2pix [17] is the seminal work based on cGAN framework [30]. The following work Pix2pixHD [41] is devoted to generating high-resolution images. SPADE [33] proposes a spatially-adaptive normalization that learns transformation parameters from the semantic layout to modulate the activations in normalization layers. CLADE [37] proposes a lightweight class-adaptive normalization to improve the efficiency of SPADE. Semantic image synthesis has been applied to different downstream tasks in recent works, such as semantic image editing [32], semantic view synthesis [13], and portrait editing [53,26].
+
+# 2.2 Semantic Image Editing
+
+Semantic image editing refers to users providing semantic label maps as a clue to edit the local region of a given image at pixel level. Semantic concepts are more intuitive and fundamental image features than colors, edges, key points, and textures. By manipulating the semantic label map, users can easily edit the image content in many ways, including re-painting, adding, removing, and out-painting semantic objects. Semantic image editing has not been fully developed because
+
+it is challenging. Semantic image editing requires that the edited content not only has high fidelity but also must be consistent with the style of the remaining region. HIM [11] is the earliest attempt at this task. HIM can only operate on one foreground target each time. Furthermore, HIM requires a full semantic label map of the entire image as input, which is inconvenient for users. SESAME [32] only inputs the semantic label map of the edited region, making the image editing tool more practical. SESAME builds its generator with SPADE and uses a new discriminator to process the semantic and image information in separate streams. Although the previous methods can synthesize plausible results, they ignore the consistency of the context between the edited region and the known region. In contrast, our work is dedicated to reducing this inconsistency.
+
+# 2.3 Modulation Technique
+
+Modulation, also called denormalization, is an effective way to inject external control information. Unlike the unconditional normalization technique, such as BN [16], IN [40], and GN [42], modulation techniques require external data and follow a similar operating flow. First, feature maps are normalized to zero mean and unit deviation using an unconditional normalization layer. Then the normalized feature maps are modulated with scaling and shifting parameters learned from external data. Modulation techniques were initially applied to style transfer tasks, such as AdaIN [14] and later adopted in various vision tasks [21,15,35]. AdaIN only learns global style representation. [33] proposes SPADE for semantic image synthesis to handle external data with spatial dimensions. However, the previous methods only consider the external conditional input and ignore the internal contextual information, which is a fatal disadvantage for our task. This paper proposes a new modulation scheme that can aggregate internal context style and external semantic layout. The experimental results show that the proposed method can effectively preserve the context style and improve consistency for semantic image editing.
+
+# 3 Approach
+
+We describe our approach from bottom to top. We first analyze the limitations of SPADE for semantic image editing and introduce SPM proposed in this paper. Then, we introduce how to build a progressive architecture based on SPM.
+
+# 3.1 Rethinking SPADE for Semantic Image Editing
+
+SPADE is a state-of-the-art modulation technology remarkably successful in semantic image synthesis, as shown in Figure 2(b). $F^i \in \mathbb{R}^{N \times C \times H \times W}$ is the input feature maps of the i-th layers. $N$ is the number of samples in one batch. $C$ is the number of channels. $H$ and $W$ represent the height and width, respectively. SPADE learns two modulation parameters, scaling parameters $\gamma$ and shifting
+
+parameters $\beta$ , via two convolutional layers from the given semantic label map $S$ . First, $F^i$ is normalized in a channel-wise manner:
+
+$$
+\bar {F} ^ {i} = \frac {F ^ {i} - \mu^ {i}}{\sigma^ {i}} \tag {1}
+$$
+
+where $\mu^i\in \mathbb{R}^{N\times C\times 1\times 1}$ and $\sigma^i\in \mathbb{R}^{N\times C\times 1\times 1}$ are the channel-wise means and standard deviations of $F^i$ . Then, we perform the modulation operation:
+
+$$
+\widetilde {F ^ {i}} = (\mathbf {1} + \gamma) \odot \bar {F} ^ {i} + \beta \tag {2}
+$$
+
+Previous work [32] applies SPADE for semantic image editing. However, SPADE is ill-fitted for semantic image editing for the following two reasons: First, SPADE can only generate image-independent modulation parameters from the given external semantic label map. Thus, if two edited images are given the same semantic label map, SPADE will generate the same modulation parameters. This is unreasonable because SPADE ignores image-specific style. Second, for semantic image editing, the generator can only see the semantic layout of the edited region, and the semantic labels of the rest known regions are set to a fixed value. Therefore, SPADE cannot learn effective parameters on the known region. If we naively transfer SPADE to semantic image editing, the above two limitations will cause style inconsistency and unpleasant boundaries.
+
+# 3.2 Style-Preserved Modulation
+
+To solve the issues mentioned above, we propose a two-stage modulation mechanism for style preserving, as shown in Figure 2(c). The first stage of modulation aims to integrate the context style and the external semantic layout. The second stage of modulation is to inject the fused information into feature maps.
+
+In the first modulation, we generate two kinds of parameters: Four semantic modulation parameters and two context modulation parameters. Semantic modulation parameters include two groups: $(\gamma_{s_1},\beta_{s_1})$ and $(\gamma_{s_2},\beta_{s_2})$ . The context modulation parameters $(\gamma_c,\beta_c)$ are generated from the original feature maps without passing through the normalization layer. The previous style transfer works [14] revealed that the style of the image could be washed away by normalization layers. The non-normalized feature maps can retain the context style more. So, we use the original feature maps to generate two context modulation parameters. Finally, we perform the first modulation to generate the fused modulation parameters $\gamma_f$ and $\beta_f$ :
+
+$$
+\gamma_ {f} = \left(\mathbf {1} + \gamma_ {s _ {2}}\right) \odot \gamma_ {c} + \beta_ {s _ {2}} \tag {3}
+$$
+
+$$
+\beta_ {f} = \left(\mathbf {1} + \gamma_ {s _ {1}}\right) \odot \beta_ {c} + \beta_ {s _ {1}} \tag {4}
+$$
+
+where $\odot$ denotes element-wise multiplication. All modulation parameters have the same shape as the feature maps $F^i$ .
+
+
+Fig. 3: Overview of the progressive architecture.
+
+In the second modulation, we use fused modulation parameters to modulate the normalized feature maps $\bar{F}^i$ .
+
+$$
+\widetilde {F ^ {i}} = \left(\mathbf {1} + \gamma_ {f}\right) \odot \bar {F} ^ {i} + \beta_ {f} \tag {5}
+$$
+
+Through two-stage modulation process, SPM overcomes the two shortcomings of SPADE: First, the fused modulation parameters integrate the external semantic layout and retain the internal context style. Second, the fused modulation parameters can generate meaningful modulation parameters for known regions.
+
+# 3.3 Progressive Editing Architecture
+
+We propose a progressive architecture for image editing based on SPM, called SPMPGAN. Our model has three inputs: (1) The input image $I \in \mathbb{R}^{256 \times 256 \times 3}$ which contains only known pixels with masked edited region; (2) the local semantic map $S$ providing the semantic layouts of the edited region; and (3) the corresponding mask map $M$ whose value is 0 in the non-edited region and 1 in the edited region. Our progressive architecture consists of a pyramid of generators $\{G_1, G_2, G_3\}$ and discriminators $\{D_1, D_2, D_3\}$ with an image pyramid of $I$ : $\{I_1, I_2, I_3\}$ , where $I_n$ is a downsampled version of $I$ by a factor $2^{3 - n}$ , mask pyramid of $M$ : $\{M_1, M_2, M_3\}$ , and semantic map pyramid of $S$ : $\{S_1, S_2, S_3\}$ . Each generator $G_n$ is trained with an associated discriminator $D_n$ . $G_n$ learns to generate realistic new content in the edited region and try to fool the corresponding discriminator. $D_n$ attempts to distinguish the edited result and the real image. We adopt an encoder-decoder architecture with skip connections [36] for all generators, as shown in Figure 3. Each generator adds a down-sampling layer in the encoder and an up-sampling layer in the decoder on the previous generator. Inspired by [45], the discriminators are composed of several convolutional layers with $5 \times 5$ convolution kernel and spectral normalization [31]. The number of
+
+layers of $D_{1}$ , $D_{2}$ , and $D_{3}$ are 4, 5, and 6, respectively. Thus, each $D_{n}$ has the receptive field with the size of the input $I_{n}$ and captures the entire image's feature. The generation process starts at the coarsest $G_{1}$ and sequentially passes through $G_{2}$ and $G_{3}$ to the original scale. Specifically, the original input $I$ is downsampled to $64 \times 64$ to get $G_{1}$ 's input: $I_{G1} = I_{1}$ , and $G_{1}$ 's output is $O_{1}$ . Then, we combine the upsampled $O_{1}$ with $I_{2}$ as $G_{2}$ 's input: $I_{G2} = O_{1} \odot M_{2} + I_{2} \odot (1 - M_{2})$ . All generators and discriminators have independent weights.
+
+# 3.4 Training
+
+We train our progressive model in an end-to-end manner. The training objective for the n-th generator is comprised of a reconstruction loss and an adversarial loss $\mathcal{L}_{\mathrm{adv}}$ . The reconstruction loss consists of L1 distance loss $\mathcal{L}_1$ and perceptual loss $\mathcal{L}_{\mathrm{p}}$ [19]. We employ the hinge version adversarial loss [2,29]. The overall loss can be written as:
+
+$$
+\mathcal {L} = \mathcal {L} _ {1} + 1 0. 0 \mathcal {L} _ {\mathrm {p}} + \mathcal {L} _ {a d v} \tag {6}
+$$
+
+# 4 Experiments
+
+# 4.1 Datasets
+
+ADE20K-room ADE20K [51] has over 20,000 images together with detailed semantic labels of 150 classes. We select a subset of the ADE20K comprised of Bedroom, Hotel Room, and Living Room. This subset is called ADE20K-room. We resize all the images with their longer sides no more than 384 and their shorter sides no less than 256. We crop them to $256 \times 256$ when training. This dataset has 2246 images for training and 255 for testing.
+
+ADE20K-landscape We also selected the landscape subclass from ADE20K and use the same preprocessing approach. The difference is that this dataset has only background and no foreground objects. The training set and the testing set contain 1689 images and 155 images, respectively.
+
+Cityscapes [5] The dataset collects streetscapes of 50 German cities, which contains 33 semantic categories. The training and testing set has 2975 and 500 images, respectively, with a resolution of $2048 \times 1024$ . We downsample all images to $512 \times 256$ and crop them to $256 \times 256$ patches.
+
+# 4.2 Baselines
+
+Semantic image editing methods. We employ two existing works [11,32] as baselines. HIM [11] introduces a two-stage method for image editing. They first predict semantic layout from object bounding boxes. Then, they generate new content according to the predicted semantic layout. Because in our setting, the ground truth semantic layout of the edited region is known, we directly input
+
+
+Fig.4: Visual comparison with other methods.
+
+the ground truth layout to the second stage of HIM to get the results. SESAME [32] has similar settings with our work.
+
+Image synthesis methods. Our experiments also include several image generation methods for comparison. These recent works [41,33,37,50] can be directly transferred to our task via only modifying their generators' input. It is worth mentioning that some recent works cannot be simply adapted for our task. For example, SEAN [53] requires a full segmentation map to calculate their style codes. CoCosNetv2 [52] requires a full segmentation map to perform their domain alignment. However, our task can only see local semantic label maps.
+
+# 4.3 Implementation Details
+
+To obtain a more flexible model, we employ five types of masks for training: Free-form mask, extension mask, outpainting mask, instance mask, and class mask. The extension mask is the right half of the input. For the outpainting
+
+
+Fig. 5: Visual results of addition and removal objects.
+
+mask, we randomly retain a $128 \times 128$ patch as the known region. The instance mask contains only a single foreground target, and the class mask drops all the pixels belonging to a semantic class. During training, each mask is randomly selected and sent to the network at each iteration. We use Adam optimizers [23] for both the generator and the discriminators with momentum $\beta_{1} = 0.5$ and $\beta_{2} = 0.999$ . The learning rates for the generator and the discriminators are set to 0.0001 and 0.0004, respectively. All models are trained for 500 epochs on all datasets. The batch size is set to the maximum value to fit the memory size of a single NVIDIA RTX 3090 GPU.
+
+# 4.4 Semantic Image Editing
+
+We compare our results with state-of-the-art methods using free-form masks, extension masks, and outpainting masks on the three benchmarks. Figure 4 provides some visual comparisons. Pix2pixHD[41] and HIM[11] only use semantic label maps as conditions in the input layer, and they often generate artifacts. SPADE[33], CLADE[37], and SESAME[32] can synthesize reasonable structures and realistic textures, but they severely suffer from style inconsistencies leading
+
+Table 1: Quantitative comparison with different mask types (↑: Higher is better; ↓: Lower is better). In the leftmost column, M, F, E, and O represent Mask Type, Free-Form Mask, Extension Mask, and Outpainting Mask, respectively.
+
+| M | Method | ADE20k-Room | ADE20k-Landscape | Cityscapes |
| FID↓ | LPIPS↓ | mIoU↑ | FID↓ | LPIPS↓ | mIoU↑ | FID↓ | LPIPS↓ | mIoU↑ |
| F | pix2pixHD | 23.72 | 0.107 | 27.49 | 33.90 | 0.120 | 28.30 | 15.28 | 0.090 | 58.69 |
| SPADE | 27.65 | 0.124 | 27.47 | 41.92 | 0.134 | 28.41 | 15.83 | 0.099 | 59.10 |
| CLADE | 30.77 | 0.126 | 25.91 | 46.59 | 0.139 | 26.39 | 17.06 | 0.103 | 57.72 |
| Co-Mod | 27.37 | 0.111 | 27.52 | 32.35 | 0.124 | 28.60 | 15.88 | 0.097 | 56.50 |
| HIM | 28.64 | 0.133 | 28.04 | 35.89 | 0.116 | 28.43 | 15.58 | 0.093 | 58.99 |
| SESAME | 21.73 | 0.101 | 27.50 | 30.30 | 0.116 | 28.28 | 12.89 | 0.082 | 58.88 |
| SPMPGAN | 18.83 | 0.090 | 28.22 | 23.11 | 0.105 | 28.73 | 11.90 | 0.084 | 58.80 |
| E | pix2pixHD | 38.08 | 0.223 | 27.32 | 56.15 | 0.242 | 28.10 | 26.14 | 0.176 | 58.55 |
| SPADE | 36.43 | 0.211 | 27.62 | 68.96 | 0.277 | 28.44 | 25.78 | 0.194 | 59.01 |
| CLADE | 41.77 | 0.242 | 25.67 | 65.33 | 0.267 | 26.39 | 25.29 | 0.195 | 58.09 |
| Co-Mod | 38.61 | 0.231 | 27.13 | 53.96 | 0.249 | 28.09 | 29.27 | 0.188 | 56.44 |
| HIM | 40.69 | 0.239 | 27.61 | 52.14 | 0.234 | 28.42 | 25.20 | 0.180 | 58.91 |
| SESAME | 36.43 | 0.211 | 27.62 | 48.16 | 0.232 | 28.31 | 20.30 | 0.168 | 59.08 |
| SPMPGAN | 32.61 | 0.199 | 27.73 | 45.10 | 0.217 | 28.48 | 19.46 | 0.167 | 59.10 |
| O | pix2pixHD | 52.14 | 0.323 | 27.49 | 82.56 | 0.360 | 28.30 | 39.50 | 0.253 | 58.72 |
| SPADE | 47.72 | 0.305 | 27.40 | 88.79 | 0.389 | 28.30 | 33.97 | 0.268 | 59.07 |
| CLADE | 52.45 | 0.346 | 25.47 | 86.77 | 0.388 | 24.49 | 34.19 | 0.276 | 57.49 |
| Co-Mod | 51.45 | 0.325 | 26.54 | 79.77 | 0.360 | 26.70 | 50.29 | 0.264 | 55.39 |
| HIM | 54.51 | 0.337 | 28.19 | 77.18 | 0.352 | 28.57 | 36.27 | 0.252 | 58.99 |
| SESAME | 47.72 | 0.305 | 27.40 | 72.28 | 0.344 | 28.13 | 28.27 | 0.237 | 58.75 |
| SPMPGAN | 41.52 | 0.288 | 27.85 | 63.32 | 0.328 | 27.56 | 27.63 | 0.233 | 58.53 |
+
+to unpleasant boundaries. Because they only use the image-independent external semantic map when injecting the semantic label map and completely ignoring the context information. Co-Mod[50] also has the apparent texture inconsistency as it lacked a specific design for the image editing tasks. The proposed method can effectively integrate the contextual style and the semantic layout to produce realistic textures while preserving the contextual style. Table 1 also shows the quantitative comparison results. FID [10] has been widely demonstrated that it is consistent with human visual perception. A lower FID value indicates that results have higher fidelity. LPIPS[49] evaluates the similarity between the generated image and the corresponding ground truth in a pairwise manner. A lower LPIPS indicates that the generated image is closer to the ground truth. mIoU is employed in the semantic synthesis task [33] to evaluate the alignment between the semantic label map and the generated result. Our method outperforms the other methods in most evaluation metrics.
+
+# 4.5 Addition and Removal of Objects
+
+Our work is capable of adding or removing individual objects by modifying the semantic label maps. Visual results are demonstrated in Figure 5. For the object
+
+
+Fig.6: Visual comparison of ablation studies.
+
+Table 2: Addition and removal results for Cityscapes and ADE20k-Room.
+
+| Manipulation | Method | ADE20k-Room | Cityscapes |
| FID↓ | LPIPS↓ | mIoU↑ | FID↓ | LPIPS↓ | mIoU↑ |
| Addition | pix2pixHD | 6.29 | 0.027 | 27.09 | 11.77 | 0.030 | 58.28 |
| SPADE | 5.66 | 0.027 | 27.17 | 10.48 | 0.031 | 58.66 |
| CLADE | 6.21 | 0.028 | 27.16 | 11.03 | 0.031 | 57.55 |
| Co-Mod | 5.75 | 0.026 | 27.23 | 11.28 | 0.031 | 56.40 |
| HIM | 9.80 | 0.046 | 27.22 | 11.41 | 0.030 | 58.75 |
| SESAME | 5.50 | 0.024 | 27.14 | 9.70 | 0.027 | 58.56 |
| SPMPGAN | 5.14 | 0.022 | 27.43 | 9.04 | 0.026 | 58.68 |
| Removal | pix2pixHD | 4.52 | 0.019 | 28.32 | 15.01 | 0.039 | 55.02 |
| SPADE | 3.96 | 0.019 | 28.35 | 15.48 | 0.040 | 55.04 |
| CLADE | 4.12 | 0.019 | 28.34 | 16.18 | 0.040 | 54.22 |
| Co-Mod | 4.03 | 0.019 | 28.33 | 15.05 | 0.041 | 55.10 |
| HIM | 7.44 | 0.035 | 28.33 | 15.10 | 0.040 | 55.11 |
| SESAME | 4.02 | 0.018 | 28.34 | 15.52 | 0.041 | 55.08 |
| SPMPGAN | 3.68 | 0.016 | 28.35 | 14.63 | 0.039 | 55.01 |
+
+addition, we randomly select an instance of input and extract the boundary boxes to generate its local semantic label map. For object removal, we delete a instance and fill it with nearby background semantic class. Quantitative results shown in Table 2 indicate that our method achieves the best results in style preservation and fidelity.
+
+# 4.6 Controllable Panorama Generation
+
+A well-trained model can be used recursively to obtain panoramas. Specifically, we employ the generated region of the previous step as the known region of the next step in a sliding window manner. Thus, the input is extended to the right by 128 pixels in each step so that images with arbitrary width can be controllable synthesized. Figure 1 shows a recursive generated result.
+
+Table 3: Ablation study with different mask types.
+
+| M | Method | ADE20k-Room | ADE20k-Landscape | Cityscapes |
| FID↓ | LPIPS↓ | mIoU↑ | FID↓ | LPIPS↓ | mIoU↑ | FID↓ | LPIPS↓ | mIoU↑ |
| F | w SPADE | 23.27 | 0.098 | 27.60 | 34.71 | 0.118 | 28.39 | 14.20 | 0.091 | 58.80 |
| w norm | 20.51 | 0.098 | 27.58 | 29.87 | 0.111 | 28.31 | 12.64 | 0.085 | 58.78 |
| w/o prog | 20.47 | 0.096 | 27.42 | 25.87 | 0.109 | 28.42 | 13.07 | 0.089 | 58.73 |
| w SPADE-L | 24.11 | 0.098 | 27.61 | 34.68 | 0.116 | 28.43 | 14.40 | 0.090 | 58.79 |
| SPMPGAN-S | 18.93 | 0.090 | 28.24 | 23.21 | 0.106 | 28.70 | 11.89 | 0.084 | 58.82 |
| SPMPGAN | 18.83 | 0.090 | 28.22 | 23.11 | 0.105 | 28.73 | 11.90 | 0.084 | 58.80 |
| E | w SPADE | 36.84 | 0.220 | 27.51 | 53.02 | 0.239 | 28.92 | 21.99 | 0.173 | 58.88 |
| w norm | 32.76 | 0.205 | 27.56 | 48.43 | 0.228 | 28.92 | 20.50 | 0.176 | 59.01 |
| w/o prog | 33.87 | 0.205 | 27.44 | 45.96 | 0.222 | 28.86 | 21.00 | 0.170 | 59.09 |
| w SPADE-L | 36.14 | 0.218 | 27.48 | 53.13 | 0.240 | 28.93 | 21.86 | 0.174 | 58.81 |
| SPMPGAN-S | 31.92 | 0.200 | 27.74 | 45.17 | 0.218 | 28.47 | 19.12 | 0.167 | 59.12 |
| SPMPGAN | 32.61 | 0.199 | 27.73 | 45.10 | 0.217 | 28.48 | 19.46 | 0.167 | 59.10 |
| O | w SPADE | 47.37 | 0.321 | 28.38 | 71.52 | 0.357 | 28.84 | 31.33 | 0.244 | 58.95 |
| w norm | 42.31 | 0.300 | 28.52 | 66.52 | 0.337 | 28.82 | 27.74 | 0.235 | 57.98 |
| w/o prog | 43.98 | 0.297 | 28.05 | 66.32 | 0.329 | 27.39 | 29.54 | 0.238 | 58.53 |
| w SPADE-L | 47.16 | 0.318 | 28.39 | 70.33 | 0.354 | 28.83 | 31.43 | 0.243 | 58.95 |
| SPMPGAN-S | 41.49 | 0.289 | 27.80 | 62.43 | 0.330 | 27.63 | 27.39 | 0.228 | 58.59 |
| SPMPGAN | 41.52 | 0.288 | 27.85 | 63.32 | 0.328 | 27.56 | 27.63 | 0.233 | 58.53 |
+
+Table 4: Comparison of the number of parameters.
+
+ | w SPADE | w SPADE-L | SPMPGAN | SPMPGAN-S |
| ADE20k-Room | 63.4 M | 90.0 M | 118.4 M | 76.9 M |
| Cityscapes | 57.8 M | 81.5 M | 112.7 M | 74.0 M |
+
+# 4.7 Ablation Study
+
+# Style-preserved modulation
+
+We study the importance of SPM for style preserving. We replace all SPMs with SPADE blocks ("w SPADE"). The visual results are shown in Figure 6. It can be observed that SPADE leads to unpleasant boundaries. This is because SPADE completely ignores the image-specific context style and only uses local semantic label maps to modulate feature maps. As a comparison, SPM can relieve the inconsistency. The two-stage modulation can integrate the context style and the external semantic label map. In addition, SPM can also help the generator to synthesize more realistic texture details. We also study the influence of "bypassing norm" for style preserving. Specifically, for the generation of $\gamma_{c}$ and $\beta_{c}$ in SPM, we replace original feature maps by normalized feature maps ("w norm"). The experimental results show that the style preserving is significantly weakened. It proves that the normalization operation washes away context style. Therefore, we use the original feature maps without normalization in SPM. Quantitative results are also demonstrated in Table 3.
+
+
+Fig. 7: Outputs of all generators.
+
+# Effectiveness of progressive architecture
+
+We conduct an ablation study to demonstrate the effectiveness of the progressive design for synthesizing high-quality results. We only use the last level generator as the baseline (" $w / o$ prog"). Figure 6(c) shows that without the progressive generation, the model will produce style inconsistency and unrealistic textures. The outputs of the generators of all scales are shown in the Figure 7. It can be seen, $G_{1}$ synthesizes the global structure, and $G_{2}$ and $G_{3}$ produce the sharper detail. Quantitative results are given in Table 3, which indicates that progressive architecture contributes to performance improvement.
+
+# 4.8 Study of Model Scale
+
+This study demonstrates that our performance improvement stems from the novel design of SPM rather than increasing parameters. As shown in Table 4, our model follows SPADE to set the number of output channels $C^h$ of the shared layer to 128. We reduce $C^h$ of all SPMs to 64 and keep the structure unchanged ("SPMGAN-S"). We do not observe the performance drop. In addition, we insert more SPADE blocks into "w SPADE" to obtain a new baseline "w SPADE-L". The experimental results are shown in the Table 3, "w SPADE-L" does not obtain performance gain by simply increasing the network scale and computational consumption. The performance of "SPMGAN-S" still significantly outperforms "w SPADE-L" with fewer parameters.
+
+# 5 Conclusion
+
+This paper is dedicated to solving style inconsistency for the semantic editing task. We propose a style-preserved modulation and a progressive architecture that effectively injects the structure from semantic label maps while preserving the context style. The key of SPM lies in effectively integrating contextual information and semantic label maps. We also demonstrate the ability of our method for various applications.
+
+Acknowledgement This work is supported by State Grid Corporation of China (Grant No. 5500-202011091A-0-0-00).
+
+# References
+
+1. Alaluf, Y., Tov, O., Mokady, R., Gal, R., Bermano, A.H.: Hyperstyle: Stylegan inversion with hypernetworks for real image editing. arXiv preprint arXiv:2111.15666 (2021)
+2. Brock, A., Donahue, J., Simonyan, K.: Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096 (2018)
+3. Chen, S.Y., Liu, F.L., Lai, Y.K., Rosin, P.L., Li, C., Fu, H., Gao, L.: Deepfaceediting: Deep face generation and editing with disentangled geometry and appearance control. arXiv preprint arXiv:2105.08935 (2021)
+4. Chong, M.J., Lee, H.Y., Forsyth, D.: Stylegan of all trades: Image manipulation with only pretrained stylegan. arXiv preprint arXiv:2111.01619 (2021)
+5. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3213-3223 (2016)
+6. Dong, H., Liang, X., Zhang, Y., Zhang, X., Shen, X., Xie, Z., Wu, B., Yin, J.: Fashion editing with adversarial parsing learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8120-8128 (2020)
+7. Gatys, L.A., Ecker, A.S., Bethge, M.: Image style transfer using convolutional neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2414-2423 (2016)
+8. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: Advances in neural information processing systems. pp. 2672-2680 (2014)
+9. He, Z., Zuo, W., Kan, M., Shan, S., Chen, X.: Attgan: Facial attribute editing by only changing what you want. IEEE transactions on image processing 28(11), 5464-5478 (2019)
+0. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. In: Advances in Neural Information Processing Systems. pp. 6626-6637 (2017)
+1. Hong, S., Yan, X., Huang, T., Lee, H.: Learning hierarchical semantic image manipulation through structured representations. arXiv preprint arXiv:1808.07535 (2018)
+2. Hou, X., Zhang, X., Liang, H., Shen, L., Lai, Z., Wan, J.: Guidedstyle: Attribute knowledge guided style manipulation for semantic face editing. Neural Networks 145, 209-220 (2022)
+3. Huang, H.P., Tseng, H.Y., Lee, H.Y., Huang, J.B.: Semantic view synthesis. In: European Conference on Computer Vision. pp. 592-608. Springer (2020)
+4. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1501-1510 (2017)
+5. Huang, X., Liu, M.Y., Belongie, S., Kautz, J.: Multimodal unsupervised image-to-image translation. In: Proceedings of the European conference on computer vision (ECCV). pp. 172-189 (2018)
+6. Ioffe, S., Szegedy, C.: Batch normalization: Accelerating deep network training by reducing internal covariate shift. In: International conference on machine learning. pp. 448-456. PMLR (2015)
+7. Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1125-1134 (2017)
+
+18. Jo, Y., Park, J.: Sc-fegan: Face editing generative adversarial network with user's sketch and color. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 1745-1753 (2019)
+19. Johnson, J., Alahi, A., Fei-Fei, L.: Perceptual losses for real-time style transfer and super-resolution. In: European conference on computer vision. pp. 694-711. Springer (2016)
+20. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 4401-4410 (2019)
+21. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4401-4410 (2019)
+22. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of stylegan. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 8110-8119 (2020)
+23. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+24. Lai, W.S., Huang, J.B., Ahuja, N., Yang, M.H.: Deep laplacian pyramid networks for fast and accurate super-resolution. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 624-632 (2017)
+25. Ledig, C., Theis, L., Huszar, F., Caballero, J., Cunningham, A., Acosta, A., Aitken, A., Tejani, A., Totz, J., Wang, Z., et al.: Photo-realistic single image superresolution using a generative adversarial network. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4681-4690 (2017)
+26. Lee, C.H., Liu, Z., Wu, L., Luo, P.: Maskgan: Towards diverse and interactive facial image manipulation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5549-5558 (2020)
+27. Ling, H., Kreis, K., Li, D., Kim, S.W., Torralba, A., Fidler, S.: Editgan: High-precision semantic image editing. Advances in Neural Information Processing Systems 34 (2021)
+28. Liu, H., Wan, Z., Huang, W., Song, Y., Han, X., Liao, J., Jiang, B., Liu, W.: Deflocnet: Deep image editing via flexible low-level controls. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10765-10774 (2021)
+29. Liu, M.Y., Huang, X., Mallya, A., Karras, T., Aila, T., Lehtinen, J., Kautz, J.: Few-shot unsupervised image-to-image translation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 10551-10560 (2019)
+30. Mirza, M., Osindero, S.: Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784 (2014)
+31. Miyato, T., Kataoka, T., Koyama, M., Yoshida, Y.: Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957 (2018)
+32. Ntavelis, E., Romero, A., Kastanis, I., Gool, L.V., Timofte, R.: Sesame: Semantic editing of scenes by adding, manipulating or erasing objects. In: European Conference on Computer Vision. pp. 394-411. Springer (2020)
+33. Park, T., Liu, M.Y., Wang, T.C., Zhu, J.Y.: Semantic image synthesis with spatially-adaptive normalization. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 2337-2346 (2019)
+34. Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., Efros, A.A.: Context encoders: Feature learning by inpainting. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2536-2544 (2016)
+
+35. Perez, E., Strub, F., De Vries, H., Dumoulin, V., Courville, A.: Film: Visual reasoning with a general conditioning layer. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 32 (2018)
+36. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: International Conference on Medical image computing and computer-assisted intervention. pp. 234-241. Springer (2015)
+37. Tan, Z., Chen, D., Chu, Q., Chai, M., Liao, J., He, M., Yuan, L., Hua, G., Yu, N.: Efficient semantic image synthesis via class-adaptive normalization. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021)
+38. Teterwak, P., Sarna, A., Krishnan, D., Maschinot, A., Belanger, D., Liu, C., Freeman, W.T.: Boundless: Generative adversarial networks for image extension. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 10521-10530 (2019)
+39. Tov, O., Alaluf, Y., Nitzan, Y., Patashnik, O., Cohen-Or, D.: Designing an encoder for stylegan image manipulation. ACM Transactions on Graphics (TOG) 40(4), 1-14 (2021)
+40. Ulyanov, D., Vedaldi, A., Lempitsky, V.: Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022 (2016)
+41. Wang, T.C., Liu, M.Y., Zhu, J.Y., Tao, A., Kautz, J., Catanzaro, B.: High-resolution image synthesis and semantic manipulation with conditional gans. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 8798-8807 (2018)
+42. Wu, Y., He, K.: Group normalization. In: Proceedings of the European conference on computer vision (ECCV). pp. 3-19 (2018)
+43. Yang, Z., Dong, J., Liu, P., Yang, Y., Yan, S.: Very long natural scenery image prediction by outpainting. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 10561-10570 (2019)
+44. Yu, J., Lin, Z., Yang, J., Shen, X., Lu, X., Huang, T.S.: Generative image inpainting with contextual attention. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5505-5514 (2018)
+45. Yu, J., Lin, Z., Yang, J., Shen, X., Lu, X., Huang, T.S.: Free-form image inpainting with gated convolution. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 4471-4480 (2019)
+46. Zhan, F., Lu, S.: Esir: End-to-end scene text recognition via iterative image rectification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2059-2068 (2019)
+47. Zhan, F., Lu, S., Xue, C.: Verisimilar image synthesis for accurate detection and recognition of texts in scenes. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 249-266 (2018)
+48. Zhan, F., Zhu, H., Lu, S.: Spatial fusion gan for image synthesis. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3653-3662 (2019)
+49. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 586-595 (2018)
+50. Zhao, S., Cui, J., Sheng, Y., Dong, Y., Liang, X., Eric, I., Chang, C., Xu, Y.: Large scale image completion via co-modulated generative adversarial networks. In: International Conference on Learning Representations (2020)
+51. Zhou, B., Zhao, H., Puig, X., Fidler, S., Barriuso, A., Torralba, A.: Scene parsing through ade20k dataset. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 633-641 (2017)
+
+52. Zhou, X., Zhang, B., Zhang, T., Zhang, P., Bao, J., Chen, D., Zhang, Z., Wen, F.: Cocosnet v2: Full-resolution correspondence learning for image translation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11465-11475 (2021)
+53. Zhu, P., Abdal, R., Qin, Y., Wonka, P.: Sean: Image synthesis with semantic region-adaptive normalization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5104-5113 (2020)
\ No newline at end of file
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/images.zip b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4b81ece1ee3e2b033b4156746b945c766861b851
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c72359ec6a42779fe2fe91b35a49ab262982e58f33a49e9b2bca04b81e9b0c54
+size 1042494
diff --git a/contextconsistentsemanticimageeditingwithstylepreservedmodulation/layout.json b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8a4907e5784c215238643e122df675d160fd6a11
--- /dev/null
+++ b/contextconsistentsemanticimageeditingwithstylepreservedmodulation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b73d312c63c9e919e028282bb4f590d80883a3821095215bab18109f0db28f68
+size 381575
diff --git a/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_content_list.json b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a8308f958ed2215cecb5df892f6b18f4e7d99cd4
--- /dev/null
+++ b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0352fba14420ae76090435808b5252d8d3ef1de57eec3d289deda3d25dee9e54
+size 73431
diff --git a/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_model.json b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..380a154f7f23c54bd5e3b007c150cc6eb4ba15f6
--- /dev/null
+++ b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2b3b204ee1ee1bb2461202001b4709037d1c478eda1782218611cbe83e19e48
+size 90816
diff --git a/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_origin.pdf b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..29cca67d004bbe1cc946edff8d6c9abb755229f6
--- /dev/null
+++ b/contextenhancedstereotransformer/73706b86-1dfd-4fef-b201-0babcf663f62_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:95031e5dcff35ea8cd621dbbcf0303d312ffcfa89f398f698497d92f1590a6b7
+size 5349522
diff --git a/contextenhancedstereotransformer/full.md b/contextenhancedstereotransformer/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..293fbd8d0b8a7422cfa68c8b3b24a311ea361a38
--- /dev/null
+++ b/contextenhancedstereotransformer/full.md
@@ -0,0 +1,299 @@
+# Context-Enhanced Stereo Transformer
+
+Weiyu Guo $^{1,2(\boxtimes)}$ , Zhaoshuo Li $^{3(\boxtimes)}$ , Yongkui Yang $^{1(\boxtimes)}$ , Zheng Wang $^{1(\boxtimes)}$ , Russell H. Taylor $^{3}$ , Mathias Unberath $^{3}$ , Alan Yuille $^{3}$ , and Yingwei Li $^{3(\boxtimes)}$
+
+1 Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, Shenzhen, China
+$^{2}$ University of Chinese Academy of Sciences, Beijing, China
+3 Johns Hopkins University, Baltimore, USA
+
+{wy.guo,yk.yang,zheng.wang}@siat.ac.cn,{zli122,yingwei.li}@jhu.edu
+
+Abstract. Stereo depth estimation is of great interest for computer vision research. However, existing methods struggles to generalize and predict reliably in hazardous regions, such as large uniform regions. To overcome these limitations, we propose Context Enhanced Path (CEP). CEP improves the generalization and robustness against common failure cases in existing solutions by capturing the long-range global information. We construct our stereo depth estimation model, Context Enhanced Stereo Transformer (CEST), by plugging CEP into the state-of-the-art stereo depth estimation method Stereo Transformer. CEST is examined on distinct public datasets, such as Scene Flow, Middlebury-2014, KITTI-2015, and MPI-Sintel. We find CEST outperforms prior approaches by a large margin. For example, in the zero-shot synthetic-to-real setting, CEST outperforms the best competing approaches on Middlebury-2014 dataset by $11\%$ . Our extensive experiments demonstrate that the long-range information is critical for stereo matching task and CEP successfully captures such information†.
+
+Keywords: Stereo depth estimation, transformer, context extraction
+
+# 1 Introduction
+
+Stereo depth estimation is a critical task in computer vision that has been widely used in various fields, such as robotics [27], autonomous driving [24], and 3D scene reconstruction [29]. Recent developments in learning-based stereo disparity estimation algorithms generally use using techniques restricted to local information for matching the feature patterns between the left and right images. For example, prior works [2,8,36] construct a cost volume with pre-defined disparity range and use 3D convolutions to process the cost volume, limiting themselves to the receptive field of convolution kernel. Xu et al.[32] proposed to instead process the cost volume using 2D convolutions, however, facing the same challenge. Recently, approaches that attempt to capture more global information have been proposed. For example, STTR [17] and RAFT-Stereo [19] computes
+
+attention or correlation between all pixels of the left and right images on the same epipolar lines. However, they all fail to take advantage of cross-epipolar line information, which is a critical component of global information processing. Thus, as shown in Figure 1, these methods cannot address hazardous regions like textureless, large uniform regions, specularity, and transparency [15,37], which are particularly challenging for stereo algorithms to produce reliable estimates. The features of left and right frames in these regions are often similar or misleading, which makes the feature matching ambiguous [37]. If disparities of these regions cannot be reliably predicted, downstream applications, such as 3D object detection [28], may be severely impacted due to missing or wrong predictions. Therefore, in this paper, we seek to answer this critical question: how to guide the stereo models properly handle those hazardous regions.
+
+To address this question, we hypothesize that the long-range contextual information help to improve the predictions on hazardous regions. For example, as shown in Figure 1 (a), previous work performs unreliablely in large white wall. However, if we could use the global information (e.g., orientation, edge information) of the house, the prediction can be improved. Such global context information in theory will inform the model about the geometry on a global scale and guide the model to resolve the ambiguity in prediction. To this end, we proposed a plug-in module, called Context Enhanced Path (CEP), which helps stereo matching models to better understand the global structure of the hazardous regions. Compared to existing methods, CEP offers the following three unique advantages: (1) strong generalization ability, compared with previous methods [2,17], CEP shows strong results on unseen real-world data even if only training on synthetic data; (2) robustness against hazardous, thanks to modeling the long-range contextual information.(3) generic, unlike [9,14,34], our method serves as a plug-in that can be potentially applied to most of stereo matching methods. We construct our stereo depth estimation model based on CEP, namely Context Enhanced Stereo Transformer (CEST). We have examined CEST on several popular and diverse datasets, such as, Middlebury-2014[26], KITTI-2015 [24], and MPI sintel [1]. Our extensive experiments demonstrate that (1) the long-range information is critical for stereo depth estimation, (2) CEST attains strong generalization ability, and (3) more importantly, CEST can better handle hazardous regions, such as texturelessness and disparity jumps (shown in Figure 1 and Table 3). This result is attributed to our simple yet powerful observation: using long-range contextual information to better understand the global structure of the image can significantly help stereo depth estimation especially for those hazardous area. This result suggests that modeling long-range context information is critical for building a robust and generalizable stereo depth estimation algorithm.
+
+To summarize, our contributions are 3-fold: (1) we found global contextual information is critical for stereo depth estimation; (2) we design a plug-in module, Context Enhanced Path (CEP), for generic stereo depth estimation models; (3) we integrate our plug-in module and build a stereo matching model named Context Enhanced Stereo Transformer (CEST), which achieves the state-of-the
+
+
+Fig.1. Sample visualizations of hazardous regions taken from KITTI-2015 and Middlebury-2014 datasets. First row is the input left images. Second row is the disparity predicted by Stereo Transformer (STTR) [17]. Third row is the disparity predicted by our proposed Context Enhanced Stereo Transformer (CSTR). The color map shown on the right is based on the disparity value relative to the image width.
+
+
+(a) Texturelessness
+
+
+(b) Specularity
+
+
+(c) Transparency
+Fig. 2. Examples of hazardous regions including: (a) Texturelessness: the wall and the ceiling in the room a (b) Specularity: the screen of a TV (c) Transparency: the sliding door (d) Disparity jumps: objects such as bamboos, fences and plants give frequent disparity discontinuities. Images are from Zhang et al. [37].
+
+
+(d) Disparity jumps
+
+art generalisation results on several popular datasets, including Middlebury-2014-2014[26], KITTI-2015 [24], and MPI-sintel [1].
+
+# 2 Related Work
+
+Rectified stereo depth estimation obtains per-pixel depth from the left and right frames provided by the binocular camera. It has a wide range of applications in robotics, autonomous driving, scene understanding, 3D modeling, etc. In contrast to the success of deep learning in many high-level vision problems, low-level deep learning algorithms for vision tasks are still in their early stages [15]. In the field of stereo depth estimation, many works aim to improve a single step of the classical pipeline by replacing it with a deep learning module [15,38], where the quality of cost volume directly determines the accuracy of the disparity map. Chen et al. proposed Deep Embed to learn a cost function from
+
+different windows by processing multi-patches at different resolutions [4]. After cost volume computation, cost aggregation is essential for gathering large context information from the huge cost volume. One of the most popular cost aggregation techniques is Semiglobal Matching (SGM) [12]. A global energy function related to the disparity map is set to minimize this energy function to solve the optimal disparity of each pixel. The raw disparity map should be refined by a post-processing algorithm.
+
+Although there are still several remaining challenges, recently, end-to-end deep learning begin to be used in binocular stereo depth estimation and dominate dense disparity estimation in several well-known benchmarks. In order to keep memory feasible and inference speed manageable, many researchers adopt 2D convolution-based methods. These architectures always contain a self-design layer namely correlation layer in charge of computing correlation scores between left and right features. Mayer et al. proposed an encoder-decoder architecture based on U-net named DispNet [23]. Some researchers adopt 3D convolutions in stereo matching which take a 4D tensor (disparity range, height, weight, feature) as the input and directly process a matching volume-like representation. Chang et al. proposed Pyramidal Stereo Matching network (PSMNet) to integrate Spatial Pyramidal Pooling layers (SPP) in the feature extractor [2]. However, these methods lead to large computational costs, such as huge memory cost and low inference speed. Besides, the disparity range of the conventional methods are limited, preventing them to be used in many cases when the scenes are close to the camera. Recently, Li et al. use a sequence-to-sequence perspective to replace cost volume construction with dense pixel matching [17]. Lipson et al. unify stereo and optical flow approaches and utilize GRU to iteratively generate the final disparity map [19]. Others [18,16] exploit auxiliary information for depth estimation. However, stereo depth estimation is still limited by difficulties like textureless surfaces, disparity jumps, and occlusions.
+
+Hazardous Regions Most of stereo algorithms rely on the following basic assumptions [37]: (1) well-textured local surface for feature extraction without large homogeneous regions; (2) single image layer assumption with only Lambertian surface; (3) the disparity varies slowly and smoothly in space without sudden jumps. However, as shown in Figure 2, these assumptions can easily be broken in many real world scenarios. For example, textureless regions like large wall are commonly seen and specular surfaces will create multiple image layers. Furthermore, disparity jumps can break the local smoothness assumption. The aforementioned regions are called hazardous regions [35]. In this work, we specifically study these commonly seen yet challenging scenarios for more robust stereo depth estimation.
+
+Efficient Attention Attention has a good ability to capture correspondence between two sequences and solves the problem that RNN cannot be calculated in parallel[30]. There are many successful applications that adopt attention to encode long-range sequences [3]. Recently, attention has been applied to extract non-local features in computer vision and led to SOTA performance for many vision tasks [7]. However, it is computational expensive when the input of attention
+
+
+Fig. 3. CSTR consists of two main components: (1) Context Enhanced Path that extracts long-range context information in low resolution feature. (2) Main Matching Path that use Axial-Attention to enhance context and Cross-Attention to compute raw disparity. Then a learnable Up Sampling block up restore the original scale of disparity and Context Adjustment block refines the disparity with context information across epipolar lines conditioned on the left image.
+
+module is large. In order to reduce its complexity, efficient attention approaches have been proposed. Yang et al. incorporate coarse-grained global attention and fine-grained local attentions depending on the distance to the token [33].
+
+Axial Attention Wang et al. factorize 2D self-attention into two 1D self-attention to propose Axial-Attention [31]. In this paper, we adopt Axial-Attention to enhance context of feature before pixel matching. Most previous works proposed efficient attention by adding various local constraints. However, these constraints always sacrifice the global context and limit the attention's receptive field.
+
+To ensure both efficient computation and global context, Wang et al. employ two Axial-Attention layers consecutively for the height-axis and width-axis, respectively[31]. A width-axis attention layer can be described as:
+
+$$
+y _ {i} = \sum_ {j \in N _ {(W * 1)} (i)} S \left(q _ {i} ^ {T} k _ {i} + q _ {i} ^ {T} r _ {j - i}\right) \left(v _ {j}\right) \tag {1}
+$$
+
+where $N_{w*1}(i)$ is the $w * h$ scale 1D region around $i$ stands for relative position encoding, and $q, k, v, S$ denote query, key, value, soft-max, respectively. In practice, $w * h$ is much smaller than the full feature shape.
+
+Compared with local constraints attention, width-Axial-Attention computes the attention line by line with weight sharing. $W$ is equal to the width of input. Height-axis attention is the same as width-Axial-Attention besides computing the attention column by column.
+
+Furthermore, positional information is critical for pixel matching, especially in large textureless regions. Due to shift-invariance in an image, we adopt relative position encoding to add data-only-dependent spatial information. A classical
+
+attention mechanism with relative position encoding can be described as follows.
+
+$$
+\begin{array}{l} a _ {i, j} = x _ {i} W _ {q} W _ {k} ^ {T} x _ {j} ^ {T} + x _ {i} W _ {q} W _ {k} ^ {T} p _ {j} ^ {T} \tag {2} \\ + p _ {i} W _ {q} W _ {k} ^ {T} x _ {j} ^ {T} + p _ {i} W _ {q} W _ {k} ^ {T} p _ {j} ^ {T} \\ \end{array}
+$$
+
+In Equation (2), the four terms for addition represent content-content, content-position, position-content, position-position, respectively. However, disparity computation mainly depends on the image content. To remove redundancy and ensure efficiency, we delete the last term in Equation (2) and the equation becomes:
+
+$$
+a _ {i, j} = x _ {i} W _ {q} W _ {k} ^ {T} x _ {j} ^ {T} + x _ {i} W _ {q} W _ {k} ^ {T} p _ {j} ^ {T} + p _ {i} W _ {q} W _ {k} ^ {T} x _ {j} ^ {T} \tag {3}
+$$
+
+In the field of NLP, a similar design is adopted in DeBERT[11] and it is found that most tasks only require relative position information.
+
+# 3 Context Enhanced Path
+
+We propose a plug-in module, Context Enhanced Path (CEP), that provides additional context information to help stereo matching model to better understand the global structure of the input images. The goal of CEP is to maintain the context features for left and right images, and provide the context features to the Main Matching Path as additional complementary information. The detailed structure of the CEP is shown in Figure 4. As a layer-by-layer module, CEP first obtains the context feature from the previous CEP layer. Then, the Axial-Attention layer and the Cross-Attention layer are applied to further process the context features. The processed context features are served as the complementary information used for fusing with the Main Matching Path. Finally, we generate the context features as the input of the next CEP layer with 3 different strategies $(M_{1}, M_{2}, M_{3})$ . From $M_{1}$ to $M_{3}$ , the enhancement of the context information extraction increases sequentially. In the $M_{1}$ , we only use low-level features to extract context information. Specifically, the features output by backbone only go through one layer of Axial-Attention and one layer of Cross-Attention before fusing with the main matching path. Compared to $M_{1}$ , $M_{2}$ extract higher-level context information. In the $M_{2}$ , the features output by backbone go through $L$ layers of Axial-Attention and one layer of Cross-Attention before being fused to the $L$ -th layer of the main matching path. In the $M_{3}$ , the features output by backbone go through $L$ layers of Axial-Attention and $L$ layers of Cross-Attention before the fusion.
+
+# 4 Context Enhanced Stereo Transformer
+
+Based on our proposed Context Enhanced Path, we further propose a transformer-based stereo depth estimation model, Context Enhanced Stereo Transformer (CSTR). We will first introduce the architecture of CSTR, and then introduce each component in detail.
+
+
+(a) M1
+
+
+(b) M2
+
+
+(c) M3
+Fig. 4. Three different design choices for Context Enhanced Path (CEP). All strategies are composed of Axial-Attention and Cross-Attention, but the feature fed to next layer is different.
+
+# 4.1 Pipeline
+
+The architecture of CSTR is shown in Figure 3. The whole pipeline is mainly following the architecture of STTR [17] but the context information is enhanced. Given the pair of left (L) and right (R) input images, a convolution-based backbone is used to extract the left and the right features separately. The pair of left and right features then processed by several CSTR layers to obtain the disparity map with a coarse-to-fine manner. In each CSTR layer, there are 3 critical modules (Context Enhanced Path, Main Matching Path, and the path fusion module) that helps to incorporate the context information for generating better disparity map. The Context Enhanced Path is discussed in Section 3, the other two modules, Main Matching Path and the path fusion module, will be explained in detail in the rest part of this section. Finally, we apply several post-processing modules (e.g., optimal transport layer, upsampling layer, and context adjust layer) to obtain the final disparity.
+
+# 4.2 Main Matching Path
+
+Main Matching Path is similar to the Transformer module from STTR [17], which includes a self-attention module followed by a Cross-Attention module as shown in Figure 6 (a). The self-attention module is used to aggregate the information in the same image, while the Cross-Attention module is used to compute the similarity of pixels from the different images. Note that the self-attention module only computes attention between pixels along the same epipolar line in the same image, leading to difficulty to collection contextual information from other epipolar lines.
+
+To help the model gather more context information, as shown in Figure 6 (b), we replace the original self-attention layer to an Axial-Attention layer, including
+
+
+Fig. 5. Path Fusion Module. (h, w,c) represent height, width and the number of feature channel. (1) The MMP feature is first concatenated with the upsampled context feature. (2) Two convolution layers are applied to the concatenated feature to aggregate the context information to the Main Matching Path(MMP) features. (3) We use the fused feature as the input of the next MMP module
+
+
+(a) STTR
+
+
+(b) MMP
+Fig. 6. (a) Overview of the Matching Path in STTR. (b) Overview of the Main Matching Path with alternating Axial-Attention and Cross-Attention in CSTR.
+
+a horizontal Axial-Attention module and a vertical Axial-Attention module, to collect the context information from both horizontal and vertical axials.
+
+# 4.3 Path Fusion Module
+
+The path fusion module aims to fuse the context feature from the Context Enhanced Path (CEP) to the main matching features in the Main Matching Path (MMP). This will keep the main matching path capturing long-range context from low-resolution features. The architecture is shown in Figure 5. Specifically, the MMP feature is first concatenated with the upsampled context feature. Then, two convolution layers are applied to the concatenated feature to aggregate the context information to the main features. Finally, we use the fused feature as the input of the next main matching path module.
+
+# 4.4 Other Important Modules
+
+This section discusses other important modules in our pipeline, including Attention Mask, Optimal Transport, Raw Disparity and Occlusion Computation. Other details are illustrated in Section 5.2.
+
+Attention Mask and Optimal Transport We further compress the pixels' matching space based on the following two observations.
+
+First, when a point in the physical world is imaged by a binocular camera, the imaging position in the left image will be more to the left than the imaging position in the right image. Let us denote the $P_L$ , $P_R$ as the imaging point of a real point in the left and right image. Then the following formula always holds:
+
+$$
+P _ {L} - P _ {R} < = 0 \tag {4}
+$$
+
+Therefore, the point at $P_L$ in the left image should just match the candidate point at $P > P_L$ in the right image.
+
+Second, every pixel in the left image can only match one pixel in the right image which is called uniqueness constraint. We adopt entropy-regularized optimal transport [5] to implement such constraints in a soft way. Entropy-regularized optimal transport is proposed to improve the network performance in a similar task of semantic correspondence matching [21]. In the following section, we denote the optimal transport assignment matrix as $T$ which contains a correlation score of pixels in two images.
+
+Raw Disparity and Occlusion Computation In order to improve the model robustness in multi-modal distributions, we use a small number of candidate disparity in a local region rather than use all candidate disparity. First, we compute raw disparity by finding the location $(S_h)$ of the highest correlation score. Then, a 3 px window $N_{3x3}(S_h)$ is built around $S_h$ in matrix $T$ to regress raw disparity. $t$ is used to represent correlation score in $N_{3x3}(S_h)$ . The raw disparity regression can be described as:
+
+$$
+\sum_ {i \in N _ {3 * 3} \left(S _ {h}\right)} t _ {i} = 1, i \in N _ {3 * 3} \left(S _ {h}\right) \tag {5}
+$$
+
+$$
+\bar {t _ {i}} = \frac {t _ {i}}{\sum_ {i \in N _ {3 * 3} \left(S _ {h}\right)}}, i \in N _ {3 * 3} \left(S _ {h}\right) \tag {6}
+$$
+
+$$
+\overline {{d _ {r a w} (S _ {h})}} = \sum_ {i \in N _ {3 * 3} (S _ {h})} d _ {i} \bar {t _ {i}} \tag {7}
+$$
+
+where $\overline{d_{raw}}$ represents regressed raw disparity and $d_i$ denotes the raw disparity in $N_{3*3}(S_h)$ . Occlusion probability $(p_{occ}(S_h))$ can be interpreted as the probability that one pixel has no matching pixel in another image. Thus it can be described as:
+
+$$
+p _ {o c c} \left(S _ {h}\right) = 1 - \sum_ {i \in N _ {3 * 3} \left(S _ {h}\right)} t _ {i} \tag {8}
+$$
+
+
+Fig. 7. Results on KITTI-2015, Middlebury-2014, MPI Sintel in zero-shot synthetic-to-real setting. Black represent occlusion. The color map is the image width $\times 0.2$ and is shown on the right which used to visualize disparity.
+
+# 5 Experiments
+
+# 5.1 Experimental Settings
+
+Datasets. We evaluate CSTR on four popular but diverse datasets: Scene Flow [23], KITTI-2015 [24], Middlebury [26], and MPI Sintel [1]. These datasets contain random objects, real street scene, indoor scene, and realistic artifacts, respectively. Scene Flow is a synthetic dataset of random object with many subset. We use FlyingThings3D subset with 21818 training samples $(960\times 540)$ in the experiment. KITTI-2015 contains stereo videos of road scenes from a calibrated pair of cameras mounted on a car with 200 training samples $(1242\times 375)$ . MPI Sintel contains sufficiently realistic scenes including natural image degradations such as fog and motion blur with 1064 training samples $(1024\times 436)$ .
+
+Evaluation Metric. We use both EPE (end-point-error) and 3 px Error (percentage of $\mathrm{EPE} > 3$ ) as evaluation metrics. we use Intersection over Union (IOU) to evaluate occlusion estimation. In the rest of this Section, we report the results for the non-occluded regions.
+
+# 5.2 Implementation Details
+
+CSTR is implemented in Pytorch [25] and is trained using one Tesla A100 GPU. During training, we use the AdamW[22] optimizer with weight decay of 1e-4. We pre-train on Scene Flow for 17 epochs using a fixed learning rate of 1e-4 for the CSTR layer and backbone, and 2e-4 for the context adjustment layer.
+
+Feature Extractor In order to efficiently extract both global and local context information, we adopt an hourglass-shaped feature extractor composed of encoding and decoding paths. The encoding path is based on spatial pyramid pooling [2] modules and residual blocks [10] while the decoding path consists of dens-blocks [13], transposed convolution layer, a final average pooling layer for generating multi-scale features. The scale of feature map output by transposed convolution layer is at 1/4 resolution as the input image. For an input
+
+
+Fig. 8. KITTI-2015's ground truth is missing part of occlusion. However CSTR can accurately give this part of the missing occlusion. First row are left image and ground truth. Second row are right image and our predicted disparity.
+
+like $(H,W)$ , we generate a multi-scale feature $(H,W / 2K)$ with repeating average pooling of the width dimension, where $K$ is the down sample rate.
+
+Supervision Motivated by Relative Response loss $L_{rr}[20]$ , we split assignment matrix $T$ to matched pixel sets $M$ and unmatched pixel sets $U$ . The loss can be described as:
+
+$$
+t _ {i} ^ {*} = \operatorname {L i n e r I n t e r p} \left(T _ {i}, p _ {i} - d _ {g t, i}\right) \tag {9}
+$$
+
+$$
+L _ {r r} = \frac {1}{N _ {M}} \sum_ {i \in M} - \log \left(t _ {i} ^ {*}\right) + \frac {1}{N _ {U}} \sum_ {i \in M} - \log \left(t _ {i, \Phi}\right) \tag {10}
+$$
+
+where $t_i$ stands for $i$ -th matching probability and $d_{gt,i}$ represents $i$ -th ground truth disparity. To accelerate the convergence of the model, we adopt smooth L1 [6] on both raw and final disparities. Furthermore, we use a binary-entropy loss to supervise the occlusion map. The total loss $L$ is computed as:
+
+$$
+L = w _ {1} L _ {r r, r a w} + w _ {2} L _ {d 1, r a w} + \tag {11}
+$$
+
+$$
+w _ {3} L _ {d 1, f i n a l} + w _ {4} L _ {b e, f i n a l}
+$$
+
+where $L_{rr,raw}$ , $L_{d1,raw}$ , $L_{d1,final}$ , $L_{be,final}$ represent Relative Response loss on raw disparity, L1 loss on raw disparity, L1 loss on final disparity,binary-entropy loss on final occlusion, respectively.
+
+Hyperparameters. In our experiments, we use 6 CSTR layers with feature of 128 channels. We use multi-head attention with 4 heads. The resolution of feature in MMP is set to $1/4$ of full resolution. Sinkhorn algorithm is run for 10 iterations [5].
+
+Baselines. In this work, we compare CSTR with prior work based on different learning-based stereo depth paradigms: PSMNet [2] is a 3D convolution-based model consists two main modules — spatial pyramid pooling and 3D CNN; AANet[32] is a correlation-based model which is proposed to replace 3D convolutions to realize fast inference speed while ensure comparable accuracy;
+
+Table 1. Generalization experiment. The models are only trained on Scene Flow without fine-tuning on MPI Sintel, KITTI-2015, Middlebury-2014 dataset. Bold is the best result.
+
+ | Middlebury 2014(varies) | MPI Sintel† (1024 * 436) | KITTI-2015 (1242 * 375) |
| 3px Error ↓ | EPE ↓ | Occ IOU ↑ | 3px Error ↓ | EPE ↓ | Occ IOU ↑ | 3px Error ↓ | EPE ↓ | Occ IOU ↑ |
| AANet | 6.29 | 2.24 | Null | 9.57 | 1.71 | Null | 7.06 | 1.31 | Null |
| PSMNet | 7.93 | 3.70 | Null | 10.24 | 2.02 | Null | 7.43 | 1.39 | Null |
| GwcNet-g | 5.83 | 1.32 | Null | 6.60 | 1.95 | Null | 6.75 | 1.59 | Null |
| RAFT-Stereo | 7.57 | 1.21 | Null | 13.02 | 17.36 | Null | 5.68 | 1.10 | Null |
| STTR | 6.19 | 2.33 | 0.95 | 5.75 | 3.01 | 0.86 | 6.74 | 1.50 | 0.98 |
| CSTR (Ours) | 5.16 | 1.16 | 0.95 | 5.51 | 2.58 | 0.92 | 5.78 | 1.43 | 0.98 |
+
+GwcNet-g[8] is a correlation and 3D convolution hybrid approach which constructs the cost volume by group-wise correlation; STTR[17] is a transformer-based model which revisits the problem from a sequence-to-sequence correspondence perspective to replace cost volume construction; RAFT-stereo[19] is a state-of-the-art recurrent model on Middlebury-2014 and Scene Flow datasets using iterative refinement to compute disparity.
+
+# 5.3 Zero-Shot Generalization
+
+We compare the zero-shot generalization ability between our proposed CSTR and previous popular stereo depth estimation methods. Specifically, the models are trained on the SceneFlow synthetic dataset, and then test on real data such as KITTI-2015 (real outdoor scene), Middlebury-2014 (real indoor scene), and MPI Sintel (Synthesized complex game scenes).
+
+The results are shown in Table 1. Our model CSTR is better than our baseline method STTR [17] on all datasets and on all different metrics. For example, compared with the STTR baseline, the 3px error on Middlebury dataset is improved from 6.19 to 5.16. These improvements show that the design of context extraction of our network facilitates generalization.
+
+Besides, our model achieves the best results on both Middlebury 2014 and MPI Sintel datasets compared with previous methods. The quantitative results on KITTI-2015 dataset is not as good as RAFT-Stereo. Compared with RAFT-Stereo, the 3px error is dropped from 5.68 to 5.78. However, by visualizing and comparing the ground-truth label and the output of CSTR, we observe that our predicted results are even more precise than the grounding truth in the occlusion areas. See Figure 8 for more details.
+
+# 5.4 Ablations
+
+In Table 2, we provide quantitative results for the effects of the Axial-Attention and three different context extraction strategies. All ablated models are trained on FlyingThings of Scene Flow. Below we describe each of the experiments in more detail.
+
+Table 2. Ablation generalization experiments. The model only trained on Scene Flow without fine-tune. Following prior work, we validate on the Scene Flow test set. STTR: Stereo Transformer; MMP: Main Matching Path with Aixal-Attention; $M_1,M_1,M_1$ are three different Context Enhanced Path.
+
+| Experiment | Scene Flow | Middlebury-2014 |
| STTR | MMP | \( M_1 \) | \( M_2 \) | \( M_3 \) | 3px Err | EPE | IOU | 3px Err | EPE | IOU |
| ✓ | | | | | 1.54 | 0.50 | 0.97 | 6.93 | 2.24 | 0.95 |
| ✓ | ✓ | | | | 1.28 | 0.43 | 0.98 | 5.55 | 2.03 | 0.95 |
| ✓ | ✓ | ✓ | | | 1.18 | 0.42 | 0.98 | 5.47 | 1.44 | 0.95 |
| ✓ | ✓ | | ✓ | | 1.20 | 0.42 | 0.98 | 5.38 | 1.60 | 0.95 |
| ✓ | ✓ | | | ✓ | 1.20 | 0.42 | 0.98 | 5.13 | 1.16 | 0.95 |
+
+Main Matching Path Main Matching Path adopt Axial-Attention which factorizing 2D self-attention into two 1D self-attentions rather than the stand-alone self attention. This allows performing attention in a larger region to extract context information with acceptable computation cost. As shown in Table 2, comparing with STTR which adopt 1D attention on epipolar, Main Matching Path have better EPE and 3px Err. Especially, it reduce EPE by $17\%$ and reduce 3px Err by $14\%$ on Scene Flow. This improvement shows that the global information extracted by Axial-Attention is benefit to stereo matching.
+
+Three Context Enhanced Path Strategies We design three different context enhanced strategies $(M_{1}, M_{2}, M_{3})$ that extract the context from low resolution features to enhance the Main Matching Path. $M_{1}, M_{2}, M_{3}$ improve the result of EPE and 3px Error on Scene Flow, especially, $M_{3}$ achieves an EPE $7\%$ reduction. As it has been approved, these context enhanced strategies of CEP further impove the stereo matching performance. The result on Scene FLow of three strategies are verly similar, we will further compare their real-world generalization performance and robustness in following Section.
+
+Real World Generalization Experiment We evaluate the generalization performance of MMP and three CEP on Middlebury-2014. The model only trained on FlyingThings of Scene Flow. As listed in Table 2, the MMP significantly outperforms the baseline setting STTR which only has 1D self-attention epipolar. The Axial-Attention for global information extraction reduce the EPE and the 3px Err by $20\%$ and $9\%$ on Middlebury-2014. This shows the global information is critical for model's generalization.
+
+All three context enhanced strategies outperform the MMP. It shows that the context information provided by CET facilitates generalization. $M_3$ achieves the best results on both EPE and 3px Err. For example, compared with MMP, $M_3$ reduce the 3px error by $7\%$ and even reduce the EPE by $42\%$ . This proves that the design of our CEP is important for enhancing generalization performance. Finally, compared with STTR, the best setting of CSTR with Axial-Attention and CEP of $M_3$ reduce the 3px error by $26\%$ and even reduce the EPE by $48\%$ .
+
+Table 3. EPE results of Ablation and Rubostness experiments. The model only trained on Scene Flow without fine-tune. Hazardous Data is a dataset that label the hazardous regions in KITTI-2015[37]; SPL: Specularity; TEL: Texturelessness; TRS: Transparency.
+
+| Experiment | Hazardous Data |
| STTR | MMP | \( M_1 \) | \( M_2 \) | \( M_3 \) | SPL | TEL | TRS | AVG |
| ✓ | | | | | 5.43 | 10.42 | 7.03 | 7.63 |
| ✓ | ✓ | | | | 4.98 | 8.59 | 6.8 | 6.79 |
| ✓ | ✓ | ✓ | | | 4.75 | 10.74 | 7.64 | 7.71 |
| ✓ | ✓ | | ✓ | | 3.68 | 11.28 | 7.01 | 7.32 |
| ✓ | ✓ | | | ✓ | 4.54 | 8.21 | 6.01 | 6.25 |
+
+Robustness Against Hazardous regions The images regions like texturelessness, transparency, specularity are likely to cause the failure of an algorithm, namely hazardous regions[35]. Zhang et al. [37] table the hazardous regions in KITTI-2015 and we use it to provide quantitative results for the effects of the MMP, three CEP strategies summarized in Table 3. Using Axial-Attention instead of stand alone self-attention can effectively improve average EPE of harzardous regions in with $11\%$ , especially on Textureless regions with $17\%$ . Using $M_{1}$ or $M_{2}$ , which memory feature just past one Cross-Attention layer, lead to a decrease in average EPE. However, $M_{3}$ which are used in our final CSTR, can bring additional $8\%$ improvement in average EPE compared with MMP. This may be because $M_{3}$ uses the same number of Cross-Attention layers as MMP, which is beneficial for MMP to better integrate context information.
+
+# 6 Conclusions
+
+Current stereo depth estimation models usually fail to handle the hazardous regions. In this paper, we found using global context information mitigate this issue. Therefore, we proposed a plug-in module, Context Enhanced Path. Based on CEP, we then built a stereo depth estimation model, Context Enhanced Stereo Transformer. According to our experimental results, our method achieves strong cross dataset generalization ability, handles hazardous regions robustly, and provides accurate occlusion prediction.
+
+Acknowledgments This paper is supported by Key-Area Research and Development Program of Guangdong Province (Grant No. 2019B010155003), Guangdong Basic and Applied Basic Research Foundation (Grant No. 2020B1515120044, 2020A1515110495), Johns Hopkins University internal funds, ONR award N00014-21-1-2812, and NIH award K08DC019708.
+
+# References
+
+1. Butler, D.J., Wulff, J., Stanley, G.B., Black, M.J.: A naturalistic open source movie for optical flow evaluation. In: European conference on computer vision. pp. 611-625. Springer (2012)
+2. Chang, J.R., Chen, Y.S.: Pyramid stereo matching network. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5410-5418 (2018)
+3. Chaudhari, S., Mithal, V., Polatkan, G., Ramanath, R.: An attentive survey of attention models. ACM Transactions on Intelligent Systems and Technology (TIST) 12(5), 1-32 (2021)
+4. Chen, Z., Sun, X., Wang, L., Yu, Y., Huang, C.: A deep visual correspondence embedding model for stereo matching costs. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 972-980 (2015)
+5. Cuturi, M.: Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems 26 (2013)
+6. Girshick, R.: Fast r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 1440-1448 (2015)
+7. Guo, M.H., Xu, T.X., Liu, J.J., Liu, Z.N., Jiang, P.T., Mu, T.J., Zhang, S.H., Martin, R.R., Cheng, M.M., Hu, S.M.: Attention mechanisms in computer vision: A survey. arXiv preprint arXiv:2111.07624 (2021)
+8. Guo, X., Yang, K., Yang, W., Wang, X., Li, H.: Group-wise correlation stereo network. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3273-3282 (2019)
+9. Hartmann, W., Galliani, S., Havlena, M., Gool, L.V., Schindler, K.: Learned multi-patch similarity. In: 2017 IEEE International Conference on Computer Vision (ICCV) (2017)
+0. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. IEEE (2016)
+1. He, P., Liu, X., Gao, J., Chen, W.: Deberta: Decoding-enhanced bert with disentangled attention. arXiv (2020)
+2. Hirschmuller, H.: Stereo processing by semiglobal matching and mutual information. IEEE Transactions on pattern analysis and machine intelligence 30(2), 328-341 (2007)
+3. Huang, G., Liu, Z., Laurens, V., Weinberger, K.Q.: Densely connected convolutional networks. IEEE Computer Society (2016)
+4. Huang, P.H., Matzen, K., Kopf, J., Ahuja, N., Huang, J.B.: Deepmvs: Learning multi-view stereopsis. IEEE (2018)
+5. Laga, H., Jospin, L.V., Boussaid, F., Bennamoun, M.: A survey on deep learning techniques for stereo-based depth estimation. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020)
+6. Li, Z., Drenkow, N., Ding, H., Ding, A.S., Lu, A., Creighton, F.X., Taylor, R.H., Unberath, M.: On the sins of image synthesis loss for self-supervised depth estimation. arXiv preprint arXiv:2109.06163 (2021)
+7. Li, Z., Liu, X., Drenkow, N., Ding, A., Creighton, F.X., Taylor, R.H., Unberath, M.: Revisiting stereo depth estimation from a sequence-to-sequence perspective with transformers. In: 2021 IEEE International Conference on Computer Vision (ICCV) (2021)
+8. Li, Z., Ye, W., Wang, D., Creighton, F.X., Taylor, R.H., Venkatesh, G., Unberath, M.: Temporally consistent online depth estimation in dynamic scenes. arXiv preprint arXiv:2111.09337 (2021)
+
+19. Lipson, L., Teed, Z., Deng, J.: Raft-stereo: Multilevel recurrent field transforms for stereo matching. In: 2021 International Conference on 3D Vision (3DV). pp. 218-227. IEEE (2021)
+20. Liu, X., Zheng, Y., Killeen, B., Ishii, M., Hager, G.D., Taylor, R.H., Unberath, M.: Extremely dense point correspondences using a learned feature descriptor. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4847-4856 (2020)
+21. Liu, Y., Zhu, L., Yamada, M., Yang, Y.: Semantic correspondence as an optimal transport problem. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4463-4472 (2020)
+22. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 (2017)
+23. Mayer, N., Ilg, E., Hausser, P., Fischer, P., Cremers, D., Dosovitskiy, A., Brox, T.: A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4040-4048 (2016)
+24. Menze, M., Geiger, A.: Object scene flow for autonomous vehicles. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3061-3070 (2015)
+25. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al.: Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems 32 (2019)
+26. Scharstein, D., Hirschmüller, H., Kitajima, Y., Krathwohl, G., Nesic, N., Wang, X., Westling, P.: High-resolution stereo datasets with subpixel-accurate ground truth. In: German conference on pattern recognition. pp. 31-42. Springer (2014)
+27. Schmid, K., Tomic, T., Ruess, F., Hirschmüller, H., Suppa, M.: Stereo vision based indoor/outdoor navigation for flying robots. In: 2013 IEEE/RSJ international conference on intelligent robots and systems. pp. 3955-3962. IEEE (2013)
+28. Sun, J., Chen, L., Xie, Y., Zhang, S., Jiang, Q., Zhou, X., Bao, H.: Disp r-cnn: Stereo 3d object detection via shape prior guided instance disparity estimation. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 10548-10557 (2020)
+29. Tomono, M.: Robust 3d slam with a stereo camera based on an edge-point icp algorithm. In: 2009 IEEE International Conference on Robotics and Automation. pp. 4306-4311. IEEE (2009)
+30. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017)
+31. Wang, H., Zhu, Y., Green, B., Adam, H., Yuille, A., Chen, L.C.: Axial-deeplab: Stand-alone axial-attention for panoptic segmentation. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 12349 LNCS, 108–126 (2020)
+32. Xu, H., Zhang, J.: Aanet: Adaptive aggregation network for efficient stereo matching. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1959-1968 (2020)
+33. Yang, J., Li, C., Zhang, P., Dai, X., Xiao, B., Yuan, L., Gao, J.: Focal self-attention for local-global interactions in vision transformers. arXiv preprint arXiv:2107.00641 (2021)
+
+34. Yao, C., Jia, Y., Di, H., Li, P., Wu, Y.: A decomposition model for stereo matching. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6091-6100 (2021)
+35. Zendel, O., Murschitz, M., Humenberger, M., Herzner, W.: Cv-hazop: Introducing test data validation for computer vision. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 2066-2074 (2015)
+36. Zhang, F., Prisacariu, V., Yang, R., Torr, P.H.: Ga-net: Guided aggregation net for end-to-end stereo matching. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 185-194 (2019)
+37. Zhang, Y., Qiu, W., Chen, Q., Hu, X., Yuille, A.: Unrealstereo: Controlling hazardous factors to analyze stereo vision. In: 2018 International Conference on 3D Vision (3DV). pp. 228-237. IEEE (2018)
+38. Zhao, C., Sun, Q., Zhang, C., Tang, Y., Qian, F.: Monocular depth estimation based on deep learning: An overview. Science China Technological Sciences 63(9), 1612-1627 (2020)
\ No newline at end of file
diff --git a/contextenhancedstereotransformer/images.zip b/contextenhancedstereotransformer/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c8cab8c4fc35300f36a903a6a37711d452b4185d
--- /dev/null
+++ b/contextenhancedstereotransformer/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e618d7c01635144e0f5220bb7c0f17468c2146835d7f6abcca22c4043639da55
+size 473816
diff --git a/contextenhancedstereotransformer/layout.json b/contextenhancedstereotransformer/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9ed33e3fee0e9069ee930d89913cd8e8385f4129
--- /dev/null
+++ b/contextenhancedstereotransformer/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb1d2d0bd850e66e7a3e8ac1d5be6d7c4eff35a21961f102226160b7b36838f6
+size 379440
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_content_list.json b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..209aa2fe53bc8b60491c63293b42fbcd624462fa
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:31514571c8c5f51290cf17b59e9548d198a8f535116ba20df027ce082d4a6618
+size 79891
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_model.json b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7b472cb04503a6ff460de0e81823ed770898c032
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8cae29a794a0b268ed69702de34e7ee40e1c495ba8145de66dd318e230541741
+size 101560
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_origin.pdf b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..e7f10b74805f01a970a3c94c1ef95ae2dacff65d
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/e8650998-0acc-4d95-9319-c7ed004be074_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1f443edae8a23d7c5f4beafca332f9abcaaeea8cdedb62fbd6491553830b861f
+size 2617455
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/full.md b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..652a00c2771b44f2f831f6ee2369fa12498be0bf
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/full.md
@@ -0,0 +1,311 @@
+# Contextformer: A Transformer with Spatio-Channel Attention for Context Modeling in Learned Image Compression
+
+A. Burakhan Koyuncu $^{1,2}$ , Han Gao $^{4}$ , Atanas Boev $^{2}$ , Georgii Gaikov $^{3}$ , Elena Alshina $^{2}$ , and Eckehard Steinbach $^{1}$
+
+1 Technical University of Munich, Munich, Germany
+burakhan.koyuncu@tum.de
+$^{2}$ Huawei Munich Research Center, Munich, Germany
+3 Huawei Moscow Research Center, Moscow, Russia
+4 Tencent America, Palo Alto, USA
+
+Abstract. Entropy modeling is a key component for high-performance image compression algorithms. Recent developments in autoregressive context modeling helped learning-based methods to surpass their classical counterparts. However, the performance of those models can be further improved due to the underexploited spatio-channel dependencies in latent space, and the suboptimal implementation of context adaptivity. Inspired by the adaptive characteristics of the transformers, we propose a transformer-based context model, named Contextformer, which generalizes the de facto standard attention mechanism to spatio-channel attention. We replace the context model of a modern compression framework with the Contextformer and test it on the widely used Kodak, CLIC2020, and Tecnick image datasets. Our experimental results show that the proposed model provides up to $11\%$ rate savings compared to the standard Versatile Video Coding (VVC) Test Model (VTM) 16.2, and outperforms various learning-based models in terms of PSNR and MS-SSIM.
+
+Keywords: Context Model, Learned Image Compression, Transformers
+
+# 1 Introduction
+
+Recent works in learned image compression outperform hand-engineered classical algorithms such as JPEG [46] and BPG [8], and even reach the rate-distortion performance of recent versions of video coding standards, such as VVC [1]. The most successful learning-based methods use an autoencoder based on [6,33], where the entropy of the latent elements is modeled and minimized jointly with an image distortion metric. The entropy modeling relies on two principles - backward and forward adaptation [3]. The former employs a hyperprior estimator utilizing a signaled information source. The latter implements a context model, where previously decoded symbols are used for entropy estimation without a need for signaling. Due to its efficiency, a wide variety of context model architectures were explored in the recent literature [20,32,33,34,38,39,52]. We categorize those
+
+architectures into the following groups w.r.t. their targets: (1) increased support for spatial dependencies; (2) exploitation of cross-channel dependencies; (3) increased context-adaptivity in the entropy estimation. For instance, we consider the methods such as [13,14,26,52] in the first category since those methods aim to capture long distant relations in the latent space. The 3D context [11,31,32] and channel-wise autoregressive context model [34] fall in the second category. In those works, entropy estimation of each latent element can also use information from the spatially co-located elements of previously coded channels. In [34] the authors show that entropy estimation, which mainly relies on cross-channel dependencies, outperforms their previous spatial-only model [33]. Most often, the context models use non-adaptive masked convolutions [29]. Those are location-agnostic [29], i.e., the same kernel is applied to each latent position, which potentially reduces the model performance. Even for a larger kernel size, the performance return is marginal, as only a small set of spatial relations between symbols can be utilized. [20,39] propose an adaptive context model, where the selection of latent elements to be used is based on pair-wise similarities between previously decoded elements. Furthermore, [38] uses a transformer-based context model to achieve context adaptivity for the spatial dimensions. However, those models have limited context adaptivity, as they are partially or not applying adaptive modeling for the cross-channel elements. For instance, in [20], although the primary channel carries on average $60\%$ of the information, the context model does not employ any adaptive mechanism for modeling it.
+
+Attention is a widely used deep learning technique that allows the network to focus on relevant parts of the input and suppress the unrelated ones [36]. In contrast to convolutional networks, attention-based models such as transformers [45] provide a large degree of input adaptivity due to their dynamic receptive field [35]. This makes them a promising candidate for a high-performance context model. Following the success of transformers in various computer vision tasks [10,16,17,22,38], we propose a transformer-based context model, Contextformer. Our contribution is threefold: (1) We propose a variant of the Contextformer, which adaptively exploits long-distance spatial relations in the latent tensor; (2) We extend the Contextformer towards a generalized context model, which can also capture cross-channel relations; (3) We present algorithmic methods to reduce the runtime of our model without requiring additional training.
+
+In terms of PSNR, our model outperforms a variety of learning-based models, as well as VTM 16.2 [43] by a significant margin of $6.9\% - 10.5\%$ in average bits saving on the Kodak [18], CLIC2020 [44] and Tecnick [2] image datasets. We also show that our model provides better performance than the previous works in a perceptual quality-based metric MS-SSIM [47].
+
+# 2 Related Work
+
+# 2.1 Learned Image Compression
+
+Presently, the state-of-the-art in lossy image compression frameworks is fundamentally a combination of variational autoencoders and transform coding [19],
+
+where the classical linear transformations are replaced with learned non-linear transformation blocks, e.g., convolutional neural networks [3]. The encoder applies an analysis transform $g_{a}(\pmb{x};\pmb{\phi})$ mapping the input image $\pmb{x}$ to its latent representation $\pmb{y}$ . This transform serves as dimensionality reduction. The latent representation $\pmb{y}$ is quantized by $Q(\cdot)$ and is encoded into the bitstream. In order to obtain the reconstructed image $\hat{\pmb{x}}$ , the decoder reads the quantized latent $\hat{\pmb{y}}$ from the bitstream and applies the synthesis transform $g_{s}(\hat{\pmb{y}};\pmb{\theta})$ , which is an approximate inverse of $g_{a}(\cdot)$ .
+
+Aiming to reduce the remaining coding redundancy in latent space, Balle et al. [5] introduced the factorized density model, which estimates the symbol distribution by using local histograms. During training, a joint optimization is applied to minimize both the symbol entropy and the distortion between the original and the reconstructed image. Knowledge of the probability distribution and coding methods such as arithmetic coding [40] allows for efficient lossless compression of $\hat{\pmb{y}}$ . Later, Balle et al. [6] proposed using a hyperprior, which employs additional analysis and synthesis transforms $h_{a / s}(\cdot)$ and helps with modeling of the distribution $p_{\hat{\pmb{y}}}(\hat{\pmb{y}} |\hat{\pmb{z}})$ conditioned on the side information $\hat{\pmb{z}}$ . The side information is modeled with a factorized density model, whereas $p_{\hat{\pmb{y}}}(\hat{\pmb{y}} |\hat{\pmb{z}})$ is modeled as a Gaussian distribution. Their proposed framework can be formulated as
+
+$$
+\hat {\boldsymbol {y}} = Q \left(g _ {a} (\boldsymbol {x}; \phi)\right), \tag {1}
+$$
+
+$$
+\hat {\boldsymbol {x}} = g _ {s} (\hat {\boldsymbol {y}}; \boldsymbol {\theta})), \tag {2}
+$$
+
+$$
+\hat {\boldsymbol {z}} = Q \left(h _ {a} (\hat {\boldsymbol {y}}; \phi_ {\boldsymbol {h}})\right), \tag {3}
+$$
+
+$$
+p _ {\hat {\boldsymbol {y}}} (\hat {\boldsymbol {y}} | \hat {\boldsymbol {z}}) \leftarrow h _ {s} (\hat {\boldsymbol {z}}; \boldsymbol {\theta} _ {\boldsymbol {h}}), \tag {4}
+$$
+
+and the loss function $\mathcal{L}$ of end-to-end training is
+
+$$
+\begin{array}{l} \mathcal {L} (\phi , \theta , \phi_ {h}, \theta_ {h}, \psi) = \mathbf {R} (\hat {\boldsymbol {y}}) + \mathbf {R} (\hat {\boldsymbol {z}}) + \lambda \cdot \mathbf {D} (\boldsymbol {x}, \hat {\boldsymbol {x}}) (5) \\ = \mathbb {E} \left[ \log_ {2} \left(p _ {\hat {\boldsymbol {y}}} (\hat {\boldsymbol {y}} | \hat {\boldsymbol {z}})\right) \right] + \mathbb {E} \left[ \log_ {2} \left(p _ {\hat {\boldsymbol {z}}} (\hat {\boldsymbol {z}} | \boldsymbol {\psi})\right) \right] + \lambda \cdot \mathbf {D} (\boldsymbol {x}, \hat {\boldsymbol {x}}), (6) \\ \end{array}
+$$
+
+where $\phi, \theta, \phi_h$ and $\theta_h$ are the optimization parameters and $\psi$ denotes the parameters of the factorized density model $p_{\hat{z}}(\hat{z}|\psi)$ . $\lambda$ is the Lagrange multiplier regulating the trade-off between rate $\mathbf{R}(\cdot)$ and distortion $\mathbf{D}(\cdot)$ .
+
+# 2.2 Context Model
+
+Higher compression performance requires more accurate entropy models, which would need an increased amount of side information [33]. To overcome this limitation, Minnen et al. [33] proposed a context model, which estimates the entropy of current latent element $\hat{\pmb{y}}_i$ using the previously coded elements. Their approach extends Eq. (4) to
+
+$$
+p _ {\hat {\mathbf {y}} _ {i}} \left(\hat {\mathbf {y}} _ {i} | \hat {\mathbf {z}}\right) \leftarrow g _ {e p} \left(g _ {c m} \left(\hat {\mathbf {y}} _ {< i}; \boldsymbol {\theta} _ {c m}\right), h _ {s} \left(\hat {\mathbf {z}}; \boldsymbol {\theta} _ {h}\right); \boldsymbol {\theta} _ {e p}\right), \tag {7}
+$$
+
+where the context model $g_{cm}(\cdot)$ is implemented as a 2D masked convolution. $g_{ep}(\cdot)$ computes the entropy parameters and $\hat{\pmb{y}}_{< i}$ denotes the previously coded
+
+local neighbors of current latent element $\hat{\pmb{y}}_i$ . Their proposed 2D context model requires $8.4\%$ fewer bits than BPG [8].
+
+Further improvements of the context model have been proposed (see Figs. 1a to 1e). In [13,14,52] a multi-scale context model was implemented, which employs multiple masked convolutions with different kernel sizes in order to learn various spatial dependencies simultaneously. [11,31,32] employ 3D masked convolutions in order to exploit cross-channel correlations jointly with the spatial ones.
+
+Minnen and Singh proposed a channel-wise autoregressive context model [34]. It splits the channels of the latent tensor into segments and codes each segment sequentially with the help of a previously coded segment. This reduces the sequential steps and outperforms the 2D context model of [33]. However, this approach uses only cross-channel correlations and omits the spatial ones.
+
+Qian et al. [39] proposed a context model, which combines 2D masked convolutions with template matching to increase the receptive field and provide context adaptivity. They search for a similar patch in the previously coded positions and use the best match as a global reference for the entropy model.
+
+Guo et al. [20] proposed a context model, which can be seen as an extension of [39]. In their approach, the channels of the latent tensor are split into two segments. The first segment is coded with a 2D masked convolution, similar to [34]. Coding of the second segment is done using two different mechanisms: MaskConv+, an "improved" version of the 2D masked convolutions, and a global prediction. Additional to the local neighbors, MaskConv+ uses the spatially colocated elements from the first segment. The global prediction is made by calculating the similarity between all elements from the first segment. The indices of the top $k$ similar elements (from the corresponding position in the first segment) are used to select elements in the second segment and include those in the entropy model. They reported average bits savings of $5.1\%$ over VTM 8.0 [43].
+
+Qian et al. [38] replaced the CNN-based hyperprior and context model with a transformer-based one which increased the adaptivity of the entropy model. They proposed two architectures for their context model - serial and parallel model. The serial model processes the latent tensor sequentially similar to [33]. The parallel one uses the checkboard like grouping prosed in [21] to increase the decoding speed. They achieved competitive performance with some of the CNN-based methods such as [12].
+
+# 2.3 Transformers
+
+Self-attention is an attention mechanism originally proposed for natural language processing [45]. Later, it was adopted in various computer vision tasks, where it outperformed its convolutional counterparts [10,16,17,22].
+
+The general concept of a transformer is as follows. First, an input representation with $S$ sequential elements is mapped into three different representations, query $Q \in \mathbb{R}^{S \times d_q}$ , key $K \in \mathbb{R}^{S \times d_k}$ and value $V \in \mathbb{R}^{S \times d_v}$ with separate linear transformations. Then, the attention module dynamically routes the queries with the key-value pairs by applying a scaled dot-product. The attention module is
+
+
+(a)
+
+
+
+
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(g)
+
+
+(h)
+
+
+(i)
+Fig. 1. Illustration of the latent elements used by the context model (□) to estimate the entropy of the current latent (□) in (a-e) for the prior-arts and (f-k) our proposed context model. Previously coded and yet to be coded elements are displayed as (□) and (□), respectively. The displayed prior-art models are (a) multi-scale 2D context [13,14,52], (b) 3D context [11,31,32], (c) channel-wise autoregressive context [34], (d) 2D context with global reference [39], and (e) context with advanced global reference [20]. Note that in (c) each (□) is coded simultaneously by using only a part of the elements presented as (□), and in (e), the primary channel segment is shown at the bottom for better visibility. Our models with different configurations are shown in (f) Contextformer $(N_{cs} = 1)$ , (g) Contextformer $(N_{cs} > 1, sfo)$ , (h) Contextformer $(N_{cs} > 1, cfo)$ . Note that the (serial) transformer-based context model of [38] employs similar mechanism as (f). (i-k) show the versions of our models (f-h) using the sliding window attention.
+
+
+(j)
+
+
+(k)
+
+followed by a point-wise multi-layer perceptron (MLP). Additionally, the multi-head attention splits the queries, keys, and values into $h$ sub-representations (so-called heads), and for each head, the attention is calculated separately. The final attention is computed by combining each sub-attention with a learned transformation $(\mathbf{W})$ . The multi-head attention enables parallelization and each intermediate representation to build multiple relationships.
+
+To preserve coding causality in autoregressive tasks, the attention mechanism has to be limited by a mask for subsequent elements not coded yet. The masked multi-head attention can be formulated as:
+
+$$
+\operatorname {A t t n} (\boldsymbol {Q}, \boldsymbol {K}, \boldsymbol {V}) = \operatorname {c o n c a t} \left(\text {h e a d} _ {1}, \dots , \text {h e a d} _ {h}\right) \boldsymbol {W}, \tag {8}
+$$
+
+$$
+\operatorname {h e a d} _ {i} \left(\boldsymbol {Q} _ {i}, \boldsymbol {K} _ {i}, \boldsymbol {V} _ {i}\right) = \operatorname {s o f t m a x} \left(\frac {\boldsymbol {Q} _ {i} \boldsymbol {K} _ {i} ^ {T}}{d _ {k}} \odot \boldsymbol {M}\right) \boldsymbol {V} _ {i}, \tag {9}
+$$
+
+where $\pmb{Q}_i \in \mathbb{R}^{S \times \frac{d_q}{h}}$ , $\pmb{K}_i \in \mathbb{R}^{S \times \frac{d_k}{h}}$ and $\pmb{V}_i \in \mathbb{R}^{S \times \frac{d_v}{h}}$ are the sub-representations, the mask $M \in \mathbb{R}^{S \times S}$ has ones in its lower triangle and the rest of its values are minus infinity, and $\odot$ stands for the Hadamard product.
+
+
+(a)
+
+
+(b)
+
+
+(c)
+Fig. 2. Illustration of (a) our proposed model with the Contextformer, (b) sequence generator for the Contextformer with spatial attention, Contextformer $(N_{cs} = 1)$ , and (c) sequence generator for the Contextformer with spatio-channel attention, Contextformer $(N_{cs} > 1)$ . The prepended start token is shown in dark gray in (b-c). Inspired by [27], we use channel-wise local hyperprior neighbors to increase performance; thus, regardless of the selected $N_{cs}$ , we apply the sequence generator depicted in (b) to the output of the hyperdecoder.
+
+# 3 Our Approach
+
+In this section, we introduce our transformer-based context model, Contextformer, which provides context adaptivity and utilizes distant spatial relations in the latent tensor. We present two versions of the model: a simple version, which uses spatial attention; and a more advanced version, which employs attention both in the spatial and channel dimensions for entropy modeling.
+
+# 3.1 Contextformer with Spatial Attention
+
+The proposed Contextformer builds on top of the architecture introduced in [14]. In the encoder, this model employs $3 \times 3$ convolution layers with GDN activation function [4] and residual non-local attention modules (RNAB) [50]. The structure of the decoder is very similar to the one of the encoder, with the exception that residual blocks (ResBlock) [11] are used in the first layer to enlarge the receptive field. Additionally, the model adopts a hyperprior network, the multi-scale context model [52] and the universal quantization [53]. This model estimates the distribution $p_{\hat{\mathbf{y}}}(\hat{\mathbf{y}}|\hat{\mathbf{z}})$ with a single Gaussian distribution. In our approach, we use a Gaussian mixture model [12] with 3 mixture components $k_{m}$ , which is known to increase the accuracy of the entropy model.
+
+In contrast to Cui et al. [14], we use a Contextformer instead of their multiscale context model, as shown in Fig. 2a. First, the latent $\hat{\pmb{y}}\in \mathbb{R}^{H\times W\times C}$ is rearranged into a sequence of spatial patches $\hat{\pmb{y}}_s\in \mathbb{R}^{\frac{HW}{p_hp_w}\times (p_hp_wC)}$ . Here, $H$ , $W$ and $C$ stand for the height, width and number of channels; $(p_h,p_w)$ corresponds to the shape of each patch. Usually, patch-wise processing reduces complexity, especially for large images [16]. However, the latent $\hat{\pmb{y}}$ already has a 16 times lower resolution than the input image, which makes learning an efficient context model harder and leads to a performance drop. To remedy this issue, we set the patch size to $1\times 1$ , so each sequential element corresponds to one pixel in the latent tensor (see Fig. 2b).
+
+The Contextformer has $L$ transformer layers with a similar architecture to that of ViT [16]. Each layer requires an intermediate tensor with an embedding size of $d_{e}$ . Therefore, we apply a learnable linear transformation $\mathbb{R}^{HW\times C}\to \mathbb{R}^{HW\times d_e}$ (embedding layer). In order to introduce permutation-variance, we add a learned position encoding similar to the one in [16,17], but we apply it to the first layer only. We prepend the latent sequence $\hat{\pmb{y}}_s$ with a zero-valued start token to ensure the causality of coding. We use masking in the attention as described in Eq. (9), and multi-head attention with 12 heads. Multi-head allows our model to independently focus on different channel segments of $\hat{\pmb{y}}$ .
+
+# 3.2 Contextformer with Spatio-Channel Attention
+
+Although multi-head attention is computationally efficient in handling cross-channel dependencies, it can explore relationships in a single channel only partially. For example, consider a Contextformer with a single transformer layer. Given a latent tensor $\hat{\pmb{y}}\in \mathbb{R}^{H\times W\times C}$ and its sequential representation $\hat{\pmb{y}}_s\in \mathbb{R}^{S\times C}$ ; the $n$ -th sub-representation of the sequence $\hat{\pmb{y}}_s(n,h_i)\in \mathbb{R}^{1\times \frac{C}{h}}$ can only attend to the previous representations $\hat{\pmb{y}}_s(< n,h_i)$ with the same head index $h_i$ . This means that the attention between different channel segments is not considered. Another limitation arises from the way the model behaves w.r.t. $\hat{\pmb{y}}$ . For modeling the entropy of latent element $\hat{\pmb{y}} (i,j,c)$ (with spatial coordinates $(i,j)$ and channel index $c$ ), the context model cannot access information from the spatially co-located elements from other channels $\hat{\pmb{y}} (i,j,\neq c)$ . This limits exploiting the cross-channel dependencies in $\hat{\pmb{y}}$ , and, therefore, the performance of the model.
+
+To remedy this issue, we generate spatio-channel patches in the latent space $\hat{\pmb{y}}_s\in \mathbb{R}^{\frac{HWC}{p_hp_wpc}\times (p_hp_wp_c)}$ , where $p_c$ corresponds to the size of each channel segment, and total number of channel segments is $N_{cs} = \frac{C}{p_c}$ . In a special case of $(p_h,p_w) = (H,W)$ , our patch generation method is similar to the slicing method in channel-wise context modeling [34], but our model has a multi-head attention added. In this work, we set $p_h$ and $p_w$ to 1 as already discussed in Section 3.1. Splitting the latent tensor into multiple channel segments enables two different coding methods, spatial-first-order (sfo) and channel-first-order (cfo). The first method prioritizes the spatial dimensions and codes all latent elements from a channel segment sequentially before starting with the next segment. The second method prioritizes the channel dimension, and codes all channel segments with
+
+the same spatial coordinate sequentially, before coding elements from the next spatial coordinate.
+
+Spatio-channel sequence generation allows the standard transformer to use channel attention, from which a generalized context model can be obtained. To illustrate this, we compare how dependencies in the latent space are handled by Contextformer for various $N_{cs}$ , and how those dependencies are handled by context models in the prior-art.
+
+In case of $N_{cs} = 1$ . The attention is limited to a spatial one (see Section 3.1). However, such a model provides faster encoding and decoding due to the smaller number of required autoregressive steps and still has better performance than some models in the prior-arts. As illustrated in Fig. 1f, Contextformer ( $N_{cs} = 1$ ) has a larger receptive field than [13,14,52], and also employs learned context adaptivity. Additionally, in [39] the receptive field is limited to a single reference and its neighboring latent elements, whereas Contextformer ( $N_{cs} = 1$ )'s receptive field is dynamic and theoretically unlimited. Notably, the serial model of [38] (best performing one) uses a similar context model as Contextformer ( $N_{cs} = 1$ ). However, their model has only a sparse-attention mechanism, whereas Contextformer employs the full attention mechanism.
+
+In case of $C \geq N_{cs} > 1$ . We achieve a context model that can exploit both spatial and cross-channel dependencies. As shown in Figs. 1g and 1h, both Contextformers ( $N_{cs} > 1$ ) with different coding order handle spatio-channel relationships. Moreover, in [20] only non-primary channel segments could be selected for entropy estimation, while the receptive field of the Contextformer's receptive field can adapt to cover every channel segment. Compared to [38], the Contextformer ( $N_{cs} > 1$ ) provides a more adaptive context model due to the spatio-channel attention. In the extreme case $N_{cs} = C$ , the model employs the spatio-channel attention to its full extend by computing the attention between every single latent element. Other implementations can be seen as a simplification of the extreme case for balancing the trade-off between performance and complexity. The Contextformer ( $N_{cs} = C$ ) can be regarded as a 3D context model with a large and adaptive receptive field.
+
+# 3.3 Handling High-Resolution Images
+
+Although the receptive field size of the Contextformer is theoretically unlimited, computing attention for long input sequences, e.g., high resolution images, is not feasible due to the quadratic increase of memory requirement and computational complexity with increasing the length of the input sequence. Therefore, we have to limit the receptive field of our model and use sliding-window attention as described in [17,37]. Inspired by 3D convolutions, we implemented a 3D sliding-window to traverse the spatio-channel array. Unlike 3D convolutions, the receptive field only slides across spatial dimensions and expands to encompass all elements in the channel dimension. In Figs. 1i to 1k one can see
+
+the sliding-window attention mechanism for various Contextformer variants. For computational efficiency, during training, we used fixed-sized image patches and omitted the sliding-window operations. During inference, we set the size of the receptive field according to the sequence length $(HWN_{cs})$ used for training.
+
+# 3.4 Runtime optimization
+
+Generally, autoregressive processes cannot be efficiently implemented on a GPU due to their serialized nature [21,26,34]. One commonly used approach [15,45] is to pad a set of sequences to have a fixed length, thus enabling the processing of multiple sequences in parallel during training (we refer to this method as Pad&Batch). A straightforward implementation of the sliding-window attention uses dynamic sequence lengths for every position of the window. We call this dynamic sequence processing (DS). The padding technique can be combined with the sliding-window by applying masking to the attention mechanism. However, one still needs to calculate attention for each padded element, which creates a bottleneck for the batched processing.
+
+We propose a more efficient algorithm to parallelize the sliding-window attention. The first step of the algorithm calculates the processing order (or priority) for every position of the sliding window and then groups the positions with the same processing order for batch processing. One possible processing order is to follow the number of elements in each window and process them from the smallest to the largest number of elements. We refer to this method as Batched Dynamic Sequence (BDS). Note that transformers are sequence-to-sequence models; they simultaneously compute an output for each element in a sliding window and preserve causality of the sequence due to the masking. Therefore, we can skip computation of intermediate channel segments and calculate the output of the last channel segment for each spatial coordinate of the sliding window, which we refer to as skipping intermediate channel segments (SCS). It is worth mentioning that both the BDS and SCS methods can only be applied in the encoder, where all elements of the latent tensor are simultaneously accessible. For the decoder-side runtime optimization, we adopted the wavefront coding described in [30], which is similar to the partitioning slices used in VVC [42]. We use the same processing priority to the independent sliding windows along the same diagonal, which allows for simultaneous decoding of those windows. More information about the proposed runtime optimization algorithms can be found in the supplementary materials.
+
+# 4 Implementation Details
+
+We present a few variants of the Contextformer by changing its parameters $\{L, d_e, N_{cs}, co\}$ , where $L, d_e$ and $N_{cs}$ correspond to number of layers, embedding size and number of channel segments, and $co$ corresponds to the coding order - either spatial-first (sfo) or channel-first (cfo). For all models, we used
+
+the same number of heads $h$ and MLP size of $d_{mlp}$ . We selected the base configuration of the Contextformer as $\{L = 8, d_e = 384, d_{mlp} = 4d_e, h = 12, N_{cs} = 4, co = cfo\}$ . More information about the architectural details can be found in the supplementary materials.
+
+For training of all variants, we used random $256 \times 256$ image crops from the Vimeo-90K dataset [49], batch size of 16, and ADAM optimizer [25] with the default settings. We trained our models for 120 epochs ( $\sim 1.2\mathrm{M}$ iterations). Following [7], we used the initial learning rate of $10^{-4}$ and reduced it by half every time the validation loss is nearly constant for 20 epochs. For this purpose, we used the validation set of Vimeo-90K. We selected mean-squared-error (MSE) as the distortion metric $\mathbf{D}(\cdot)$ and trained a set of models with $\lambda \in \{0.002, 0.004, 0.007, 0.014, 0.026, 0.034, 0.070\}$ to cover various bitrates. We also obtained models optimized for MS-SSIM [48] by finetuning the models trained for MSE, in the same fashion for $\sim 500\mathrm{K}$ iterations. By default, we selected both intermediate layer size $N$ of the encoder and decoder, and bottleneck size $M$ as 192. To increase the model capacity at the high target bitrates ( $\lambda_{5,6,7}$ ), we increased $M$ from 192 to 312 by following the common practice [12,33,34].
+
+# 5 Experimental Results
+
+Unless specified otherwise, we used the base configuration (see Section 4) and tested its performance on the Kodak image dataset [18]. We set the spatial receptive field size to $16 \times 16$ for the sliding-window attention. We compared the performance with the following models: the 2D context models by Minnen et al. [33] and Cheng et al. [12], the multi-scale 2D context model by Cui et al. [14], the channel-wise autoregressive context model by Minnen and Singh [34], the context model with an advanced global reference by Guo et al. [20], and the transformer-based context model by Qian et al. [38]. When the source was available, we ran the inference algorithms of those methods; in other cases, we took the results from the corresponding publications. For a fair comparison, we used the model from [20] without the GRDN post-filter [24]. Similarly, we used the serial model from [38], since it performs better and is more related to our approach. We also compared with the results achieved by classical compression algorithms such as BPG [8] and VTM 16.2 [43]. In order to test the generalization capability of our model, we also tested its performance on CLIC2020 [44], and Tecnick [2] datasets. Additionally, we present the impact of different configurations of our model on its complexity. More details about the performance comparison, and examples of compression artifacts can be found in the supplementary materials.
+
+Performance. In Fig. 3a we show the rate-distortion performance of the Contextformer with a spatio-channel attention mechanism and the comparative performance of prior methods on the Kodak image dataset. Our method qualitatively surpasses the rest in terms of PSNR for all rate points under test. According to the Bjøntegaard Delta rate (BD-Rate) [9], our method achieves average saving of $6.9\%$ over VTM 16.2, while the model in [20] provides $3.7\%$ saving over
+
+
+(a)
+
+
+(b)
+Fig. 3. Illustration of (a) the rate-distortion performance and (b) the rate savings relative to VTM 16.2 as a function of PSNR on the Kodak dataset showing the performance of our model compared to various learning-based and classical CODECs.
+
+the same baseline. On average, our model saves $10\%$ more bits compared to the multi-scale 2D context model in [14]. Notably, the only difference between our model and the one in [14] is the context and entropy modeling, and both methods have similar model sizes. The performance of our method and the prior in terms of the generalized BD-Rate metric [34] is shown in Fig. 3b. Our model achieves state-of-the-art performance by reaching $9.3\%$ rate savings for low bitrate and $4\%$ rate savings at the highest quality over VTM 16.2.
+
+We also evaluated our model optimized for MS-SSIM [48]. Fig. 4 shows that our model also outperforms previous methods for this perceptual quality metric. On average, our models saves $8.7\%$ more bits than Cheng et al. [12].
+
+
+Fig. 4. Illustration of the rate-distortion performance in terms of MS-SSIM on Kodak dataset showing the performance of our model compared to various learning-based and classical CODECs. All learned methods were optimized for MS-SSIM.
+
+Generalization Capability. In order to show the generalization capability, we also evaluated our Contextformer on CLIC2020-Professional and -Mobile [44], and Tecnick [2] datasets. In terms of BD-Rate [9], our model achieves average savings of $9.8\%$ , $5.8\%$ , and $10.5\%$ over VTM 16.2 on those datasets, respectively (see Fig. 6). Evaluating on the generalized BD-Rate metric [34] reveals that our method provides up to $11.9\%$ and $6.6\%$ relative bit savings over VTM 16.2 on CLIC2020-Professional and -Mobile datasets. On Tecnick dataset, the Contextformer saves up to $12.4\%$ more bits over VTM 16.2.
+
+
+(a)
+
+
+(b)
+Fig.5. Comparison of the rate-distortion performance (a) on CLIC2020-Professional (solid line, left vertical axis) and CLIC2020-Mobile (dashed line, right vertical axis) datasets, and (b) on Tecnick dataset.
+
+Contextformer Variants. In Fig. 6a we show the performance of our model for a varying number of channel segments $N_{cs}$ and coding order. From the figure, one can see that increasing the number of channel segments increases the performance of the model since having more channel segments allows the models to explore more of the cross-channel dependencies. However, there is a trade-off between the number of segments and the complexity - the computational cost increases quadratically with raising $N_{cs}$ . According to our observations, training the Contextformer with more than four segments increases training complexity too much to justify the minor performance gains.
+
+On average, the Contextformer (cfo) outperforms the same model in a spatial-first-order (sfo) configuration, which highlights the greater importance of cross-channel dependencies than the spatial ones. For instance, in the Contextformer (sfo), the primary channel segment can only adopt spatial attention due to the coding order. In Fig. 6b we show the distribution of information in each channel segment. The Contextformer (cfo) stores more than $70\%$ of all information in the first two channel segments, while in Contextformer(sfo) the information is almost equally distributed along with the segments. We observed that the
+
+
+(a)
+
+
+(b)
+
+
+(c)
+Fig. 6. Various ablation studies conducted with the Contextformer on Kodak dataset. (a) illustrates the rate savings relative to VTM 16.2 for the Contextformer with different number of channel segments $N_{cs}$ and coding order. In (b), the percentile bit occupation per channel segment is shown for models with different coding orders. Each model index depicts a model trained for a specific $\lambda$ . Notably, increasing the model capacity allocates more bits in the first two segments for cfo variant. (c) is the illustration of the average BD-Rate performance of various model sizes relative to base model. The annotations indicate the total number of entropy and context model parameters.
+
+spatial-first coding provides a marginal gain in low target bitrates ( $bpp < 0.3$ ) and images with a uniformly distributed texture such as "kodim02" (in Kodak image dataset). This suggests that spatial dependencies become more pronounced in smoother images.
+
+Model Size. Fig. 6c shows the performance of the Contextformers for different model sizes compared to the base configuration. Change in the network depth $L$ and embedding size $d_{e}$ have similar effects on the performance, whereas best performance can be achieved when both are increased. However, we observed that the return diminishes after a network depth of 8 layers. Since the base model already achieves state-of-the-art performance and further upscaling of models increases the complexity, we did not experiment with larger models. Note that the proposed network of [14], which our model is based on, has approximately the same total number of entropy and context model parameters (17M) as our
+
+base model, whereas our model shows additionally $10.1\%$ BD-Rate coding gain on Kodak dataset.
+
+Runtime Complexity. Table 1 shows the encoding and decoding complexity of our model, some of the learning based- prior arts and VTM [43]. We tested the learning-based methods on a single NVIDIA Titan RTX, and ran the VTM [43] on Intel Core i9-10980XE Intel Core i9-10980XE. In our model, we used proposed BDS and SCS optimizations in the encoder and wavefront coding in the decoder. For low resolution images, our methods have close performance to the one of the 3D context. For 4K images, we observed even bigger benefits by the parallelization. The relative encoding time increases only 3x w.r.t. the one on the Kodak dataset, while the increase in number of pixels is 20-fold. Such speed-up shows that encoder methods with online rate-distortion optimization such as [51] have unexplored potential. Moreover, we achieve 9x faster decoding compared to a 3D context model with the proposed wavefront coding.
+
+Table 1. Encoding and decoding time of different compression frameworks.
+
+| Method | Enc. Time [s] | Dec. Time [s] |
| Kodak | 4K | Kodak | 4K |
| DS | 56 | 1240 | 62 | 1440 |
| BDS (ours) | 32 | 600 | - | - |
| BDS&SCS (ours) | 8 | 120 | - | - |
| Wavefront (ours) | 40 | 760 | 44 | 820 |
| 3D context [11] | 4 | 28 | 316 | 7486 |
| 2D context [12] | 2 | 54 | 6 | 140 |
| VTM 16.2 [43] | 420 | 950 | 0.8 | 2.5 |
+
+# 6 Conclusion
+
+In this work, we explored learned image compression architectures using a transformer-based context model. We proposed a context model that utilizes a multi-head attention mechanism and uses spatial dependencies in the latent space to model the entropy. Additionally, we also proposed a more generalized attention mechanism, spatio-channel attention, which can constitute a powerful context model. We showed that a compression architecture that employs the spatio-channel attention model achieves state-of-the-art rate-distortion performance.
+
+While using an entropy model with spatio-channel attention brings noticeable gain, it also increases the runtime complexity. We addressed this issue by proposing an algorithm for efficient modeling while keeping the architecture unchanged. Future work will further investigate efficient attention mechanisms (e.g., [23,28,41]) aiming to bridge the gap to a real-time operation.
+
+# References
+
+1. Versatile Video Coding. Standard, Rec. ITU-T H.266 and ISO/IEC 23090-3 (Aug 2020)
+2. Asuni, N., Giachetti, A.: Testimages: a large-scale archive for testing visual devices and basic image processing algorithms. In: STAG. pp. 63-70 (2014)
+3. Balle, J., Chou, P.A., Minnen, D., Singh, S., Johnston, N., Agustsson, E., Hwang, S.J., Toderici, G.: Nonlinear transform coding. IEEE Journal of Selected Topics in Signal Processing 15(2), 339-353 (2020)
+4. Balle, J., Laparra, V., Simoncelli, E.P.: Density modeling of images using a generalized normalization transformation. In: 4th International Conference on Learning Representations, ICLR 2016 (2016)
+5. Balle, J., Laparra, V., Simoncelli, E.P.: End-to-end optimized image compression. In: 5th International Conference on Learning Representations, ICLR 2017 (2017)
+6. Balle, J., Minnen, D., Singh, S., Hwang, S.J., Johnston, N.: Variational image compression with a scale hyperprior. In: International Conference on Learning Representations (2018)
+7. Bégaint, J., Racapé, F., Feltman, S., Pushparaja, A.: Compressai: a pytorch library and evaluation platform for end-to-end compression research. arXiv preprint arXiv:2011.03029 (2020)
+8. Bellard, F.: Bpg image format (2015), accessed: 2022-06-01. URL https:// bellard.org/bpg
+9. Bjontegaard, G.: Calculation of average psnr differences between rd-curves. VCEG-M33 (2001)
+0. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European Conference on Computer Vision. pp. 213-229. Springer (2020)
+1. Chen, T., Liu, H., Ma, Z., Shen, Q., Cao, X., Wang, Y.: End-to-end learnt image compression via non-local attention optimization and improved context modeling. IEEE Transactions on Image Processing 30, 3179-3191 (2021). https://doi.org/10.1109/TIP.2021.3058615
+2. Cheng, Z., Sun, H., Takeuchi, M., Katto, J.: Learned image compression with discretized gaussian mixture likelihoods and attention modules. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7939-7948 (2020)
+3. Cui, Z., Wang, J., Bai, B., Guo, T., Feng, Y.: G-vae: A continuously variable rate deep image compression framework. arXiv preprint arXiv:2003.02012 (2020)
+4. Cui, Z., Wang, J., Gao, S., Guo, T., Feng, Y., Bai, B.: Asymmetric gained deep image compression with continuous rate adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10532-10541 (2021)
+5. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: 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. Association for Computational Linguistics, Minneapolis, Minnesota (Jun 2019). https://doi.org/10.18653/v1/N19-1423, https://aclanthology.org/N19-1423
+6. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth
+
+16x16 words: Transformers for image recognition at scale. In: International Conference on Learning Representations (2020)
+17. Esser, P., Rombach, R., Ommer, B.: Taming transformers for high-resolution image synthesis. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12873-12883 (2021)
+18. Franzen, R.: Kodak lossless true color image suite (1999)
+19. Goyal, V.K.: Theoretical foundations of transform coding. IEEE Signal Processing Magazine 18(5), 9-21 (2001)
+20. Guo, Z., Zhang, Z., Feng, R., Chen, Z.: Causal contextual prediction for learned image compression. IEEE Transactions on Circuits and Systems for Video Technology (2021)
+21. He, D., Zheng, Y., Sun, B., Wang, Y., Qin, H.: Checkerboard context model for efficient learned image compression. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 14771-14780 (2021)
+22. Jiang, Y., Chang, S., Wang, Z.: Transgan: Two transformers can make one strong gan. arXiv preprint arXiv:2102.07074 (2021)
+23. Katharopoulos, A., Vyas, A., Pappas, N., Fleuret, F.: Transformers are RNNs: Fast autoregressive transformers with linear attention. In: III, H.D., Singh, A. (eds.) Proceedings of the 37th International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 119, pp. 5156-5165. PMLR (13-18 Jul 2020), https://proceedings.mlr.press/v119/katharopoulos20a.htm1
+24. Kim, D.W., Ryun Chung, J., Jung, S.W.: Grdn: Grouped residual dense network for real image denoising and gan-based real-world noise modeling. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 0-0 (2019)
+25. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+26. Koyuncu, A.B., Cui, K., Boev, A., Steinbach, E.: Parallelized context modeling for faster image coding. In: 2021 International Conference on Visual Communications and Image Processing (VCIP). pp. 1-5. IEEE (2021)
+27. Lee, J., Cho, S., Beack, S.K.: Context-adaptive entropy model for end-to-end optimized image compression. In: 6th International Conference on Learning Representations, ICLR 2018 (2018)
+28. Lee-Thorp, J., Ainslie, J., Eckstein, I., Ontanon, S.: Fnet: Mixing tokens with fourier transforms. arXiv preprint arXiv:2105.03824 (2021)
+29. Li, D., Hu, J., Wang, C., Li, X., She, Q., Zhu, L., Zhang, T., Chen, Q.: Involution: Inverting the inheritance of convolution for visual recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12321-12330 (2021)
+30. Li, M., Ma, K., You, J., Zhang, D., Zuo, W.: Efficient and effective context-based convolutional entropy modeling for image compression. IEEE Transactions on Image Processing 29, 5900-5911 (2020). https://doi.org/10.1109/TIP.2020.2985225
+31. Liu, H., Chen, T., Shen, Q., Ma, Z.: Practical stacked non-local attention modules for image compression. In: CVPR Workshops. p. 0 (2019)
+32. Mentzer, F., Agustsson, E., Tschannen, M., Timofte, R., Van Gool, L.: Conditional probability models for deep image compression. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4394-4402 (2018)
+33. Minnen, D., Balle, J., Toderici, G.: Joint autoregressive and hierarchical priors for learned image compression. In: NeurIPS (2018)
+
+34. Minnen, D., Singh, S.: Channel-wise autoregressive entropy models for learned image compression. In: 2020 IEEE International Conference on Image Processing (ICIP). pp. 3339-3343. IEEE (2020)
+35. Naseer, M., Ranasinghe, K., Khan, S., Hayat, M., Khan, F.S., Yang, M.H.: Intriguing properties of vision transformers. arXiv preprint arXiv:2105.10497 (2021)
+36. Niu, Z., Zhong, G., Yu, H.: A review on the attention mechanism of deep learning. Neurocomputing 452, 48-62 (2021). https://doi.org/https://doi.org/10.1016/j.neucom.2021.03.091, https://www.sciencedirect.com/science/article/pii/S092523122100477X
+37. Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, L., Shazeer, N., Ku, A., Tran, D.: Image transformer. In: International Conference on Machine Learning. pp. 4055-4064. PMLR (2018)
+38. Qian, Y., Sun, X., Lin, M., Tan, Z., Jin, R.: Entroformer: A transformer-based entropy model for learned image compression. In: International Conference on Learning Representations (2021)
+39. Qian, Y., Tan, Z., Sun, X., Lin, M., Li, D., Sun, Z., Hao, L., Jin, R.: Learning accurate entropy model with global reference for image compression. In: International Conference on Learning Representations (2020)
+40. Rissanen, J., Langdon, G.G.: Arithmetic coding. IBM Journal of research and development 23(2), 149-162 (1979)
+41. Roy, A., Saffar, M., Vaswani, A., Grangier, D.: Efficient content-based sparse attention with routing transformers. Transactions of the Association for Computational Linguistics 9, 53-68 (2021)
+42. Sullivan, G., Ohm, J., Han, W.J., Wiegand, T.: Overview of the high efficiency video coding standard 22, 1648-1667 (12 2012)
+43. Team, J.V.E.: Versatile video coding (vvc) reference software: Vvc test model (vtm) (2022), accessed: 2022-06-01. URL https://vcert.hhi.fraunhofer.de/jvet/VVCSoftware_VTM
+44. Toderici, G., Theis, L., Johnston, N., Agustsson, E., Mentzer, F., Balle, J., Shi, W., Timofte, R.: Workshop and challenge on learned image compression (clc2020)
+45. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+46. Wallace, G.K.: The JPEG still picture compression standard. IEEE transactions on consumer electronics 38(1), xviii-xxxiv (1992)
+47. Wang, Z., Simoncelli, E.P., Bovik, A.C.: Multiscale structural similarity for image quality assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003. vol. 2, pp. 1398-1402. IEEE (2003)
+48. Wang, Z., Simoncelli, E.P., Bovik, A.C.: Multiscale structural similarity for image quality assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003. vol. 2, pp. 1398-1402. IEEE (2003)
+49. Xue, T., Chen, B., Wu, J., Wei, D., Freeman, W.T.: Video enhancement with task-oriented flow. International Journal of Computer Vision (IJCV) 127(8), 1106-1125 (2019)
+50. Zhang, Y., Li, K., Li, K., Zhong, B., Fu, Y.: Residual non-local attention networks for image restoration. In: International Conference on Learning Representations (2019), https://openreview.net/forum?id=HkeGhoA5FX
+51. Zhao, J., Li, B., Li, J., Xiong, R., Lu, Y.: A universal encoder rate distortion optimization framework for learned compression. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1880-1884 (2021)
+
+52. Zhou, J., Wen, S., Nakagawa, A., Kazui, K., Tan, Z.: Multi-scale and context-adaptive entropy model for image compression. arXiv preprint arXiv:1910.07844 (2019)
+53. Ziv, J.: On universal quantization. IEEE Transactions on Information Theory 31(3), 344-347 (1985)
\ No newline at end of file
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/images.zip b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..57334e11c5a8b07c575d7537dbf2b1b8eb1155fb
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:72495474365bd3978aac1afc6e2c34d8ac028e4b9e8ab00dd062c6e8eba10dd3
+size 432520
diff --git a/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/layout.json b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ac8b58b88b6b9b01d0a3983fa1dcc0b1b8a83771
--- /dev/null
+++ b/contextformeratransformerwithspatiochannelattentionforcontextmodelinginlearnedimagecompression/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:efd994a51092f432549235dd4662ea38d1f080827ec9be15c5924dfdc8a80548
+size 467822
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_content_list.json b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a06e6ea79972480b86510d4a47446635e2748d5c
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1a784a1d2e4d2a5975b16c86819c1c16635993fb86fee3eb5b558b85d021f0e3
+size 81475
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_model.json b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..cf712c1a9346b2a65bd27d1e6f631634af4f0359
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ae6a02c0cfc6050977d093ed04c7b25fef76c99dc229fc7e53be5da6e4c9c72
+size 101331
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_origin.pdf b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9845c380e205f4edbd0f7e3803edb8b359b6e724
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/eaacb913-67b1-4fae-95c2-b48cd47d028e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ec18e4e069e599028eafc14fc90920440439b25a4efba3fa05e68b381ac6757f
+size 1414775
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/full.md b/contextualtextblockdetectiontowardsscenetextunderstanding/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3df2dabcadeb90fd3bc45fb0cae47592aea34580
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/full.md
@@ -0,0 +1,330 @@
+# Contextual Text Block Detection towards Scene Text Understanding
+
+Chuhui Xue $^{1,2}$ , Jiaxing Huang $^{1}$ , Wenqing Zhang $^{2}$ , Shijian Lu $^{1}$ , Changhu Wang $^{2}$ , and Song Bai $^{2}$
+
+1 Nanyang Technological University
+2 ByteDance Inc.
+
+xuec0003@e.ntu.edu.sg, {jiaxing.huang, shijian.lu}@ntu.edu.sg, wenqingzhang@bytedance.com, {changhu.wang, songbai.site}@gmail.com
+
+Abstract. Most existing scene text detectors focus on detecting characters or words that only capture partial text messages due to missing contextual information. For a better understanding of text in scenes, it is more desired to detect contextual text blocks (CTBs) which consist of one or multiple integral text units (e.g., characters, words, or phrases) in natural reading order and transmit certain complete text messages. This paper presents contextual text detection, a new setup that detects CTBs for better understanding of texts in scenes. We formulate the new setup by a dual detection task which first detects integral text units and then groups them into a CTB. To this end, we design a novel scene text clustering technique that treats integral text units as tokens and groups them (belonging to the same CTB) into an ordered token sequence. In addition, we create two datasets SCUT-CTW-Context and ReCTS-Context to facilitate future research, where each CTB is well annotated by an ordered sequence of integral text units. Further, we introduce three metrics that measure contextual text detection in local accuracy, continuity, and global accuracy. Extensive experiments show that our method accurately detects CTBs which effectively facilitates downstream tasks such as text classification and translation. The project is available at https://sg-vilab.github.io/publication/xue2022contextual/.
+
+Keywords: Scene Text Detection
+
+# 1 Introduction
+
+Scene texts often convey precise and rich semantic information that is very useful to visual recognition and scene understanding tasks. To facilitate reading and understanding by humans, they are usually designed and placed in the form of contextual text blocks which consist of one or multiple integral text units (e.g., a character, word, or phrase) that are arranged in natural reading order. Contextual text blocks deliver complete and meaningful text messages and detecting them is critical to the ensuing tasks such as natural language processing and scene image understanding.
+
+
+Fig. 1: Illustration of traditional scene text detection and the proposed contextual text detection: Traditional scene text detection detects integral text units (e.g., characters or words as shown in the second column) which usually deliver incomplete text messages and have large gaps towards scene text understanding. In contrast, the proposed contextual text detection detects contextual text blocks each of which consists of multiple integral text units in natural reading order. It facilitates the ensuing tasks in natural language processing and scene understanding greatly.
+
+Most existing scene text detectors [23,16,53,18] focus on detecting integral text units only as illustrated in the second column of Fig. 1. Their detection thus cannot convey complete text messages, largely because of two factors. First, they capture little contextual information, i.e., they have no idea which text units are from the same sentence and deliver a complete message. Second, they capture little text order information, i.e., they have no idea which is the previous or the next text unit in the natural reading order. Without contextual and text order information, the outputs of existing scene text detectors have a large gap towards natural understanding of scene texts and relevant scene images.
+
+We propose a new text detection setup, namely contextual text detection, where the objective is to detect contextual text blocks (consisting of one or multiple ordered integral text units) instead of individual integral text units. This new setup has two challenges. First, it needs to detect and group the integral text units into a contextual text block that transmits a complete text message. Several studies [36,37] adopt a bottom-up approach by first detecting characters (or words) and then grouping them into a word (or a text line). However, their detected texts usually deliver partial text messages only, e.g., one text line in a contextual text block consisting of multiple text lines in Fig. 1. Second, it needs to order the detected integral text units belonging to the same contextual text block according to the natural reading order. Though some work [15] studies text sequencing in document images, it assumes a single block of text in document images and cannot handle scene images which often have multiple contextual text blocks with very different layouts and semantics.
+
+We design a Contextual Text Detector (CUTE) to tackle the contextual text detection problem. CUTE models the grouping and ordering of integral text units from a NLP perspective. Given a scene text image, it extracts contextual visual features (capturing spatial adjacency and spatial orderliness of integral text units) of all detected text units, transform the features into feature embeddings to produce integral text tokens, and finally predicts contextual text blocks. In addition, we create two new datasets ReCTS-Context and SCUT-CTW-Context where each contextual text block is well annotated as illustrated in Fig. 1. For evaluation of contextual text detection, we also introduce three evaluation metrics that measure local accuracy, continuity, and global accuracy, respectively.
+
+The contributions of this work are three-fold. First, we propose contextual text detection, a new text detection setup that aims to detect contextual text blocks that transmit complete text messages. To the best of our knowledge, this is the first work that studies the contextual text detection problem. Second, we design CUTE, a contextual text detector that detects integral text units and groups them into contextual text blocks in natural reading order. Third, we create two well-annotated datasets on contextual text detection and introduce three metrics to evaluate contextual text detection from multiple perspectives.
+
+# 2 Related Works
+
+# 2.1 Scene Text Detection
+
+Recent scene text detectors can be broadly classified into two categories. The first category takes a bottom-up approach which first detects low-level text elements and then groups them into words or text lines. For example, CRAFT [2] and SegLink [31,35] detect characters or small segments of text instance and link them together to form text bounding boxes. The second category treats words as one specific type of objects and detects them directly by adapting various generic object detection techniques. For example, EAST [55], TextBoxes++ [17], RRD [19] and PSENet [41] detect text bounding boxes directly with generic object detection or segmentation techniques. Recent studies further improve by introducing border or counter awareness [47,42,56,8], local refinement [51,11], deformation convolution [39,43], Bezier curve [22], etc. Besides, document layout analysis [7,54,12,26,24] have been studied for years that usually take reading order of texts in document as consideration.
+
+The existing scene text detectors have achieves very impressive performance. However, they are designed to detect individual text units like characters or words while the contextual information is missed. Differently, we propose a new setup that aims to detect contextual text blocks that deliver complete text messages.
+
+# 2.2 Sequence Modeling
+
+Sequence modeling has been widely studied in the field of NLP. Seq2Seq [34] presents an encoder-decoder structure for sequential natural language processing
+
+by using Recurrent Neural Network (RNN) [29]. Attention mechanisms [3,25] is also introduced to relate different positions of a single sequence in order to compute a representation of the sequence. More recently, the advanced Transformer [38] is proposed which relies entirely on self-attention to compute representations of the input and output without using sequence-aligned RNNs or convolution.
+
+Sequence modeling has also been adopted in computer vision tasks. RNNs [32,33] and Transformers [49,45,44] have been widely used in recent scene text recognition studies since most scene texts are sequentially placed in scenes. Some work also studies visual permutation for Jigsaw puzzle [30,27]. With the recent advances in Transformers, some work models different computer vision tasks sequentially in image recognition [9], object detection [5], etc. More recently, [15,40] learn text sequences in document analysis by using Graph Convolution Network (GCN) [14].
+
+We propose a contextual text detector which detects integral texts and groups them into contextual text blocks by attention mechanism. Different from existing work, the proposed CUTE can detect multiple contextual text blocks that convey different text messages in one image.
+
+# 3 Problem Definition
+
+In this section, we formalize the definition of terminologies in the contextual text detection problem.
+
+Integral Text Unit: We define the basic detection units as integral text units which are usually integral components of a contextual text block. These units could be characters, words to text lines, depending on different real-world scenarios and applications. In contextual text detection problem, each integral text unit in image $\pmb{I} \in \mathbb{R}^{3 \times H \times W}$ is localized by using a bounding box $\pmb{t}$ by:
+
+$$
+\boldsymbol {t} = \left(\boldsymbol {p} _ {0}, \boldsymbol {p} _ {1}, \dots , \boldsymbol {p} _ {k - 1}\right),
+$$
+
+$$
+\boldsymbol {p} _ {i} = \left(x _ {i}, y _ {i}\right), x _ {i} \in [ 0, W - 1 ], y _ {i} \in [ 0, H - 1 ], \tag {1}
+$$
+
+where $k$ is the number of vertices in bounding boxes and it varies depending on different shapes of bounding boxes.
+
+Contextual Text Block: A contextual text block is defined by a set of integral text units arranged in natural reading order. It delivers a complete text message which can be one or multiple sentences lying in one or multiple lines. Each contextual text block $\pmb{c}$ is defined by:
+
+$$
+\boldsymbol {c} = \left(\boldsymbol {t} _ {0}, \boldsymbol {t} _ {1}, \dots , \boldsymbol {t} _ {m - 1}\right), \tag {2}
+$$
+
+where $m$ is the number of integral text units in $C$ .
+
+Contextual Text Detection: Given an input image $\pmb{I} \in \mathbb{R}^{3 \times H \times W}$ , contextual text detection aims for a model $f$ that can predict a set of contextual text blocks by:
+
+$$
+\boldsymbol {C} = f (\boldsymbol {I}), \quad \boldsymbol {C} = \left\{\boldsymbol {c} _ {0}, \boldsymbol {c} _ {1}, \dots , \boldsymbol {c} _ {n - 1} \right\}, \tag {3}
+$$
+
+where $n$ is the number of contextual text blocks in $I$ .
+
+
+Fig.2: The framework of the proposed contextual text detector (CUTE): Given a scene text image as input, CUTE first detects integral text units with an Integral Text Detector. For each detected integral text unit, it then learns textual Feature Embeddings, Indexing Embeddings and Spatial Embeddings that capture visual text features, text order features, and text spatial adjacency features, respectively. Finally, it models the relationship of integral text units by learning from the three types of embeddings with a Contextual Text Block Generator and produces contextual text blocks that convey complete text messages.
+
+# 4 Method
+
+We propose a network CUTE for contextual text detection which consists an Integral Text Detector, an Integral Embedding Extractor and a Contextual Text Block Generator as illustrated in Fig. 2. The Integral Text Detector first localizes a set of integral text units from input images. The Integral Embedding Extractor hence learns visual and contextual feature embeddings for each detected integral text unit. Finally, the Contextual Text Block Generator groups and arranges the detected integral texts in reading order to produce contextual text blocks.
+
+# 4.1 Integral Text Detector
+
+We adopt Transformer-based generic object detector [5] as the integral text detector in our CUTE which is built upon CNN and Transformer architecture. Given an input image $\mathbf{I} \in \mathbb{R}^{3 \times H \times W}$ , the DETR first extracts image features $\mathbf{x} \in \mathbb{R}^{3 \times H_0 \times W_0}$ by using a CNN backbone (e.g., ResNet [10]). A Transformer hence predicts bounding boxes $\mathbf{t}$ (in Equation 1) of integral text units from the extracted features $\mathbf{x}$ .
+
+One of the major advances of the Transformer-based detector is that the Transformer models all interactions between elements of image features for object detection. Specifically, the feature map $\pmb{x}$ is first flattened to a sequence of
+
+elements (i.e., pixels) accompanied with 2D positional embeddings. The Transformer hence focuses on image regions for each object by learning the relationships between each pair of elements in feature map $\pmb{x}$ . As such, we adopt Transformer-based detector as the integral text detector in our CUTE for better modelling of element interactions in the visual features from network backbone. More details are available in the Supplementary Material.
+
+# 4.2 Integral Embedding Extractor
+
+Both visual and contextual features of integral text units are indispensable to accurate detection of contextual text blocks. We therefore design an Integral Embedding Extractor to extract three types of embeddings for each integral text unit including: (1) feature embeddings that are learnt from visual features of integral text units; (2) indexing embeddings that are encoded for integral ordering; (3) spatial embeddings that are predicted from spatial features of integral text units.
+
+Feature Embeddings: We first extract visual features of integral text units and predict a set of feature embeddings. Given the image features $x$ that are extracted from backbone network, the feature embeddings of the integral text units $\pmb{v}_{fe} \in \mathbb{R}^{r \times d}$ are defined by:
+
+$$
+\begin{array}{l} \pmb {v} _ {f e} = (\pmb {v} _ {f e} ^ {0}, \pmb {v} _ {f e} ^ {1}, \dots , \pmb {v} _ {f e} ^ {r - 1}), \\ \boldsymbol {v} _ {f e} ^ {i} = \boldsymbol {x} _ {c} ^ {i} W + b, \quad \boldsymbol {x} _ {c} ^ {i} = \text {f l a t t e n} (\operatorname {R O I A l i g n} (\boldsymbol {x}, \boldsymbol {t} _ {i})). \\ \end{array}
+$$
+
+Specifically, we first crop the visual features $\pmb{x}_c$ for each of detected integral text units from the image features $\pmb{x}$ by using the detected integral text boxes $\pmb{t}$ from integral text detector. These features $\pmb{x}_c$ are hence flattened and linearly projected to dimension $d$ to produce feature embeddings $\pmb{v}_{fe}$ , where $r$ is the number of detected integral text units in image. More details about dimension $d$ are available in Appendix.
+
+Indexing Embeddings: We also introduce indexing embeddings for integral text ordering. Given a set of detected integral text units, we assign each integral text unit with an index number $i$ , where $i \in [0, r - 1]$ refers to the $i$ -th integral text unit. Next, we adopt sinusoidal positional encoding [38] on these indices to produce indexing embeddings $\mathbf{v}_{ie} \in \mathbb{R}^{r \times d}$ by:
+
+$$
+\begin{array}{l} \boldsymbol {v} _ {i e} = \left(\boldsymbol {v} _ {i e} ^ {0}, \boldsymbol {v} _ {i e} ^ {1},..., \boldsymbol {v} _ {i e} ^ {r - 1}\right), \\ \boldsymbol {v} _ {i e} ^ {i} = \left\{ \begin{array}{l l} \sin \left(i / 1 0 0 0 0 ^ {2 d _ {k} / d}\right), & \text {i f} d _ {k} = 2 n, \\ \cos \left(i / 1 0 0 0 0 ^ {2 d _ {k} / d}\right), & \text {i f} d _ {k} = 2 n + 1. \end{array} \right. \tag {5} \\ \end{array}
+$$
+
+Spatial Embeddings: The spatial information of each detected integral text unit (i.e., size and position of integral texts in images) are lost because integral text features are extracted by cropping and resizing. For accurate contextual text block detection, we introduce spatial embeddings that encodes the spatial
+
+information to each integral text unit. Specifically, we use a vector $\pmb{v}_s^i$ to represent the spatial information of $i$ -th integral text unit which is defined by:
+
+$$
+\boldsymbol {v} _ {s} ^ {i} = (w, h, x _ {1}, y _ {1}, x _ {2}, y _ {2}, w \times h), \tag {6}
+$$
+
+where $w, h$ , $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$ refer to the width, height, top-left vertex coordinate, and bottom-right vertex coordinate of integral text bounding box $t^{i}$ . The spatial embeddings $\mathbf{v}_{se} \in \mathbb{R}^{r \times d}$ are hence obtained by two linear transformations:
+
+$$
+\boldsymbol {v} _ {s e} = \left(\boldsymbol {v} _ {s e} ^ {0}, \boldsymbol {v} _ {s e} ^ {1}, \dots , \boldsymbol {v} _ {s e} ^ {r - 1}\right), \tag {7}
+$$
+
+The text tokens are hence obtained by:
+
+$$
+\boldsymbol {v} _ {\text {t o k e n}} = \operatorname {C o n c a t} \left(\boldsymbol {v} _ {f e}, \boldsymbol {v} _ {i e}, \boldsymbol {v} _ {s e}\right). \tag {8}
+$$
+
+# 4.3 Contextual Text Block Generator
+
+Taking the integral tokens $\mathbf{v}_{token}$ as input, the Contextual Text Block Generator groups and arranges these integral tokens in reading order. As illustrated in Fig. 2, it learns the relationship between each pairs of integral tokens $\mathbf{v}_{token}$ by a multi-head attention layer and produces contextual text blocks by an index prediction head and a contextual text graph generator.
+
+Multi-Head Attention: We use multi-head self-attention mechanism to model the relationships between each pair of integral text units. Six stacked attention modules are adopted and each of them contains a multi-head self-attention layer following by a linear transformation layer. Layer normalization [1] is applied to the input of each layer. The text tokens $\mathbf{v}_{token}$ serve as values, keys, and queries of the attention function.
+
+Index Prediction Head: We model the contextual information learning as an index classification problem by an index prediction head. We adopt a linear projection layer is predict a set of indices $\mathbf{INX} = (\mathrm{INX}^0, \mathrm{INX}^1, \dots, \mathrm{INX}^{r-1})$ , where $\boldsymbol{v}_{token}^j$ follows $\boldsymbol{v}_{token}^i$ in reading order if $\mathrm{INX}^i = j$ . Cross-entropy loss is adopted for network optimization. Note we assign a random but unique index to each detected integral text unit as the detected integral text units are usually in random order.
+
+For the $i$ -th indexed query token $\pmb{v}_{token}^{i}$ , three cases are considered including: (1) if $\pmb{v}_{token}^{i}$ is not the last integral text in a contextual block, the index prediction head outputs index class $j$ if $\pmb{v}_{token}^{j}$ follows $\pmb{v}_{token}^{i}$ ; (2) if $\pmb{v}_{token}^{i}$ is the last integral unit in a contextual block, the class $i$ will be predicted; (3) if $v_{token}^{i}$ is not a text (i.e., false alarms from Integral Text Detector), it will be classified to 'not a text' class. In this way, a $(N + 1)$ -way classification problem is defined for index prediction where $N$ refers the number of index categories and $+1$ is the 'not a text' category. $N$ is a fixed number that is significantly larger than the possible number of integral text units in an image.
+
+Contextual Text Graph Generator: A directed contextual text graph $G = (V, E)$ is constructed by a Contextual Text Graph Generator which considers the detected integral text units as vertices $V$ . The $E$ refers to the edges
+
+Table 1: The statistics of the ReCTS-Context and SCUT-CTW-Context datasets: 'integral': Integral Text Units; 'block': Contextual Text Blocks; '#': Number.
+
+| Dataset | Integral
+Text | # integral | # block | # image | # integral | # integral | # block |
| per block | per image | per image |
| ReCTS-Context | Character | 440,027 | 107,754 | 20,000 | 4.08 | 22.00 | 5.39 |
| SCUT-CTW-Context | Word | 25,208 | 4,512 | 1,438 | 5.56 | 17.65 | 3.17 |
+
+of the graph $G$ that is obtained from the Index Prediction Head (IPH) by $E = \{(V_i, V_j) | \mathrm{IPH}(\boldsymbol{v}_{token}^i) = j, i \in |V|, j \in |V|\}$ . A set of weakly connected components $G' = \{G_0', G_1', \ldots, G_n'\}$ are produced from graph $G$ where $n$ refers to the number of contextual text blocks in the image. Each $G_i' = (V_i', E_i')$ represents a contextual text block in image where $V_i'$ refers its integral text units and $E_i'$ produces their reading order.
+
+# 5 Datasets and Evaluation Metrics
+
+# 5.1 Datasets
+
+We create two contextual-text-block datasets ReCTS-Context and SCUT-CTW-Context as shown in Table 1. Fig. 3 shows two samples where integral text units belonging to the same contextual text block are grouped in proper order.
+
+ReCTS-Context (ReCTS): We annotate contextual text blocks for images in dataset ICDAR2019-ReCTS [52], which are split into a training set and a test set with 15,000 and 5,000 images, respectively. It contains largely Chinese texts with characters as integral text units.
+
+SCUT-CTW-Context (SCUT-CTW): We annotate contextual text blocks for dataset SCUT-CTW-1500 dataset [50] which consists of 940 training images and 498 test images. Most integral text units in this dataset are words which have rich contextual information as captured in various scenes. More details about the two created datasets are available in Appendix.
+
+# 5.2 Evaluation Metrics
+
+We propose three evaluation metrics for the evaluation of contextual text detection:
+
+Local Accuracy (LA): We introduce LA to evaluate the accuracy of order prediction for neighbouring integral text units. Considering two correctly detected integral text units $a$ and $b$ (with $b$ following $a$ as ground-truth), a true positive is counted if the detection box of $b$ is predicted as directly following that of $a$ . We compute LA by $LA = TP / N$ where $TP$ denotes the number of true positives and $N$ is the total number of connected pairs in ground-truth.
+
+
+
+
+Fig. 3: Illustration of contextual text block annotation: We annotate each contextual text block by an ordered sequence of integral text units (characters or words) which together convey a complete textual message. The two sample images are picked from datasets ReCTS and SCUT-CTW, respectively.
+
+
+
+
+
+Local Continuity (LC): We introduce LC to evaluate the continuity of integral text units by computing a modified $n$ -gram precision score as inspired by BLEU [28]. Specifically, we compare $n$ -grams of the predicted consecutive integral text units with the $n$ -grams of the ground-truth integral texts and count the number of matches, where $n$ varies from 1 to 5. For $n = 1$ , we only consider the scenario that the contextual text block contains one integral text.
+
+Global Accuracy (GA): Besides LA and LC which focus on local characteristics of integral text units ordering, we also evaluate the detection accuracy of contextual text blocks. $TP$ is counted if all integral texts in a contextual text block are detected and the reading orders are accurately predicted. The global accuracy is hence computed by $GA = TP / N$ where $N$ is the total number of contextual text blocks in ground-truth.
+
+Besides, a detected integral text unit is determined to be matched with ground-truth text if the intersection-over-union (IoU) of these two bounding boxes are larger than a threshold. We adopt three IoU threshold standards that are widely-used in generic object detection task [20] including $IoU = 0.5$ , $IoU = 0.75$ and $IoU = 0.5$ : $0.05$ : $0.95$ for thorough evaluation.
+
+# 6 Experiments
+
+# 6.1 Comparing with State-of-the-art
+
+We evaluate the proposed CUTE on ReCTS-Context and SCUT-CTW-Context datasets qualitatively and quantitatively as shown in Fig. 4 and Table 2-4.
+
+Since there is little prior research on contextual text block detection, we develop a few baselines for comparisons. The first baseline is CLUSTERING that groups integral text units by mean shift clustering [6]. The second and the
+
+Table 2: Quantitative comparison of CUTE with state-of-the-art methods on ReCTS-Context. LA: Local Accuracy; LC: Local Continuity; GA: Global Accuracy.
+
+| Model | IoU=0.5 | IoU=0.75 | IoU=0.5:0.05:0.95 |
| LA | LC | GA | LA | LC | GA | LA | LC | GA |
| CLUSTERING [6] | 32.22 | 19.06 | 10.59 | 26.06 | 17.01 | 9.66 | 25.60 | 16.13 | 9.02 |
| CRAFT-R50 [2] | 63.66 | 53.26 | 45.96 | 51.22 | 48.39 | 36.76 | 50.06 | 45.46 | 35.60 |
| LINK-R50 [46] | 68.15 | 57.50 | 48.39 | 53.83 | 50.19 | 38.36 | 52.95 | 47.69 | 37.33 |
| CUTE-R50 | 70.43 | 64.74 | 51.55 | 54.39 | 56.63 | 39.52 | 53.92 | 53.56 | 38.92 |
| CRAFT-R101 [2] | 65.21 | 54.59 | 47.02 | 52.01 | 48.65 | 37.21 | 51.56 | 46.10 | 36.33 |
| LINK-R101 [46] | 70.78 | 59.10 | 49.92 | 54.53 | 51.02 | 38.98 | 53.42 | 48.26 | 37.94 |
| CUTE-R101 | 72.36 | 67.33 | 53.76 | 55.14 | 57.03 | 40.21 | 54.56 | 53.94 | 39.42 |
+
+Table 3: Quantitative comparison of CUTE with state-of-the-art methods on SCUT-CTW-Context. LA: Local Accuracy; LC: Local Continuity; GA: Global Accuracy.
+
+| Model | IoU=0.5 | IoU=0.75 | IoU=0.5:0.05:0.95 |
| LA | LC | GA | LA | LC | GA | LA | LC | GA |
| CLUSTERING [6] | 18.36 | 7.93 | 6.78 | 14.11 | 5.88 | 4.72 | 13.54 | 5.71 | 4.88 |
| LINK-R50 [46] | 25.47 | 3.33 | 18.88 | 20.25 | 3.15 | 14.70 | 19.31 | 2.93 | 14.26 |
| CUTE-R50 | 54.01 | 39.19 | 30.65 | 41.62 | 31.19 | 23.71 | 39.44 | 29.03 | 22.10 |
| LINK-R101 [46] | 25.71 | 3.41 | 19.18 | 20.02 | 2.89 | 14.68 | 19.56 | 2.72 | 14.39 |
| CUTE-R101 | 55.71 | 39.38 | 32.62 | 40.61 | 29.04 | 22.77 | 39.95 | 28.30 | 22.69 |
+
+third baselines are CRAFT [2] and LINK [46], two bottom-up scene text detection methods that group characters/words to text lines. Since both CRAFT and LINK do not have the concept of contextual text blocks, we sort integral text units within each contextual text block according to the common reading order of left-to-right and top-to-down. In addition, we evaluate with two backbones ResNet-50 and ResNet-101 (denoted by 'R50' and 'R101') to study the robustness of the proposed CUTE.
+
+We compare CUTE with the three baselines over ReCTS where integral text units are at character level. As Table 2 shows, the clustering-based method cannot solve the contextual text detection problem effectively because the integral text units are usually with different sizes, positions, and orientations. The bottom-up scene text detectors work better by focusing on visual features only. The proposed CUTE performs the best consistently as it models the relation between each pair of integral text units by considering both visual representative features and contextual information.
+
+
+Fig. 4: Illustration of the proposed CUTE: Sample images are collected from SCUT-CTW-Context and ReCTS-Context datasets, where the color boxes highlight the detected integral text units and the green arrows show the predicted text orders. The integral text units of each contextual text block are highlighted in the same color.
+
+
+
+Table 4: Quantitative comparison of CUTE with state-of-the-art methods on integral text grouping and ordering task: The ground-truth integral text bounding boxes are adopted for evaluations on integral text grouping and ordering task only. LA: Local Accuracy; LC: Local Continuity; GA: Global Accuracy.
+
+| Model | SCUT-CTW | ReCTS |
| LA | LC | GA | LA | LC | GA |
| CLUSTERING [6] | 27.94 | 12.74 | 10.76 | 69.70 | 49.15 | 32.20 |
| LINK-R50 [46] | 30.17 | 4.48 | 22.84 | 83.77 | 68.44 | 61.10 |
| CUTE-R50 | 71.48 | 58.53 | 49.67 | 92.08 | 82.79 | 76.02 |
| LINK-R101 [46] | 45.54 | 6.28 | 31.69 | 86.66 | 75.03 | 69.55 |
| CUTE-R101 | 71.54 | 58.68 | 52.57 | 93.12 | 83.70 | 77.81 |
+
+We further conduct experiments over SCUT-CTW where integral text units are at word level. We compare CUTE with CLUSTERING and LINK only because CRAFT cannot group texts lying on different lines. As Table 3 shows, CLUSTERING achieves very low performance due to the complex contextual relations among integral text units. LINK obtains very low scores on LC, showing that only short contextual text blocks with small number of integral text units are detected. CUTE instead outperforms all three baselines by large margins consistently across LA, LC and GA. Note the detection performances over SCUT-CTW are relatively low because it contains many texts with more complex layouts as compared with ReCTS.
+
+Additionally, to validate CUTE's effectiveness on the grouping and ordering of integral text units alone, we assume that all integral text units are accurately detected by feeding the bounding boxes of ground-truth integral text units to the Integral Embedding Extractor and Contextual Text Block Generator. As Table 4 shows, the proposed CUTE groups and orders integral text units effectively.
+
+
+Input Image
+
+
+Fig. 5: Contextual text detection facilitates scene text translation significantly: The output of CUTE conveys complete text messages which can be better translated to other languages as 'natural language' with rich contextual information as shown in column 3. As a comparison, scene text detectors produce individual text units which can not be translated well as shown in column 2.
+
+
+Scene Text Detection
+
+
+
+
+Contextual Text Detection
+
+
+
+Table 5: Ablation studies of CUTE over SCUT-CTW. LA: Local Accuracy; LC: Local Continuity; GA: Global Accuracy.
+
+| Model | vfe | vse | vie | LA | LC | GA |
| 1 | ✓ | | | 6.86 | 3.34 | 1.94 |
| 2 | ✓ | ✓ | | 8.99 | 4.56 | 2.18 |
| 3 | ✓ | | ✓ | 28.65 | 25.71 | 21.89 |
| 4 | ✓ | ✓ | ✓ | 71.48 | 58.53 | 49.67 |
+
+# 6.2 Ablation Study
+
+The proposed CUTE detects contextual text blocks by using both visual features (feature embeddings) and contextual features that capture spatial and ordering information, respectively. We conduct ablation studies over SCUT-CTW-Context to identify the contribution of each embedding. We trained four models with different combinations of the three embeddings. As Table 5 shows, CUTE does not work well with either feature embeddings alone or feature embeddings plus spatial embeddings. However, combining feature embeddings with indexing embeddings improves detection greatly as indexing embeddings introduce crucial text order information. The combination of all three embeddings performs the best by large margins, demonstrating the complementary nature of the three embeddings.
+
+Table 6: The significance of contextual text detection to scene text detection task: The proposed CUTE effectively helps to improve scene text detection performance of different detectors (in mAP) by filtering out the false alarms.
+
+| Model | w/o CUTE | with CUTE |
| PSENet[41] | 52.30 | 53.69 (+1.39) |
| MSR[48] | 60.07 | 61.80 (+1.73) |
| DETR[5] | 56.11 | 57.37 (+1.26) |
| LINK[46] | 62.03 | 62.84 (+0.81) |
+
+Table 7: The significance of contextual text detection to text classification task: The proposed CUTE effectively helps to improve text classification performance of different text classifiers by learning from recognized texts in contextual text blocks.
+
+| Model | w/o CUTE | with CUTE |
| TextCNN[13] | 90.56 | 92.40 (+1.84) |
| TextRNN[21] | 79.55 | 87.20 (+7.65) |
| Fast Text[4] | 90.96 | 91.82 (+0.86) |
| Transformer[38] | 89.69 | 92.54 (+2.85) |
+
+# 6.3 Discussion
+
+Contextual text detection facilitates downstream tasks: The proposed detection setup for contextual text blocks can facilitate both scene text detection and many downstream tasks. We first study how the proposed contextual text detection can improve the scene text detection task over SCUT-CTW. Specifically, traditional scene text detectors tend to produce false detection at image background that has similar visual representations as scene texts. CUTE can suppress such false detection effectively (i.e., classify the false detection into 'not a text' category) by learning the text ordering through not only visual features but also contextual information of texts (details in Section 4.3). As Table 6 shows, CUTE improves the scene text detection performance consistently across a number of scene text detectors that adopt different backbones and detection strategies.
+
+We also study how the proposed contextual text detection can facilitate various downstream tasks. We focus on the scene text translation task that is very useful to scene understanding for visitors with different home languages. Specifically, we feed each detected text (i.e. a character, word, or contextual text block) to a neural machine translator (Google Translator) for translation across different languages. As Fig. 5 shows, CUTE groups and orders scene texts into contextual text blocks (delivering complete textual messages) which facilitates scene text translation greatly as compared with traditional scene text detectors without the concept of contextual text blocks.
+
+
+Fig. 6: Typical failure cases of the proposed CUTE: Correct, incorrect and missing orders or integral text units are highlighted by arrows in yellow, red and blue, respectively. The proposed CUTE may fail if the images contain complex text layouts.
+
+
+
+We additionally study how contextual text detection facilitates text classification task in NLP. Specifically, we classify and annotate the transcription of texts in ReCTS-Context into three categories (i.e., 'Address', 'Phone Number' or 'Restaurant Name') according to the text semantics. We train models by different text classification techniques and test on the detected texts from integral texts (denoted by 'w/o CUTE') and contextual text blocks (denoted by 'with CUTE'), respectively. As shown in Table 7, the use of CUTE helps to improve the text classification consistently across different text classifiers.
+
+Typical failure cases: The proposed CUTE may fail if the images contain complex text layouts. As shown in Fig. 6, the proposed CUTE may fail if the texts from different contextual text blocks are in similar font styles and extremely close to (or far from) each other.
+
+# 7 Conclusion and Future Work
+
+We study contextual text detection, a new text detection setup that first detects integral text units and then groups them into contextual text blocks. We design CUTE, a novel method that detects contextual text blocks effectively by combining both visual and contextual features. In addition, we create two contextual text detection datasets within which each contextual text block is well annotated by an ordered text sequence. Extensive experiments show that CUTE achieves superior contextual text detection, and it also improves scene text detection and many downstream tasks significantly.
+
+In the future, we will continue to study contextual text detection when scene texts have complex layouts. Specifically, we will expand and balance our datasets by including more complex scenes and text layouts. We will also study how to leverage text semantics (from scene text recognition) for better contextual text detection.
+
+# References
+
+1. Ba, J.L., Kiros, J.R., Hinton, G.E.: Layer normalization. arXiv preprint arXiv:1607.06450 (2016)
+2. Baek, Y., Lee, B., Han, D., Yun, S., Lee, H.: Character region awareness for text detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9365-9374 (2019)
+3. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473 (2014)
+4. Bojanowski, P., Grave, E., Joulin, A., Mikolov, T.: Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics 5, 135-146 (2017)
+5. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European Conference on Computer Vision. pp. 213-229. Springer (2020)
+6. Cheng, Y.: Mean shift, mode seeking, and clustering. IEEE transactions on pattern analysis and machine intelligence 17(8), 790-799 (1995)
+7. Clausner, C., Antonacopoulos, A., Pletschacher, S.: Icdar2017 competition on recognition of documents with complex layouts-rdcl2017. In: 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR). vol. 1, pp. 1404-1410. IEEE (2017)
+8. Dai, P., Zhang, S., Zhang, H., Cao, X.: Progressive contour regression for arbitrary-shape scene text detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7393-7402 (2021)
+9. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+0. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+1. He, M., Liao, M., Yang, Z., Zhong, H., Tang, J., Cheng, W., Yao, C., Wang, Y., Bai, X.: Most: A multi-oriented scene text detector with localization refinement. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8813-8822 (2021)
+2. Jaume, G., Ekenel, H.K., Thiran, J.P.: Funsd: A dataset for form understanding in noisy scanned documents. In: 2019 International Conference on Document Analysis and Recognition Workshops (ICDARW). vol. 2, pp. 1-6. IEEE (2019)
+3. Kim, Y.: Convolutional neural networks for sentence classification. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). pp. 1746-1751. Association for Computational Linguistics (2014). https://doi.org/10.3115/v1/D14-1181, http://www.aclweb.org/anthology/D14-1181
+4. Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: International Conference on Learning Representations (ICLR) (2017)
+5. Li, L., Gao, F., Bu, J., Wang, Y., Yu, Z., Zheng, Q.: An end-to-endOCR text re-organization sequence learning for rich-text detail image comprehension. In: European Conference on Computer Vision. pp. 85-100. Springer (2020)
+6. Liao, M., Pang, G., Huang, J., Hassner, T., Bai, X.: Mask textspotter v3: Segmentation proposal network for robust scene text spotting. In: Computer Vision-ECCV
+
+2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16. pp. 706-722. Springer (2020)
+17. Liao, M., Shi, B., Bai, X.: Textboxes ++: A single-shot oriented scene text detector. IEEE transactions on image processing 27(8), 3676-3690 (2018)
+18. Liao, M., Wan, Z., Yao, C., Chen, K., Bai, X.: Real-time scene text detection with differentiable binarization. In: Proc. AAAI (2020)
+19. Liao, M., Zhu, Z., Shi, B., Xia, G.s., Bai, X.: Rotation-sensitive regression for oriented scene text detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5909-5918 (2018)
+20. Liu, L., Ouyang, W., Wang, X., Fieguth, P., Chen, J., Liu, X., Pietikainen, M.: Deep learning for generic object detection: A survey. International journal of computer vision 128(2), 261-318 (2020)
+21. Liu, P., Qiu, X., Huang, X.: Recurrent neural network for text classification with multi-task learning. arXiv preprint arXiv:1605.05101 (2016)
+22. Liu, Y., Chen, H., Shen, C., He, T., Jin, L., Wang, L.: Abcnet: Real-time scene text spotting with adaptiveBezier-curve network. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9809-9818 (2020)
+23. Long, S., He, X., Yao, C.: Scene text detection and recognition: The deep learning era. International Journal of Computer Vision 129(1), 161-184 (2021)
+24. Long, S., Qin, S., Panteleev, D., Bissacco, A., Fujii, Y., Raptis, M.: Towards end-to-end unified scene text detection and layout analysis. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1049-1059 (2022)
+25. Luong, M.T., Pham, H., Manning, C.D.: Effective approaches to attention-based neural machine translation. arXiv preprint arXiv:1508.04025 (2015)
+26. Michael, J., Weidemann, M., Laasch, B., Labahn, R.: Icpr 2020 competition on text block segmentation on a newseye dataset. In: International Conference on Pattern Recognition. pp. 405-418. Springer (2021)
+27. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: European conference on computer vision. pp. 69-84. Springer (2016)
+28. Papineni, K., Roukos, S., Ward, T., Zhu, W.J.: Bleu: a method for automatic evaluation of machine translation. In: Proceedings of the 40th annual meeting of the Association for Computational Linguistics. pp. 311-318 (2002)
+29. Rumelhart, D.E., Hinton, G.E., Williams, R.J.: Learning internal representations by error propagation. Tech. rep., California Univ San Diego La Jolla Inst for Cognitive Science (1985)
+30. Santa Cruz, R., Fernando, B., Cherian, A., Gould, S.: Deepermnet: Visual permutation learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3949-3957 (2017)
+31. Shi, B., Bai, X., Belongie, S.: Detecting oriented text in natural images by linking segments. In: The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (July 2017)
+32. Shi, B., Bai, X., Yao, C.: An end-to-end trainable neural network for image-based sequence recognition and its application to scene text recognition. IEEE transactions on pattern analysis and machine intelligence 39(11), 2298-2304 (2016)
+33. Su, B., Lu, S.: Accurate scene text recognition based on recurrent neural network. In: Asian Conference on Computer Vision. pp. 35-48. Springer (2014)
+34. Sutskever, I., Vinyals, O., Le, Q.V.: Sequence to sequence learning with neural networks. In: Advances in neural information processing systems. pp. 3104-3112 (2014)
+
+35. Tang, J., Yang, Z., Wang, Y., Zheng, Q., Xu, Y., Bai, X.: Seglink++: Detecting dense and arbitrary-shaped scene text by instance-aware component grouping. Pattern recognition 96, 106954 (2019)
+36. Tian, S., Pan, Y., Huang, C., Lu, S., Yu, K., Lim Tan, C.: Text flow: A unified text detection system in natural scene images. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 4651-4659 (2015)
+37. Tian, Z., Huang, W., He, T., He, P., Qiao, Y.: Detecting text in natural image with connectionist text proposal network. In: European Conference on Computer Vision. pp. 56-72. Springer (2016)
+38. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+39. Wang, F., Zhao, L., Li, X., Wang, X., Tao, D.: Geometry-aware scene text detection with instance transformation network. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1381-1389 (2018)
+40. Wang, R., Fujii, Y., Popat, A.C.: General-purposeOCR paragraph identification by graph convolutional neural networks. arXiv preprint arXiv:2101.12741 (2021)
+41. Wang, W., Xie, E., Li, X., Hou, W., Lu, T., Yu, G., Shao, S.: Shape robust text detection with progressive scale expansion network. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9336-9345 (2019)
+42. Wang, Y., Xie, H., Zha, Z.J., Xing, M., Fu, Z., Zhang, Y.: Contournet: Taking a further step toward accurate arbitrary-shaped scene text detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11753-11762 (2020)
+43. Xiao, S., Peng, L., Yan, R., An, K., Yao, G., Min, J.: Sequential deformation for accurate scene text detection. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXIX 16. pp. 108-124. Springer (2020)
+44. Xu, Y., Li, M., Cui, L., Huang, S., Wei, F., Zhou, M.: Layoutm: Pre-training of text and layout for document image understanding. In: Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. pp. 1192-1200 (2020)
+45. Xue, C., Lu, S., Bai, S., Zhang, W., Wang, C.: I2c2w: Image-to-character-to-word transformers for accurate scene text recognition. arXiv preprint arXiv:2105.08383 (2021)
+46. Xue, C., Lu, S., Hoi, S.: Detection and rectification of arbitrary shaped scene texts by using text keypoints and links. arXiv preprint arXiv:2103.00785 (2021)
+47. Xue, C., Lu, S., Zhan, F.: Accurate scene text detection through border semantics awareness and bootstrapping. In: Proceedings of the European conference on computer vision (ECCV). pp. 355-372 (2018)
+48. Xue, C., Lu, S., Zhang, W.: Msr: Multi-scale shape regression for scene text detection. arXiv preprint arXiv:1901.02596 (2019)
+49. Yu, D., Li, X., Zhang, C., Liu, T., Han, J., Liu, J., Ding, E.: Towards accurate scene text recognition with semantic reasoning networks. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (June 2020)
+50. Yuliang, L., Lianwen, J., Shuai tao, Z., Sheng, Z.: Detecting curve text in the wild: New dataset and new solution. arXiv preprint arXiv:1712.02170 (2017)
+51. Zhang, C., Liang, B., Huang, Z., En, M., Han, J., Ding, E., Ding, X.: Look more than once: An accurate detector for text of arbitrary shapes. In: Proceedings of the
+
+IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10552-10561 (2019)
+52. Zhang, R., Zhou, Y., Jiang, Q., Song, Q., Li, N., Zhou, K., Wang, L., Wang, D., Liao, M., Yang, M., et al.: Icdar 2019 robust reading challenge on reading chinese text on signboard. In: 2019 international conference on document analysis and recognition (ICDAR). pp. 1577-1581. IEEE (2019)
+53. Zhang, W., Qiu, Y., Liao, M., Zhang, R., Wei, X., Bai, X.: Scene text detection with scribble line. In: International Conference on Document Analysis and Recognition. pp. 79-94. Springer (2021)
+54. Zhong, X., Tang, J., Yepes, A.J.: Publaynet: largest dataset ever for document layout analysis. In: 2019 International Conference on Document Analysis and Recognition (ICDAR). pp. 1015-1022. IEEE (2019)
+55. Zhou, X., Yao, C., Wen, H., Wang, Y., Zhou, S., He, W., Liang, J.: East: An efficient and accurate scene text detector. In: The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (July 2017)
+56. Zhu, Y., Chen, J., Liang, L., Kuang, Z., Jin, L., Zhang, W.: Fourier contour embedding for arbitrary-shaped text detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3123-3131 (2021)
\ No newline at end of file
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/images.zip b/contextualtextblockdetectiontowardsscenetextunderstanding/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..57d161a0525147f395576aca2336518314f44f38
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:030d6ebe6f57857ba3c98ecb582e9f1d447aa152e3129fe1e7627a587e76bfaa
+size 716137
diff --git a/contextualtextblockdetectiontowardsscenetextunderstanding/layout.json b/contextualtextblockdetectiontowardsscenetextunderstanding/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a5c5080e1ae5390814d6c9630a581edc5ad4425f
--- /dev/null
+++ b/contextualtextblockdetectiontowardsscenetextunderstanding/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e9f7bd22f43f745dec00baf69a7fd2f725bddc56fef99edff3f065b331855795
+size 425164
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_content_list.json b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5d9583cd9d5cad107cd48610656bda2dfe3725e
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d9999e1392b3167249e8a9dcecfec21c50081c4fe440564551369e8cbe6efee0
+size 76816
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_model.json b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8a08709ca976f10148b484197b28ebe1c5b16e8b
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:482d9ca6352701d50a671e5cbf0ab79406722407b29bd3340778f55fcb2196ca
+size 93859
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_origin.pdf b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..051d5d805e2b0a507af4312d5d29192fd669ac52
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/68fff3a4-236f-445c-8de3-fea0e67ef0a5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:86ea798d6fdb4ddfc4c51b5e4ab76df30693739c479c16bc23a2a74ec1d96ff8
+size 873770
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/full.md b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..5e57ab4efe5dc98009742c3de921e6f15bc71934
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/full.md
@@ -0,0 +1,284 @@
+# Continual 3D Convolutional Neural Networks for Real-time Processing of Videos
+
+Lukas Hedegaard and Alexandros Iosifidis
+
+Department of Electrical and Computer Engineering, Aarhus University, Denmark {lhm,ai}@ece.au.dk
+
+Abstract. We introduce *Continual 3D Convolutional Neural Networks* (Co3D CNNs), a new computational formulation of spatio-temporal 3D CNNs, in which videos are processed frame-by-frame rather than by clip. In online tasks demanding frame-wise predictions, Co3D CNNs dispense with the computational redundancies of regular 3D CNNs, namely the repeated convolutions over frames, which appear in overlapping clips. We show that *Continual 3D CNNs* can reuse preexisting 3D-CNN weights to reduce the per-prediction floating point operations (FLOPs) in proportion to the temporal receptive field while retaining similar memory requirements and accuracy. This is validated with multiple models on Kinetics-400 and Charades with remarkable results: CoX3D models attain state-of-the-art complexity/accuracy trade-offs on Kinetics-400 with $12.1 - 15.3 \times$ reductions of FLOPs and $2.3 - 3.8\%$ improvements in accuracy compared to regular X3D models while reducing peak memory consumption by up to $48\%$ . Moreover, we investigate the transient response of Co3D CNNs at start-up and perform extensive benchmarks of on-hardware processing characteristics for publicly available 3D CNNs.
+
+Keywords: 3D CNN, Human Activity Recognition, Efficient, Stream Processing, Online Inference, Continual Inference Network.
+
+# 1 Introduction
+
+Through the availability of large-scale open-source datasets such as ImageNet [37] and Kinetics [25], [4], deep, over-parameterized Convolutional Neural Networks (CNNs) have achieved impressive results in the field of computer vision. In video recognition specifically, 3D CNNs have lead to multiple breakthroughs in the state-of-the-art [3], [43], [11], [10]. Despite their success in competitions and benchmarks where only prediction quality is evaluated, computational cost and processing time remains a challenge to the deployment in many real-life usecases with energy constraints and/or real-time needs. To combat this general issue, multiple approaches have been explored. These include computationally efficient architectures for image [17], [48], [42] and video recognition [28], [10], [49], pruning of network weights [6], [13], [14], knowledge distillation [16], [47], [36], and network quantisation [19], [2], [12].
+
+The contribution in this paper is complementary to all of the above. It exploits the computational redundancies in the application of regular spatiotemporal 3D CNNs to a continual video stream in a sliding window fashion (Fig. 2). This redundancy was also explored recently [26], [39] using specialised architectures. However, these are not weight-compatible with regular 3D CNNs. We present a weight-compatible reformulation of the 3D CNN and its components as a Continual 3D Convolutional Neural Network (Co3D CNN). Co3D CNNs process input videos frame-by-frame rather than clip-wise and can reuse the weights of regular 3D CNNs, producing identical outputs for networks without temporal zero-padding. Contrary to most deep learning papers, the work presented here needed no training; our goal was to validate the efficacy of converting regular 3D CNNs to Continual CNNs directly, and to explore their characteristics in the online recognition domain. Accordingly, we perform conversions from five 3D CNNs, each at different points on the accuracy/speed pareto-frontier, and evaluate their frame-wise performance. While there is a slight reduction in accuracy after conversion due to zero-padding in the regular 3D CNNs, a simple network modification of extending the temporal receptive field recovers and improves the accuracy significantly without any fine-tuning at a negligible increase in computational cost. Furthermore, we measure the transient network response at start-up, and perform extensive benchmarking on common hardware and embedded devices to gauge the expected inference speeds for real-life scenarios. Full source code is available at https://github.com/lukashedegaard/co3d.
+
+
+Fig. 1: Accuracy/complexity trade-off for Continual 3D CNNs and recent state-of-the-art methods on Kinetics-400 using 1-clip/frame testing. ■ FLOPs per clip are noted for regular networks, while ● FLOPs per frame are shown for the Continual 3D CNNs. Frames per clip / global average pool size is noted in the representative points. Diagonal and vertical arrows indicate a direct weight transfer from regular to Continual 3D CNN and an extension of receptive field.
+
+# 2 Related Works
+
+# 2.1 3D CNNs for video recognition
+
+Convolutional Neural Networks with spatio-temporal 3D kernels may be considered the natural extension of 2D CNNs for image recognition to CNNs for video recognition. Although they did not surpass their 2D CNN + RNN competitors [7], [21] initially [20], [23], [44], arguably due to a high parameter count and insufficient dataset size, 3D CNNs have achieved state-of-the-art results on Human Action Recognition tasks [3], [43], [11] since the Kinetics dataset [25] was introduced. While recent large-scale Transformer-based methods [1], [32] have become leaders in terms of accuracy, 3D CNNs still achieve state-of-the-art accuracy/complexity trade-offs. Nevertheless, competitive accuracy comes with high computational cost, which is prohibitive to many real-life use cases.
+
+In image recognition, efficient architectures such as MobileNet [17], ShuffleNet [48], and EfficientNet [42] attained improved accuracy-complexity tradeoffs. These architectures were extended to the 3D-convolutional versions 3D-MobileNet [28], 3D-ShuffleNet [28] and X3D [10] ( $\approx$ 3D-EfficientNet) with similarly improved pareto-frontier in video-recognition tasks. While these efficient 3D CNNs work well for offline processing of videos, they are limited in the context of online processing, where we wish to make updates predictions for each frame; real-time processing rates can only be achieved with the smallest models at severely reduced accuracy. 3D CNNs suffer from the restriction that they must process a whole "clip" (spatio-temporal volume) at a time. When predictions are needed for each frame, this imposes a significant overhead due to repeated computations. In our work, we overcome this challenge by introducing an alternative computational scheme for spatio-temporal convolutions, -pooling, and -residuals, which lets us compute 3D CNN outputs frame-wise (continually) and dispose of the redundancies produced by regular 3D CNNs.
+
+# 2.2 Architectures for online video recognition
+
+A well-explored approach to video-recognition [7], [21], [22], [40] is to let each frame pass through a 2D CNN trained on ImageNet in one stream alongside a second stream of Optical Flow [9] and integrate these using a recurrent network. Such architectures require no network modification for deployment in online-processing scenarios, lends themselves to caching [46], and are free of the computational redundancies experienced in 3D CNNs. However, the overhead of Optical Flow and costly feature-extractors pose a substantial disadvantage.
+
+Another approach is to utilise 3D CNNs for feature extraction. In [31], spatiotemporal features from non-overlapping clips are used to train a recurrent network for hand gesture recognition. In [27], a 3D CNN processes a sliding window of the input to perform spatio-temporal action detection. These 3D CNN-based methods have the disadvantage of either not producing predictions for each input frame [31] or suffering from redundant computations from overlapping clips [27].
+
+Massively Parallel Video Networks [5] split a DNN into depth-parallel subnetworks across multiple computational devices to improve online multi-device parallel processing performance. While their approach treats networks layers as atomic operations and doesn't tackle the fundamental redundancy of temporal convolutions, Continual 3D CNNs reformulate the network layers, remove redundancy, and accelerate inference on single devices as well.
+
+Exploring modifications of the spatio-temporal 3D convolution, the Recurrent Convolutional Unit (RCU) [39] replaces the 3D convolution by aggregating a spatial 2D convolution over the current input with a 1D convolution over the prior output. Dissected 3D CNNs [26] (D3D) cache the $1 \times n_{H} \times n_{W}$ frame-level features in network residual connections and aggregate them with the current frame features via $2 \times 3 \times 3$ convolutions. Like our proposed Continual 3D CNNs, both MCU and D3D are causal and operate frame-by-frame. However, they are speciality architectures, which are incompatible with pre-trained 3D CNNs, and must be trained from scratch. We reformulate spatio-temporal convolutions in a one-to-one compatible manner, allowing us to reuse existing model weights.
+
+# 3 Continual Convolutional Neural Networks
+
+# 3.1 Regular 3D-convolutions lead to redundancy
+
+Currently, the best performing architectures (e.g., X3D [10] and SlowFast [11]) employ variations on 3D convolutions as their main building block and perform predictions for a spatio-temporal input volume (video-clip). These architectures achieve high accuracy with reasonable computational cost for predictions on clips in the offline setting. They are, however, ill-suited for online video classification, where the input is a continual stream of video frames and a class prediction is needed for each frame. For regular 3D CNNs processing clips of $m_T$ frames to be used in this context, prior $m_T - 1$ input frames need to be stored between temporal time-steps and assembled to form a new video-clip when the next frame is sampled. This is illustrated in Fig. 2.
+
+Recall the computational complexity for a 3D convolution:
+
+$$
+\Theta \left(\left[ k _ {H} \cdot k _ {W} \cdot k _ {T} + b \right] \cdot c _ {I} \cdot c _ {O} \cdot n _ {H} \cdot n _ {W} \cdot n _ {T}\right), \tag {1}
+$$
+
+where $k$ denotes the kernel size, $T$ , $H$ , and $W$ are time, height, and width dimension subscripts, $b \in \{0,1\}$ indicates whether bias is used, and $c_{I}$ and $c_{O}$ are the number of input and output channels. The size of the output feature map is $n = (m + 2p - d \cdot (k - 1) - 1) / s + 1$ for an input of size $m$ and a convolution with padding $p$ , dilation $d$ , and stride $s$ . During online processing, every frame in the continual video-stream will be processed $n_{T}$ times (once for each position in the clip), leading to a redundancy proportional with $n_{T} - 1$ . Moreover, the memory-overhead of storing prior input frames is
+
+$$
+\Theta \left(c _ {I} \cdot m _ {H} \cdot m _ {W} \cdot [ m _ {T} - 1 ]\right)), \tag {2}
+$$
+
+and during inference the network has to transiently store feature-maps of size
+
+$$
+\Theta \left(c _ {O} \cdot n _ {H} \cdot n _ {W} \cdot n _ {T}\right). \tag {3}
+$$
+
+
+Fig.2: Redundant computations for a temporal convolution during online processing, as illustrated by the repeated convolution of inputs (green $\mathbf{b},\mathbf{c},\mathbf{d}$ ) with a kernel (blue $\alpha ,\beta$ ) in the temporal dimension. Moreover, prior inputs ( $\mathbf{b},\mathbf{c},\mathbf{d}$ ) must be stored between time-steps for online processing tasks.
+
+# 3.2 Continual Convolutions
+
+We can remedy the issue described in Sec. 3.1 by employing an alternative sequence of computational steps. In essence, we reformulate the repeated convolution of a (3D) kernel with a (3D) input-clip that continually shifts along the temporal dimension as a Continua! Convolution (CoConv), where all convolution computations (bar the final sum) for the (3D) kernel with each (2D) input-frame are performed in one time-step. Intermediary results are stored as states to be used in subsequent steps, while previous and current results are summed up to produce the output. The process for a 1D input and kernel, which corresponds to the regular convolution in Fig. 2, is illustrated in Fig. 3. In general, this scheme can be applied for online-processing of any $ND$ input, where one dimension is a temporal continual stream. Continua! Convolutions are causal [34] with no information leaking from future to past and can be efficiently implemented by zero-padding the input frame along the temporal dimension with $p = \text{floor}(k/2)$ . Python-style pseudo-code of the implementation is shown in Listing 1.1.
+
+
+Fig. 3: Continual Convolution. An input (green $\mathbf{d}$ or $\mathbf{e}$ ) is convolved with a kernel (blue $\alpha, \beta$ ). The intermediary feature-maps corresponding to all but the last temporal position are stored, while the last feature map and prior memory are summed to produce the resulting output. For a continual stream of inputs, Continual Convolutions produce identical outputs to regular convolutions.
+
+```python
+def coconv3d(frame, prev_state = (mem, i)):
+ frame = spatial(padding(frame)
+ frame = temporal(padding(frame)
+ feat = conv3d(frame, weights)
+ output, restfeat = feat[0], feat[1:]
+ mem, i = prev_state or init_state(output)
+ M = len(mem)
+ for m in range(M):
+ output += mem[(i + m) % M, M - m - 1]
+ output += bias
+ mem[i] = restfeat
+ i = (i + 1) % M
+ return output, (mem, i)
+```
+
+Listing 1.1: Pseudo-code for Continual Convolution. Ready-touse modules are available in the Continual Inference library [15].
+
+In terms of computational cost, we can now perform frame-by-frame computations much more efficiently than a regular 3D convolution. The complexity of processing a frame becomes:
+
+$$
+\Theta \left(\left[ k _ {H} \cdot k _ {W} \cdot k _ {T} + b \right] \cdot c _ {I} \cdot c _ {O} \cdot n _ {H} \cdot n _ {W}\right). \tag {4}
+$$
+
+This reduction in computational complexity comes at the cost of a memory-overhead in each layer due to the state that is kept between time-steps. The overhead of storing the partially computed feature-maps for a frame is:
+
+$$
+\Theta \left(d _ {T} \cdot \left[ k _ {T} - 1 \right] \cdot c _ {O} \cdot n _ {H} \cdot n _ {W}\right). \tag {5}
+$$
+
+However, in the context of inference in a deep neural network, the transient memory usage within each time-step is reduced by a factor of $n_T$ to
+
+$$
+\Theta \left(c _ {O} \cdot n _ {H} \cdot n _ {W}\right). \tag {6}
+$$
+
+The benefits of Continual Convolutions include the independence of clip length on the computational complexity, state overhead, and transient memory consumption. The change from (non-causal) regular convolutions to (causal) Continual Convolutions has the side-effect of introducing a delay to the output. This is because some intermediary results of convolving a frame with the kernel are only added up at a later point in time (see Fig. 3). The delay amounts to
+
+$$
+\Theta \left(d _ {T} \cdot \left[ k _ {T} - p _ {T} - 1 \right]\right). \tag {7}
+$$
+
+# 3.3 Continual Residuals
+
+The delay from Continual Convolutions has an adverse side-effect on residual connections. Despite their simplicity in regular CNNs, we cannot simply add the input to a Continual Convolution with its output because the CoConv may delay the output. Residual connections to a CoConv must therefore be delayed by an equivalent amount (see Eq. (7)). This produces a memory overhead of
+
+$$
+\Theta \left(d _ {T} \cdot \left[ k _ {T} - 1 \right] \cdot c _ {O} \cdot m _ {H} \cdot m _ {W}\right). \tag {8}
+$$
+
+# 3.4 Continual Pooling
+
+The associative property of pooling operations allows for pooling to be decomposed across dimensions, i.e. $\mathrm{pool}_{T,H,W}(\mathbf{X}) = \mathrm{pool}_T(\mathrm{pool}_{H,W}(\mathbf{X}))$ . For continual spatio-temporal pooling, the pooling over spatial dimensions is equivalent to a regular pooling, while the intermediary pooling results must be stored for prior temporal frames. For a pooling operation with temporal kernel size $k_{T}$ and spatial output size $n_H \cdot n_W$ , the memory consumption and delays are
+
+$$
+\Theta ([ k _ {T} - 1 ] \cdot n _ {H} \cdot n _ {W}), \tag {9}
+$$
+
+$$
+\Theta \left(k _ {T} - p _ {T} - 1\right). \tag {10}
+$$
+
+Both memory consumption and delay scale linearly with the temporal kernel size. Fortunately, the memory consumed by temporal pooling layers is relatively modest for most CNN architectures (1.5% for CoX3D-M, see Appendix A). Hence, the delay rather than memory consumption may be of primary concern for real-life applications. For some network modules it may even make sense to skip the pooling in the conversion to a Continual CNN. One such example is the 3D Squeeze-and-Eccitation (SE) block [18] in X3D, where global spatio-temporal average-pooling is used in the computation of channel-wise self-attention. Discarding the temporal pooling component (making it a 2D SE block) shifts the attention slightly (assuming the frame contents change slowly relative to the sampling rate) but avoids a considerable temporal delay.
+
+# 3.5 The issue with temporal padding
+
+Zero-padding of convolutional layers is a popular strategy for retaining the spatio-temporal dimension of feature-maps in consecutive CNN layers. For Continual CNNs, however, temporal zero-padding poses a problem, as illustrated in Fig. 4. Consider a 2-layer 1D CNN where each layer has a kernel size of 3 and zero padding of 1. For each new frame in a continual stream of inputs, the first layer $l$ should produce two output feature-maps: One by the convolution of the two prior frames and the new frame, and another by convolving with one prior frame, the new frame, and a zero-pad. The next layer $l + 1$ thus receives two inputs and produces three outputs which are dependent on the new input frame of the first layer (one for each input and another from zero-padding). In effect, each zero padding in a convolution forces the next layer to retrospectively update its output for a previous time-step in a non-causal manner. Thus, there is a considerable downside to the use of padding. This questions the necessity of zero padding along the temporal dimension. In regular CNNs, zero padding has two benefits: It helps to avoid spatio-temporal shrinkage of feature-maps when propagated through a deep CNN, and it prevents information at the boarders from "washing away" [24]. The use of zero-padding, however, has the downside that it alters the input-distribution along the boarders significantly [29], [33]. For input data which is a continual stream of frames, a shrinkage of the feature-size in the temporal dimension is not a concern, and an input frame (which may be
+
+
+(a) No padding
+
+
+(b) Zero padding
+Fig. 4: Issue with temporal padding: The latest frame $\mathbf{x}$ is propagated through a CNN with (purple) temporal kernels of size 3 (a) without or (b) with zero padding. Highlighted cubes can be produced only in the latest frame, with yellow boarder indicating independence of padded zero and red boarders dependence. In the zero-padded case (b), the number of frame features dependent on $\mathbf{x}$ following a layer $l$ increases with the number of padded zeros.
+
+considered a border frame in a regular 3D CNN) has no risk of "washing away" because it is a middle frame in subsequent time steps. Temporal padding is thus omitted in Continual CNNs. As can be seen in the experimental evaluations presented in the following, this constitutes a "model shift" in the conversion from regular to Continual 3D CNN if the former was trained with temporal padding.
+
+# 3.6 Initialisation
+
+Before a Continua CNN reaches a steady state of operation, it must have processed \( r_T - p_T - 1 \) frames where \( r_T \) and \( p_T \) are the aggregated temporal receptive field and padding of the network. For example, Continua X3D-\{S, M, L\} models have receptive fields of size \{69, 72, 130\}\), aggregated padding \{28, 28, 57\}, and hence need to process \{40, 43, 72\} frames prior to normal operation. The initial response depends on how internal state variables are initialised. In Sec. 4.2, we explore this further with two initialisation variants: 1) Initialisation with zeros and 2) by repeating a replicate of the features corresponding to the first input-frame. The latter corresponds to operating in a steady state for a "boring video" [3] which has one frame repeated in the entire clip.
+
+# 3.7 Design considerations
+
+Disregarding the storage requirement of model weights (which is identical between for regular and continual 3D CNNs), X3D-M has a worst-case total memory consumption of 7,074,816 floats when prior frames and the transient featuremaps are taken into account. Its continual counterpart, CoX3D-M, has a worst case memory only 5,072,688 floats. How can this be? Since Continual 3D CNNs do not store prior input frames and have smaller transient feature maps, memory savings outweigh the cost of caching features in each continual layer. Had the
+
+clip size been four instead of sixteen, $\mathrm{X3D - M_4}$ would have had a worst-case memory consumption of 1,655,808 floats and $C o X3D - M_4$ of 5,067,504 floats. For clip size 64, $\mathrm{X3D - M_{64}}$ consumes 28,449,792 floats and $C o X3D - M_{64}$ uses 5,093,424 floats. The memory load of regular 3D CNNs is thus highly dependent on clip size, while that of Co3D CNNs is not. Continual CNNs utilise longer receptive fields much more efficiently than regular CNNs in online processing scenarios. In networks intended for embedded systems or online processing, we may increase the clip size to achieve higher accuracy with minimal penalty in computational complexity and worst-case memory.
+
+Another consideration, which influences memory consumption is the temporal kernel size and dilation of CoConv layers. Fortunately, the trend to employ small kernel sizes leaves the memory consumption reasonable for recent 3D CNNs [3], [43], [11], [10]. A larger temporal kernel size would not only affect the memory growth through the CoConv filter, but also for co-occurring residual connections. These consume a significant fraction of the total state-memory for real-life networks: in a Continual X3D-M model (CoX3D-M) the memory of residuals constitutes $20.5\%$ of the total model state memory (see Appendix A).
+
+# 3.8 Training
+
+Co3D CNNs are trained with back-propagation like other neural networks. However, special care must be taken in the estimation of data statistics in normalisation layers: 1) Momentum should be adjusted to $\mathrm{mom}_{\mathrm{step}} = 2 / (1 + \mathrm{timesteps} \cdot (2 / \mathrm{mom}_{\mathrm{clip}} - 1))$ to match the exponential moving average dynamics of clip-based training, where $\mathrm{T}$ is the clip size; 2) statistics should not be tracked for the transient response. Alternatively, they can be trained offline in their "unrolled" regular 3D-CNN form with no temporal padding. This is similar to utilising pre-trained weights from a regular 3D CNN, as we do in our experiments.
+
+# 4 Experiments
+
+The experiments in this section aim to show the characteristics and advantages of Continual 3D CNNs as compared with regular 3D CNNs. One of the main benefits of Co3D CNNs is their ability to reuse the network weights of regular 3D CNNs. As such, all Co3D CNNs in these experiments use publicly available pretrained network weights of regular 3D CNNs [11], [10], [8] without further finetuning. Data pre-processing follows the respective procedures associated with the originating weights unless stated otherwise. The section is laid out as follows: First, we showcase the network performance following weight transfer from regular to Continual 3D on multiple datasets for Human Activity Recognition. This is followed by a study on the transient response of Co3D CNNs at startup. Subsequently, we show how the computational advantages of Co3D CNNs can be exploited to improve accuracy by extending the temporal receptive field. Finally, we perform an extensive on-hardware benchmark of prior methods and Continual 3D CNNs, measuring the 1-clip/frame accuracy of publicly available models, as well as their inference throughput on various computational devices.
+
+| Model | Acc. (%) | Par. (M) | Mem. (MB) | FLOPs (G) | Throughput (preds/s) |
| CPU | TX2 | Xavier | 2080Ti |
| Clip | I3D-R50 | 63.98 | 28.04 | 191.59 | 28.61 | 0.93 | 2.54 | 9.20 | 77.15 |
| R(2+1)D-188 | 53.52 | 31.51 | 168.87 | 20.35 | 1.75 | 3.19 | 6.82 | 130.88 |
| R(2+1)D-1816 | 59.29 | 31.51 | 215.44 | 40.71 | 0.83 | 1.82 | 3.77 | 75.81 |
| Slow-8×8-R50 | 67.42 | 32.45 | 266.04 | 54.87 | 0.38 | 1.34 | 4.31 | 61.92 |
| SlowFast-8×8-R50 | 68.45 | 66.25 | 344.84 | 66.25 | 0.34 | 0.87 | 2.72 | 30.72 |
| SlowFast-4×16-R50 | 67.06 | 34.48 | 260.51 | 36.46 | 0.55 | 1.33 | 3.43 | 41.28 |
| X3D-L | 69.29 | 6.15 | 240.66 | 19.17 | 0.25 | 0.19 | 4.78 | 36.37 |
| X3D-M | 67.24 | 3.79 | 126.29 | 4.97 | 0.83 | 1.47 | 17.47 | 116.07 |
| X3D-S | 64.71 | 3.79 | 61.29 | 2.06 | 2.23 | 2.68 | 42.02 | 276.45 |
| X3D-XS | 59.37 | 3.79 | 28.79 | 0.64 | 8.26 | 8.20 | 135.39 | 819.87 |
| Frame | RCU8 [39]† | 53.40 | 12.80 | - | 4.71 | - | - | - | - |
| CoI3D8 | 59.58 | 28.04 | 235.87 | 5.68 | 3.00 | 2.41 | 14.88 | 125.59 |
| CoI3D64 | 56.86 | 28.04 | 236.08 | 5.68 | 3.15 | 2.41 | 14.89 | 126.32 |
| CoSlow8 | 65.90 | 32.45 | 175.98 | 6.90 | 2.80 | 1.60 | 6.18 | 113.77 |
| CoSlow64 | 73.05 | 32.45 | 176.41 | 6.90 | 2.92 | 1.60 | 6.19 | 102.00 |
| CoX3D-L16 | 63.03 | 6.15 | 184.29 | 1.25 | 2.30 | 0.99 | 25.17 | 206.65 |
| CoX3D-L64 | 71.61 | 6.15 | 184.37 | 1.25 | 2.30 | 0.99 | 27.56 | 217.53 |
| CoX3D-M16 | 62.80 | 3.79 | 68.88 | 0.33 | 7.57 | 7.26 | 88.79 | 844.73 |
| CoX3D-M64 | 71.03 | 3.79 | 68.96 | 0.33 | 7.51 | 7.04 | 86.42 | 796.32 |
| CoX3D-S13 | 60.18 | 3.79 | 41.91 | 0.17 | 13.16 | 11.06 | 219.64 | 939.72 |
| CoX3D-S64 | 67.33 | 3.79 | 41.99 | 0.17 | 13.19 | 11.13 | 213.65 | 942.97 |
+
+Table 1: Kinetics-400 benchmark. The noted accuracy is the single clip or frame top-1 score using RGB as the only input-modality. The performance was evaluated using publicly available pre-trained models without any further finetuning. For speed comparison, predictions per second denote frames per second for the CoX3D models and clips per second for the remaining models. Throughput results are the mean of 100 measurements. Pareto-optimal models are marked with bold. Mem. is the maximum allocated memory during inference noted in megabytes. $\dagger$ Approximate FLOPs derived from paper (see Appendix C).
+
+# 4.1 Transfer from regular to Continual CNNs
+
+To gauge direct transferability of 3D CNN weights, we implement continual versions of various 3D CNNs and initialise them with their publicly available weights for Kinetics-400 [25] and Charades [38]. While it is common to use an ensemble prediction from multiple clips to boost video-level accuracy on these benchmarks, we abstain from this, as it doesn't apply to online-scenarios. Instead, we report the single-clip/frame model performance.
+
+Kinetics-400. We evaluate the X3D network variants XS, S, M, and L on the test set using one temporally centred clip from each video. The XS network is omitted in the transfer to CoX3D, given that it is architecturally equivalent to S, but with fewer frames per clip. In evaluation on Kinetics-400, we faced the challenge that videos were limited to 10 seconds. Due to the longer transient response of Continual CNNs (see Sec. 4.2) and low frame-rate used for training X3D models
+
+ | Model | FLOPs (G) × views | mAP (%) |
| Clip | Slow-8×8 [11] | 54.9 × 30 | 39.0 |
| Slow-8×8 [11]† | 54.9 × 1 | 21.4 |
| Slow-8×8 (ours) | 54.9 × 1 | 24.1 |
| Fr. | CoSlow8 | 6.9 × 1 | 21.5 |
| CoSlow64 | 6.9 × 1 | 25.2 |
+
+Table 2: Charades benchmark. Noted are the FLOPs $\times$ views and video-level mean average precision (mAP) on the validation set using pre-trained model weights. Results achieved using the publicly available SlowFast code [11].
+
+(5.0, 6.0, 6.0 FPS for S, M, and L), the video-length was insufficient to reach steady-state for some models. As a practical measure to evaluate near steady-state, we repeated the last video-frame for a padded video length of $\approx 80\%$ of the network receptive field as a heuristic choice. The Continual CNNs were thus tested on the last frame of the padded video and initialised with the prior frames. The results of the X3D transfer are shown in Tab. 1 and Fig. 1.
+
+For all networks, the transfer from regular to Continua3D CNN results in significant computational savings. For the S, M, and L networks the reduction in FLOPs is $12.1\times$ , $15.1\times$ , and $15.3\times$ respectively. The savings do not quite reach the clip sizes since the final pooling and prediction layers are active for each frame. As a side-effect of the transfer from zero-padded regular CNN to Continua3D CNN without zero-padding, we see a notable reduction in accuracy. This is easily improved by using an extended pooling size for the network (discussed in Sec. 3.7 and in Sec. 4.2). Using a global average pooling with temporal kernel size 64, we improve the accuracy of X3D by $2.6\%$ , $3.8\%$ , and $2.3\%$ in the Continua3D S, M, and L network variants. As noted, Kinetics dataset did not have sufficient frames to fill the temporal receptive field of all models in these tests. We explore this further in Sections 4.2 and 4.2.
+
+Charades. To showcase the generality of the approach, we repeat the above described procedure with another 3D CNN, the CoSlow network [11]. We report the video-level mean average precision (mAP) of the validation split alongside the FLOPs per prediction in Tab. 2. Note the accuracy discrepancy between 30 view (10 temporal positions with 3 spatial positions each) and 1 view (spatially and temporally centred) evaluation. As observed on Kinetics, the CoSlow network reduces the FLOPs per prediction proportionally with the original clip size (8 frames), and can recover accuracy by extending the global average pool size.
+
+# 4.2 Ablation Experiments
+
+As described in Sec. 3.6, Continual CNNs exhibit a transient response during their up-start. In order to gauge this response, we perform ablations on the
+
+Kinetics-400 validation set, this time sampled at 15 FPS to have a sufficient number of frames available. This corresponds to a data domain shift [45] relative to the pre-trained weights, where time advances slower.
+
+Transient response of Continual CNNs. Our expected upper bound is given by the baseline X3D network 1-clip accuracy at 15 FPS. The transient response is measured by varying the number of prior frames used for initialisation before evaluating a frame using the CoX3D model. Note that temporal center-crops of size $T_{\mathrm{init}} + 1$ , where $T_{\mathrm{init}}$ is the number of initialisation frames, are used in each evaluation to ensure that the frames seen by the network come from the centre. This precaution counters a data-bias, we noticed in Kinetics-400, namely that the start and end of a video are less informative and contribute to worse predictions than the central part. We found results to vary up to $8\%$ for a X3D-S network evaluated at different video positions. The experiment is repeated for two initialisation schemes, "zeros" (used in other experiments) and "replicate", and two model sizes, S and M. The transient responses are shown in Fig. 5.
+
+For all responses, the first $\approx 25$ frames produce near-random predictions, before rapidly increasing at 25-30 frames until a steady-state is reached at $49.2\%$ and $56.2\%$ accuracy for S and M. Relative to the regular X3D, this constitutes a steady-state error of $-1.7\%$ and $-5.8\%$ . Comparing initialisation schemes, we see that the "replicate" scheme results in a slightly earlier rise. The rise sets in later for the "zeros" scheme, but exhibits a sharper slope, topping with peaks of $51.6\%$ and $57.6\%$ at 41 and 44 frames seen as discussed in Sec. 3.6. This
+
+
+(a) CoX3D-S
+
+
+(b) CoX3D-M
+Fig. 5: Transient response for ContinuaX3D-{S,M} on the Kinetics-400 val at 15 FPS. Dotted horizontal lines denote X3D validation accuracy for 1-clip predictions. Black circles highlight the theoretically required initialisation frames.
+
+makes sense considering that the original network weights were trained with this exact amount of zero-padding. Adding more frames effectively replaces the padded zeros and causes a slight drop of accuracy in the steady state, where the accuracy settles at the same values as for the "replication" scheme.
+
+Extended receptive field. Continual CNNs experience a negligible increase in computational cost when larger temporal receptive field are used (see Sec. 3.7). For CoX3D networks, this extension can be trivially implemented by increasing the temporal kernel size of the last pooling layer. In this set of experiments, we extend CoX3D-{S,M,L} to have temporal pooling sizes 32, 64, and 96, and evaluate them on the Kinetics-400 validation set sampled at 15 FPS. The Continual CNNs are evaluated at frames corresponding to the steady state.
+
+Tab. 3 shows the measured accuracy and floating point operations per frame (CoX3D) / clip (X3D) as well as the pool size for the penultimate network layer (global average pooling) and the total receptive field of the network in the temporal dimension. As found in Sec. 4.1, each transfer results in significant computational savings alongside a drop in accuracy. Extending the kernel size of the global average pooling layer increases the accuracy of the Continual CNNs by $11.0 - 13.3\%$ for 96 frames relative the original 13-16 frames, surpassing that of the regular CNNs. Lying at $0.017 - 0.009\%$ , the corresponding computational increases can be considered negligible.
+
+| Model | Size | Pool | Acc. | FLOPs (K) | Rec. Field |
| X3D | S | 13 | 51.0 | 2,061,366 | 13 |
| M | 16 | 62.1 | 4,970,008 | 16 |
| L | 16 | 64.1 | 19,166,052 | 16 |
| CoX3D | S | 13 | 49.2 | 166,565 | 69 |
| 16 | 50.1 | 166,567 | 72 |
| 32 | 54.7 | 166,574 | 88 |
| 64 | 59.8 | 166,587 | 120 |
| 96 | 61.8 | 166,601 | 152 |
| M | 16 | 56.3 | 325,456 | 72 |
| 32 | 60.7 | 325,463 | 88 |
| 64 | 64.9 | 325,477 | 120 |
| 96 | 67.3 | 325,491 | 152 |
| L | 16 | 53.0 | 1,245,549 | 130 |
| 32 | 58.5 | 1,245,556 | 146 |
| 64 | 64.3 | 1,245,570 | 178 |
| 96 | 66.3 | 1,245,584 | 210 |
+
+Table 3: Effect of extending pool size. Note that the model weights were trained at different sampling rates than evaluated at (15 FPS), resulting in a lower top-1 val. accuracy. Italic numbers denote measurement taken within the transient response due to a lack of frames in the video-clip.
+
+# 4.3 Inference benchmarks
+
+Despite their high status in activity recognition leader-boards [35], it is unclear how recent 3D CNNs methods perform in the online setting, where speed and accuracy constitute a necessary trade-off. To the best of our knowledge, there has not yet been a systematic evaluation of throughput for these video-recognition models on real-life hardware. In this set of experiments, we benchmark the FLOPs, parameter count, maximum allocated memory and 1-clip/frame accuracy of I3D [3], R(2+1)D [43], SlowFast[41], X3D [10], CoI3D, CoSlow, and CoX3D. To gauge achievable throughputs at different computational budgets, networks were tested on four hardware platforms as described in Appendix B.
+
+As seen in the benchmark results found in Tab. 1, the limitation to one clip markedly lowers accuracy compared with the multi-clip evaluation published in the respective works [3], [43], [11], [10]. Nonetheless, the Continual models with extended receptive fields attain the best accuracy/speed trade-off by a large margin. For example, CoX3D-L $_{64}$ on the Nvidia Jetson Xavier achieves an accuracy of $71.3\%$ at 27.6 predictions per second compared to $67.2\%$ accuracy at 17.5 predictions per second for X3D-M while reducing maximum allocated memory by $48\%$ ! Confirming the observation in [30], we find that the relation between model FLOPs and throughput varies between models, with better ratios attained for simpler models (e.g., I3D) than for complicated ones (e.g., X3D). This relates to different memory access needs and their cost. Tailor-made hardware could plausibly reduce these differences. Supplementary visualisation of the results in Tab. 1 are found in Appendix C.
+
+# 5 Conclusion
+
+We have introduced Continua3D Convolutional Neural Networks (Co3D CNNs), a new computational model for spatio-temporal 3D CNNs, which performs computations frame-wise rather than clip-wise while being weight-compatible with regular 3D CNNs. In doing so, we are able dispose of the computational redundancies faced by 3D CNNs in continual online processing, giving up to a $15.1\times$ reduction of floating point operations, a $9.2\times$ real-life inference speed-up on CPU, $48\%$ peak memory reduction, and an accuracy improvement of $5.6\%$ on Kinetics-400 through an extension in the global average pooling kernel size.
+
+While this constitutes a substantial leap in the processing efficiency of energy-constrained and real-time video recognition systems, there are still unanswered questions pertaining to the dynamics of Co3D CNNs. Specifically, the impact of extended receptive fields on the networks ability to change predictions in response to changing contents in the input video is untested. We leave these as important directions for future work.
+
+# Acknowledgement
+
+This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 871449 (OpenDR).
+
+# References
+
+1. Arnab, A., Dehghani, M., Heigold, G., Sun, C., Lučić, M., Schmid, C.: Vivit: A video vision transformer. In: IEEE/CVF International Conference on Computer Vision (ICCV). pp. 6836-6846 (2021)
+2. Cai, Z., He, X., Sun, J., Vasconcelos, N.: Deep learning with low precision by halfwave gaussian quantization. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 5406-5414 (2017)
+3. Carreira, J., Zisserman, A.: Quo vadis, action recognition? a new model and the kinetics dataset. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 4724-4733 (2017)
+4. Carreira, J., Noland, E., Banki-Horvath, A., Hillier, C., Zisserman, A.: A short note about kinetics-600. preprint, arXiv:1808.01340 (2018)
+5. Carreira, J., Pătrăucean, V., Mazare, L., Zisserman, A., Osindero, S.: Massively parallel video networks. In: Ferrari, V., Hebert, M., Sminchisescu, C., Weiss, Y. (eds.) Proceedings of the European Conference on Computer Vision (ECCV). pp. 680-697 (2018)
+6. Chen, W., Wilson, J.T., Tyree, S., Weinberger, K.Q., Chen, Y.: Compressing neural networks with the hashing trick. In: International Conference on International Conference on Machine Learning (ICML). p. 2285-2294 (2015)
+7. Donahue, J., Hendricks, L.A., Guadarrama, S., Rohrbach, M., Venugopalan, S., Darrell, T., Saenko, K.: Long-term recurrent convolutional networks for visual recognition and description. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 2625-2634 (2015)
+8. Fan, H., Murrell, T., Wang, H., Alwala, K.V., Li, Y., Li, Y., Xiong, B., Ravi, N., Li, M., Yang, H., Malik, J., Girshick, R., Feiszli, M., Adcock, A., Lo, W.Y., Feichtenhofer, C.: PyTorchVideo: A deep learning library for video understanding. In: ACM International Conference on Multimedia (2021)
+9. Farnebäck, G.: Two-frame motion estimation based on polynomial expansion. In: Image Analysis. pp. 363-370. Springer Berlin Heidelberg (2003)
+0. Feichtenhofer, C.: X3D: Expanding architectures for efficient video recognition. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2020)
+1. Feichtenhofer, C., Fan, H., Malik, J., He, K.: Slowfast networks for video recognition. In: IEEE/CVF International Conference on Computer Vision (ICCV) (October 2019)
+2. Floropoulos, N., Tefas, A.: Complete vector quantization of feedforward neural networks. Neurocomputing 367, 55-63 (2019)
+3. Han, S., Mao, H., Dally, W.J.: Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. In: International Conference on Learning Representations (ICLR) (2016)
+4. He, Y., Zhang, X., Sun, J.: Channel pruning for accelerating very deep neural networks. In: 2017 IEEE International Conference on Computer Vision (ICCV). pp. 1398-1406 (2017)
+5. Hedegaard, L., Iosifidis, A.: Continual inference: A library for efficient online inference with deep neural networks in pytorch. preprint, arXiv:2204.03418 (2022)
+6. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. In: NIPS Deep Learning and Representation Learning Workshop (2015)
+7. Howard, A.G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., Adam, H.: Mobilenets: Efficient convolutional neural networks for mobile vision applications. preprint, arXiv:1704.04861 abs/1704.04861 (2017)
+
+18. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 7132-7141 (2018)
+19. Hubara, I., Courbariaux, M., Soudry, D., El-Yaniv, R., Bengio, Y.: Binarized neural networks. In: Lee, D., Sugiyama, M., Luxburg, U., Guyon, I., Garnett, R. (eds.) Advances in Neural Information Processing Systems. vol. 29. Curran Associates, Inc. (2016)
+20. Ji, S., Xu, W., Yang, M., Yu, K.: 3d convolutional neural networks for human action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) 35(1), 221-231 (2013)
+21. Joe Yue-Hei Ng, Hausknecht, M., Vijayanarasimhan, S., Vinyals, O., Monga, R., Toderici, G.: Beyond short snippets: Deep networks for video classification. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 4694-4702 (2015)
+22. Kalogeiton, V., Weinzaepfel, P., Ferrari, V., Schmid, C.: Action tubelet detector for spatio-temporal action localization. In: 2017 IEEE International Conference on Computer Vision (ICCV). pp. 4415-4423 (2017)
+23. Karpathy, A., Toderici, G., Shetty, S., Leung, T., Sukthankar, R., Fei-Fei, L.: Large-scale video classification with convolutional neural networks. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 1725-1732 (2014)
+24. Karpathy, A.: CS231n convolutional neural networks for visual recognition, https://cs231n.github.io/convolutional-networks/. Last visited on 2021/01/26
+25. Kay, W., Carreira, J., Simonyan, K., Zhang, B., Hillier, C., Vijayanarasimhan, S., Viola, F., Green, T., Back, T., Natev, P., Suleyman, M., Zisserman, A.: The kinetics human action video dataset. preprint, arXiv:1705.06950 (2017)
+26. Köpukliu, O., Hörmann, S., Herzog, F., Cevikalp, H., Rigoll, G.: Dissected 3d cnns: Temporal skip connections for efficient online video processing. preprint, arXiv:2009.14639 (2020)
+27. Kopukli, O., Wei, X., Rigoll, G.: You only watch once: A unified cnn architecture for real-time spatiotemporal action localization. preprint, arXiv:1911.06644 (2019)
+28. Kopukliu, O., Kose, N., Gunduz, A., Rigoll, G.: Resource efficient 3d convolutional neural networks. In: IEEE/CVF International Conference on Computer Vision Workshop (ICCVW). pp. 1910-1919 (2019)
+29. Liu, G., Shih, K.J., Wang, T.C., Reda, F.A., Sapra, K., Yu, Z., Tao, A., Catanzaro, B.: Partial convolution based padding. preprint, arXiv:1811.11718 pp. 1-11 (2018)
+30. Ma, N., Zhang, X., Zheng, H.T., Sun, J.: Shufflenet v2: Practical guidelines for efficient cnn architecture design. In: Proceedings of the European Conference on Computer Vision (ECCV) (September 2018)
+31. Molchanov, P., Yang, X., Gupta, S., Kim, K., Tyree, S., Kautz, J.: Online detection and classification of dynamic hand gestures with recurrent 3d convolutional neural networks. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 4207-4215 (2016)
+32. Neimark, D., Bar, O., Zohar, M., Asselmann, D.: Video transformer network. In: 2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW). pp. 3156-3165 (2021)
+33. Nguyen, A., Choi, S., Kim, W., Ahn, S., Kim, J., Lee, S.: Distribution padding in convolutional neural networks. In: International Conference on Image Processing (ICIP). pp. 4275-4279 (2019)
+34. van den Oord, A., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A., Kavukcuoglu, K.: Wavenet: A generative model for raw audio. preprint, arXiv:1609.03499 (2016)
+
+35. Papers with Code: Kinetics-400 leaderboard, https://paperswithcode.com/sota/action-classification-on-kinetics-400. Last visited on 2021/02/03.
+36. Passalis, N., Tefas, A.: Learning deep representations with probabilistic knowledge transfer. In: Proceedings of the European Conference on Computer Vision (ECCV) (2018)
+37. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A.C., Fei-Fei, L.: Imagenet large scale visual recognition challenge. International Journal of Computer Vision (ICCV) 115(3), 211-252 (2015)
+38. Sigurdsson, G.A., Varol, G., Wang, X., Farhadi, A., Laptev, I., Gupta, A.: Hollywood in homes: Crowdsourcing data collection for activity understanding. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016)
+39. Singh, G., Cuzzolin, F.: Recurrent convolutions for causal 3d cnns. In: 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW). pp. 1456-1465 (2019)
+40. Singh, G., Saha, S., Sapienza, M., Torr, P., Cuzzolin, F.: Online real-time multiple spatiotemporal action localisation and prediction. In: 2017 IEEE International Conference on Computer Vision (ICCV). pp. 3657-3666 (2017)
+41. Sovrasov, V.: Ptflops, https://github.com/sovrasov/flops-counter.pytorch.MIT License. Last visited on 2021/03/02
+42. Tan, M., Le, Q.: EfficientNet: Rethinking model scaling for convolutional neural networks. In: Proceedings of Machine Learning Research. vol. 97, pp. 6105-6114 (2019)
+43. Tran, D., Wang, H., Torresani, L., Ray, J., LeCun, Y., Paluri, M.: A closer look at spatiotemporal convolutions for action recognition. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6450-6459 (2018)
+44. Tran, D., Bourdev, L., Fergus, R., Torresani, L., Paluri, M.: Learning spatiotemporal features with 3d convolutional networks. In: IEEE International Conference on Computer Vision (ICCV). pp. 4489-4497 (2015)
+45. Wang, M., Deng, W.: Deep visual domain adaptation: A survey. Neurocomputing 312, 135-153 (2018)
+46. Xu, M., Zhu, M., Liu, Y., Lin, F., Liu, X.: Deepcache: Principled cache for mobile deep vision. International Conference on Mobile Computing and Networking (2018)
+47. Yim, J., Joo, D., Bae, J., Kim, J.: A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 7130-7138 (2017)
+48. Zhang, X., Zhou, X., Lin, M., Sun, J.: Shufflenet: An extremely efficient convolutional neural network for mobile devices. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6848-6856 (2018)
+49. Zhu, L., Sevilla-Lara, L., Yang, Y., Feiszli, M., Wang, H.: Faster recurrent networks for efficient video classification. Proceedings of the AAAI Conference on Artificial Intelligence 34, 13098-13105 (2020)
\ No newline at end of file
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/images.zip b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..57bdea7906d31be1eefb9feb8dcf1c1844a3962b
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33ee6feb4f11d7da9b5b4ec30b42f7cce623a1e7ca23f80aefd42dbecdfc526f
+size 374250
diff --git a/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/layout.json b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c4fbb01f03c1de36e119be52c846500c2737aa89
--- /dev/null
+++ b/continual3dconvolutionalneuralnetworksforrealtimeprocessingofvideos/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:815fad210daf75a18f9b9e53c4aa4951960a117b0d3b790561ff1847428d76e8
+size 356040
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_content_list.json b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e7b7fbc06f11c5a4ed4824239bcbf0a224637c30
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:68b3870ede8fca2db1f365778a5c261ac95389d68e11b4227d1b06285ee155b3
+size 77381
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_model.json b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0aaa8869cf714775a05fbcddc1cca399c35863c6
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f1694088dd41bf5b45e5460b868c914a2a78fd00a51f8837d54c3d417515c20
+size 95758
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_origin.pdf b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..682310d6481cd71c79674d175114543983bd4725
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/30854406-8a13-4848-b2d3-b29fd769ddea_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1927f592dec2ada986de32c68e27211afe22564f42086b2d053d584bf40f6a4f
+size 1983502
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/full.md b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7eee900f9eb3a135cdf05d0b208f6905364b809b
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/full.md
@@ -0,0 +1,295 @@
+# Continual Semantic Segmentation via Structure Preserving and Projected Feature Alignment
+
+Zihan Lin $^{\text{®}}$ , Zilei Wang $^{\text{®}}$ , and Yixin Zhang $^{\text{®}}$
+
+University of Science and Technology of China {myustc, zhyx12}@mail.ustc.edu.cn, zlwang@ustc.edu.cn
+
+Abstract. Deep networks have been shown to suffer from catastrophic forgetting. In this work, we try to alleviate this phenomenon in the field of continual semantic segmentation (CSS). We observe that two main problems lie in existing arts. First, attention is only paid to designing constraints for encoder (i.e., the backbone of segmentation network) or output probabilities. But we find that forgetting also happens in the decoder head and harms the performance greatly. Second, old and new knowledge are entangled in intermediate features when learning new categories, making existing practices hard to balance between plasticity and stability. On these bases, we propose a framework driven by two novel constraints to address the aforementioned problems. First, a structure preserving loss is applied to the decoder's output to maintain the discriminative power of old classes from two different granularities in embedding space. Second, a feature projection module is adopted to disentangle the process of preserving old knowledge from learning new classes. Extensive evaluations on VOC2012 and ADE20K datasets show the effectiveness of our approach, which significantly outperforms existing state-of-the-art CSS methods.
+
+Keywords: incremental learning, semantic segmentation
+
+# 1 Introduction
+
+Semantic segmentation aims to assign every pixel a semantic category for a given image, which is a fundamental but challenging computer vision task. In recent years, the state-of-the-art methods [7,47,48] based on Fully Convolutional Network (FCN) [30] have achieved great success on large-scale benchmarks [15,49,9]. These models are designed to be trained in a one-shot mode with all data prepared in advance. When fitted in real-world applications, they will inevitably encounter situations where new categories need to be gradually learned. A naive way is to fine-tune the models on new data. But they often fail to preserve the performance of learned classes when updating themselves, which is called catastrophic forgetting [16] and becomes a main obstacle in practical applications. Incremental learning, which enables models to continuously learn new knowledge like human beings, is considered to be a promising solution to this challenge.
+
+Class incremental learning (CIL) has been widely studied in image classification [29,39,26,22,14], but it only received attention very recently in semantic
+
+segmentation. Extending methods from classification, current CSS approaches have managed to make some progress, but two problems still remain unsolved. One of them is that existing practices add constraints on either output probabilities [3] or encoder [13,37] to prevent forgetting. But they fail to consider the decoder head, which is a component exclusively in segmentation model. We argue that forgetting phenomenon also exists in decoder and has a significant impact on performance (details in Section 5.5). On this demand, we aim to design a constraint specially for decoder to mitigate the forgetting. Another problem lies in the knowledge distillation (KD) [20] used by existing methods [14,13,12] to prevent changes in intermediate features (i.e., the output of encoder). Fixing the model activations is reasonable in classification since the ground truth of a certain image is consistent across all learning steps, but it's not the case in CSS. The semantic information of a given image might gradually increase, which is known as the background shift [3]. This requires the intermediate features to be updated accordingly to integrate the knowledge of upcoming classes, making the aforementioned practices fail in this situation. Simply mimicking the intermediate features of the old model would cause a conflict, where the model tries to be persistent on the old activations while struggling to learn the new knowledge, and ultimately results in degradation of performance.
+
+In response to these problems, we propose a novel framework called SPPA, standing for Structure Preserving and Projected feature Alignment. It consists of two main components to tackle the forgetting of encoder and decoder, respectively. For encoder, we adopt a feature projection module to extract from intermediate features some low-dimensional representations of old knowledge, on which alignment is performed. This practice disentangles the preservation of old knowledge and the integration of new knowledge, which enables us to maintain the integrity of old knowledge without hindering the update process of new knowledge. For decoder, inter-class and intra-class structures are first modeled from its output, which reflect both coarse and fine-grained relations in embedding space. The structures are then explicitly maintained during incremental learning, which can effectively preserve the discriminability of old classes while being more flexible for new classes. The extensive experiments on Pascal-VOC 2012 [15] and ADE20K [49] demonstrate the effectiveness of our method. The contributions of this paper are summarized as
+
+- We unveil the forgetting phenomena of decoder head in CSS, and propose to mitigate this by maintaining the class-related structures in embedding space at two different granularities.
+- We manage to solve the potential conflict of feature KD in CSS by disentangle the preservation of old knowledge and the integration of new knowledge. Consequently provides a better trade-off between stability and plasticity.
+- We integrate both modules into a unified framework, which is evaluated on two popular datasets with diverse experimental settings. The results reveal that our method outperforms previous state-of-the-art methods.
+
+# 2 Related Works
+
+Continual Learning. Deep neural networks have achieved great success in many fields, such as image classification [19], semantic segmentation [7] and object detection [40]. However, they often suffer from catastrophic forgetting [16] when situated in real scenarios where continuous streams of new data are involved. Continual learning that aims at tackling this obstacle has become an active field recently.
+
+Continual learning for image classification has been extensively studied these years. Current techniques can be mainly divided into rehearsal methods, architectural methods and regularization methods. Rehearsal methods store a limited amount of raw images [39,2,22] and interleave them with new data to relieve forgetting. Some methods store intermediate features [25,18,10] instead, as they require less storage and contain richer information. Generation-based methods are derived from them that resort to generative networks to obtain images [42,8] or features [43] of old classes. Architectural methods either use a sub-network [33,32] to solve each independent task at a cost of limited scalability, or dynamically expand the network [44,28,45] for learning new tasks with growing complexity. Most of these methods require additional task labels and are restricted to multi-head [34] setup. Regularization methods design extra loss functions to maintain the previous knowledge, which can be divided into parameter regularization [46,26] and distillation-based methods. Parameter regularization prevents updates on the most important parameters for old tasks based on various metrics like fisher information matrix [26] or gradient magnitude [46]. Distillation-based methods are the most common currently. It was first introduced by LwF [29] to penalize the changes in output logits. LwM [12] additionally performs distillation on attention maps. [22] introduces a stronger constraint by punishing changes in feature vectors. Distillation on intermediate features is used in [14] to further reduce forgetting.
+
+Continual Semantic Segmentation. Modern deep neural networks for semantic segmentation are mostly based on the fully convolutional network (FCN) [30]. Recent developments mainly try to exploit spatial information to improve accuracy. For example, encoder-decoder architecture [41,1] is used to prevent spatial information loss. Atrous convolution [35] enlarges the field of view to incorporate more spatial context information. Multi-scale information is further considered in ASPP [5] and PSPNet [47]. More recently, attention mechanisms have been used to model spatial dependences [48,17,24].
+
+Despite their great success, segmentation networks inevitably suffer from catastrophic forgetting when used in online scenarios. [36] is the first one targeting for CSS. But it requires the labels of both old and current classes be provided, which greatly limits its capability in real scenarios. [3] formalized background shift, which is a new obstacle specially for CSS. To overcome this, they modified traditional distillation loss and cross-entropy loss to an unbiased version considering the semantic inconsistency of background. More recently, some methods
+
+
+Fig. 1. Overview of the proposed framework. Alignment is performed on the representations generated by the feature projector to solve the potential conflict in feature distillation for encoder. The structure preserving loss is used to maintain discriminative structures for old classes, while the contrastive loss is used to optimize the structures of new classes. Finally, pseudo label is used to provide missing annotations for old classes.
+
+proposed to tackle forgetting in encoder. [37] designed a framework combining prototype distillation, feature sparcification and contrastive learning. However, a plasticity issue might arise when trying to punish any changes in prototypes. [13] proposed a multi-scale pooling distillation to preserve long and short range statistics in intermediate features. But it cannot solve the conflict of old and new knowledge stated before. What's more, all of the existing works never considered the forgetting of decoder. Our work is the first attempt to tackle forgetting in both encoder and decoder in a single framework, with two novel distillation approaches to achieve a better plasticity-stability trade-off than existing methods.
+
+# 3 Problem Definition
+
+In semantic segmentation, let $\mathcal{X} \in \mathbb{R}^{H \times W \times 3}$ be the input space, and $\mathcal{Y} \in \mathcal{C}^{H \times W}$ be the label space where $\mathcal{C}$ is a given category set. Given a dataset $\mathcal{T} = \{(\mathbf{x}_n, \mathbf{y}_n)\}$ where $(\mathbf{x}_n, \mathbf{y}_n) \subset \mathcal{X} \times \mathcal{Y}$ . The goal is to produce a segmentation map $\hat{\mathbf{y}} \subset \mathcal{Y} \in \mathcal{C}^{H \times W}$ by assigning each pixel $x_i \in \mathbf{x}$ a class in $\mathcal{C}$ . This is usually done using a deep neural network $M: \mathcal{X} \mapsto \mathbb{R}^{H \times W \times \mathcal{C}}$ and the segmentation result is calculated as $\hat{\mathbf{y}} = \arg \max_c M(\mathcal{X})[h, w, c]$ . Nowadays $M$ is usually an encoder-decoder architecture made by a feature extractor $E$ and a segmentation head $D$ (i.e., $M = E \circ D$ ). In our work, we treat the final classifier as an individual module $G$ , which makes $M = E \circ D \circ G$ . We use $\mathbf{F}$ to represent the intermediate feature output by encoder $E(\mathbf{x})$ , and $\mathbf{E}$ to represent the embedding output by decoder $D(\mathbf{F})$ before final classifier.
+
+In conventional training pipeline, the complete training set $\mathcal{T}$ is available and the model is trained only once to learn all classes $\mathcal{C}$ . While in continual
+
+learning, the training procedure is composed of multiple learning steps. At each step, a subset of the training set is provided together with a set of novel classes to be learned. More specifically, at the initial learning step $t = 0$ , a standard supervised training is performed on a subset of training data $\mathcal{T}^0$ with labels of $\mathcal{C}^0$ . Next moving to a more general step $t$ , a set of novel classes $\mathcal{C}^t \in \mathcal{C}$ is introduced, expanding the learned label set to $\mathcal{C}^{0:t} = \mathcal{C}^{0:t-1} \cup \mathcal{C}^t$ . A training set $\mathcal{T}^t$ with all $\mathcal{C}^{0:t-1}$ labeled as background and only $\mathcal{C}^t$ been labeled is provided to update the previous model $M_{t-1}: \mathcal{X} \mapsto \mathbb{R}^{H \times W \times \mathcal{C}^{0:t-1}}$ to $M_t: \mathcal{X} \mapsto \mathbb{R}^{H \times W \times \mathcal{C}^{0:t}}$ . As in standard class incremental learning, we assume that the classes introduced in different steps are disjoint ( $\mathcal{C}^i \cap \mathcal{C}^j = \emptyset$ ) except for the background class b.
+
+# 4 Method
+
+In this section, we will introduce the proposed modules one by one, following the structure depicted in Fig. 1 from left to right to make it easier to follow.
+
+# 4.1 Projected Feature Alignment for Encoder
+
+We first go through the feature distillation in existing works. [14,12,22] have attempted to perform distillation on intermediate features, which consists of a distance metric to minimize the differences between feature maps from old and new models. Due to the rich information contained in intermediate features, this approach often yields better performance than logits distillation. An Euclidean distance is usually applied, and the distillation loss can be formulated as
+
+$$
+L = \left\| E _ {t} (\mathbf {x}) - E _ {t - 1} (\mathbf {x}) \right\| _ {2}, \tag {1}
+$$
+
+where $E_{t}(\mathbf{x})$ , $E_{t - 1}(\mathbf{x})$ indicate the feature of image $\mathbf{x}$ extracted by the encoder of step $t$ and step $t - 1$ , respectively.
+
+It's reasonable to keep the activations invariant in classification since the semantic information of an image will not change across all incremental learning steps. In CSS however, the semantic information might increase (e.g., we want to learn a new class which was ignored and labeled as background before). This is known as the background shift phenomenon[3] exclusively in CSS. Ideally, the intermediate features should be updated to integrate new knowledge. It means that even if the current model does not forget the old knowledge, its intermediate features could still be quite different from the ones extracted by the old model. If we make the current model directly mimic the old one, a conflict arises between being unchanged in the activations and adapting to new classes at the same time.
+
+Therefore, we try to disentangle the processes of retaining old knowledge and learning new classes for intermediate features. It is known that an auto-encoder can generate compact representations that contain sufficient information to reconstruct the original feature maps [21]. We leverage this property to extract low-dimensional representations of old knowledge from intermediate features.
+
+These representations are then used for alignment. It's worth noting that we do not reduce the spatial resolution like traditional auto-encoder since the segmentation task requires high spatial precision. We define the auto-encoder architecture as a projector $P$ and a reconstructor $R$ to avoid being confused with the encoder and the decoder in segmentation model. Before starting learning step $t$ , we use the intermediate features of $\mathcal{T}^t$ extracted by $E_{t - 1}$ to train a projection module $P_{t - 1}$ from scratch using the reconstruction loss $L_{\text{recon}}$ .
+
+$$
+L _ {r e c o n} = \left\| E _ {t - 1} (\mathbf {x}) - R _ {t - 1} \left(P _ {t - 1} \left(E _ {t - 1} (\mathbf {x})\right)\right) \right\| _ {2} \tag {2}
+$$
+
+After it converges, the reconstructor $R_{t-1}$ is discarded, the old model $M_{t-1}$ and the trained $P_{t-1}$ is used to initialize the current model (i.e., $M_t$ and $P_t$ ). During the training of current step $t$ , $M_{t-1}$ and $P_{t-1}$ are fixed, while $P_t$ and $M_t$ are updated. L1 distance is minimized between the output of $P_{t-1}$ and $P_t$ .
+
+$$
+L _ {a l i} = \left\| P _ {t - 1} \left(E _ {t - 1} (\mathbf {x})\right) - P _ {t} \left(E _ {t} (\mathbf {x})\right) \right\| _ {1} \tag {3}
+$$
+
+The design intuition is as follows: The output representations of $P_{t-1}$ contain sufficient information to restore the old features $E_{t-1}(\mathbf{x})$ which stand for the old knowledge. If we can extract the same representations from the new feature maps $E_t(\mathbf{x})$ by $P_t$ , it indicates that the new feature maps still hold the same old knowledge as that of the old. With this design, we make it possible to add constraints on the old knowledge without the potential impediment on learning new knowledge.
+
+# 4.2 Class Structure Preserving for Decoder
+
+Existing approaches utilizing pre-classifier embeddings commonly fall into adding constraints for feature vectors [22] or class prototypes [37,4]. However, when applied in CSS to prevent forgetting in decoder head, we find that these methods yield overly strong constraints on the output, which penalizes any possible changes with respect to its previous position in the embedding space. On the one hand, it might impede the model from finding a globally optimal position that benefits both old and new classes, thus hindering the learning of new classes. On the other hand, the model tries to be persistent in the absolute positions of old classes while integrating new classes. This might cause an optimization conflict, which results in uncontrollable small drifts of old classes in embedding space and ultimately leads to a chaotic distribution, as shown in Fig. 6.
+
+Since it is undesirable to directly fix the embeddings of old classes, we turn to seeking a practice that can preserve the performance of old classes without sacrificing the freedom to learn new classes. It is known that the embeddings from a well-trained model form a space, in which the instances of the same class are close to each other and far from those of different class. This geometry in embedding space is the key to making each class linearly separable. Inspired by this, we propose to model the structures in embedding space and explicitly maintain them during incremental learning steps. In this work, we consider two
+
+structures of different granularity: the structure between different classes (inter-class structure) and the structure within a single class (intra-class structure).
+
+Class prototypes (i.e., mean of feature vectors of a class) are needed when modeling these two structures. Generally, they can be computed in a global, in-batch or in-image manner, which represents the class information from coarse-grained (global-level) to fine-grained (instance-level). In segmentation, the embeddings of the same class vary across images and, in our observation, form image-level mini-clusters. Adopting in-image prototypes to obtain a fine-grained relation in our case helps to reflect these differences at an instance level and slightly boosts the performance. Similar practices are also observed in other designs for segmentation, like [23] uses in-image prototypes for contrastive learning. The in-image prototype $\mathbf{p}_c$ of class $c$ for an input image is defined as
+
+$$
+\mathbf{p}_{c} = \frac{1}{|\mathbf{y}^{*} = c|}\sum_{\substack{\mathbf{e}_{i}\in \mathbf{E}\\ i = c}}\mathbf{e}_{i}. \tag{4}
+$$
+
+Since $\mathbf{E}$ has lower spatial resolution than input due to the network architecture, $\mathbf{y}$ should be resized to match the spatial dimension of $\mathbf{E}$ and is denoted as $\mathbf{y}^*$ . $i = c$ means the position $i$ is labeled as class $c$ in $\mathbf{y}^*$ . Because we don't have labels for old classes, the pseudo label $\hat{\mathbf{y}}^*$ output by the old model is used to obtain old class prototypes.
+
+The inter-class structure is formulated as a distance matrix $A$ between each in-image prototype of old classes obtained in the current batch, where $A_{ij}$ is the cosine distance between prototypes $i$ and $j$ . The consistency constraint is then applied between $A^t$ from $M_t$ and $A^{t-1}$ from $M_{t-1}$ . $\bar{\mathbf{p}}_i$ is l2-normalized version of $\mathbf{p}_i$ and $\langle \bar{\mathbf{p}}_i, \bar{\mathbf{p}}_j \rangle$ calculates the cosine similarity between $\mathbf{p}_i$ and $\mathbf{p}_j$ .
+
+$$
+A _ {i j} = 1 - \langle \bar {\mathbf {p}} _ {i}, \bar {\mathbf {p}} _ {j} \rangle , \quad i, j \in \mathcal {C} ^ {0: t - 1} \tag {5}
+$$
+
+$$
+L _ {i n t e r} = \left\| A ^ {t} - A ^ {t - 1} \right\| _ {F} \tag {6}
+$$
+
+As for the intra-class structure, the embedding vectors of the same class are clustered closely with each other, so we leverage Euclidean distance to better reflect the small changes in the structure. Intuitively, the intra-class structure can be maintained by keeping the distance between embedding vectors and their prototypes. We further integrate the direction information to prevent the embedding vectors from rotating (See Fig. 2 right), making the constraints as fixing the relative position of embedding vectors with regard to their prototypes. The loss function for a class $c$ is defined as
+
+$$
+L _ {i n t r a} (c) = \frac {1}{| \hat {\mathbf {y}} ^ {*} = c |} \sum_ {\substack {\mathbf {e} _ {i} \in \mathbf {E} \\ i = c}} \| (\mathbf {e} _ {i} ^ {t - 1} - \mathbf {p} _ {c} ^ {t - 1}) - (\mathbf {e} _ {i} ^ {t} - \mathbf {p} _ {c} ^ {t}) \| _ {2}, \tag{7}
+$$
+
+in which $\mathbf{e}_i^{t - 1}$ , $\mathbf{p}_c^{t - 1}$ is obtained from $M_{t - 1}$ . $\mathbf{e}_i^t$ , $\mathbf{p}_c^t$ is obtained from $M_t$ . $\nu$ is used to balance between inter-class term and intra-class term.
+
+
+Fig. 2. Illustration of the structure preserving loss, which maintains inter-class structure and intra-class structure respectively.
+
+$$
+L _ {s t r} = L _ {i n t e r} + \nu \sum_ {c \in \mathcal {C} ^ {0: t - 1}} L _ {i n t r a} (c). \tag {8}
+$$
+
+Compared to previous approaches, the structure preserving loss allows the model to freely re-arrange the feature vectors in the embedding space as long as the discriminative structures are intact during this procedure. By maintaining both coarse and fine-grained structures, it effectively mitigates the forgetting of old classes while at the same time avoiding the optimization dilemma, thus providing a better stability-plasticity trade-off.
+
+The proposed structure preserving loss mainly focuses on old classes. We want to obtain good initial structures in the embedding space when learning new classes. Then the good structures can be explicitly maintained in future steps by the structure preserving loss. We adopt contrastive learning to achieve this. The losses are extended from [37,22], and we confirm that a modern contrastive loss with similar effects can also be used. $L_{comp}$ encourages the embedding vectors to be close to their prototypes, while $L_{mar}$ is to ensure enough distance between different classes. By doing this, a structure with compact distributions within classes and wide boundaries between classes can be obtained, which is less prone to catastrophic forgetting. The loss functions are formulated as follows, with $\mu$ a hyper-parameter and $\Delta$ a pre-defined distance.
+
+$$
+L _ {c o m p} (c) = \frac {1}{| \mathbf {y} ^ {*} = c |} \sum_ {\substack {\mathbf {e} _ {i} \in \mathbf {E} \\ i = c}} \| \mathbf {e} _ {i} ^ {t} - \mathbf {p} _ {c} ^ {t} \| _ {2}, \tag{9}
+$$
+
+$$
+L _ {m a r} = \sum_ {i} \sum_ {j} \max \{0, \Delta - \langle \bar {\mathbf {p}} _ {i}, \bar {\mathbf {p}} _ {j} \rangle \}, \quad i, j \in \mathcal {C} ^ {t}, \tag {10}
+$$
+
+$$
+L _ {\text {c o n t}} = L _ {\text {m a r}} + \mu \sum_ {c \in \mathcal {C} ^ {t}} L _ {\text {c o m p}} (c). \tag {11}
+$$
+
+# 4.3 Pseudo Label for Old Classes
+
+Training the model directly on given labels using cross-entropy loss will aggravate catastrophic forgetting because previous classes are labeled as background. A common practice is to adopt the pseudo label [27] technique to provide missing
+
+annotations for old classes. At step $t$ , we use the prediction of $M_{t-1}$ on the current training set $\mathcal{T}^t$ to label the background regions. The pseudo labels are then refined by only accepting pixels with certainty above a threshold. Considering that the model cannot learn each class equally well. If the same threshold is applied to all classes, the poorly-learned classes might be overly rejected and unnecessarily sacrifice the integrity of pseudo label. It's better to let each class has its own threshold. We use entropy (denoted as $u$ ) as certainty measurement. An entropy threshold $t_c$ is selected for each class to keep a fixed percentage of the raw pseudo label whose prediction entropy is below $t_c$ .
+
+$$
+y _ {i} ^ {\text {p s e u d o}} = \left\{ \begin{array}{l l} y _ {i} & \text {i f} y _ {i} \in \mathcal {C} ^ {t}, \\ \operatorname {a r g m a x} _ {c \in \mathcal {C} ^ {0: t - 1}} M _ {t - 1} (\mathbf {x}) & \text {e l i f} u < t _ {c}, \\ 0 & \text {o t h e r w i s e .} \end{array} \right. \tag {12}
+$$
+
+# 4.4 Loss Function
+
+Combining the losses introduced above, the overall loss is formulated as follows, with $\alpha, \beta, \gamma$ being hyper-parameters:
+
+$$
+L = L _ {c e} + \alpha L _ {a l i} + \beta L _ {s t r} + \gamma L _ {\text {c o n t}}. \tag {13}
+$$
+
+# 5 Experiments
+
+We compare the performance of our method against four strong CSS methods, including ILT[36], MiB[3], SDR[37], and PLOP[13]. All methods in comparison (including ours) do not use the replay strategy [39], where a small amount of previous data is stored and rehearsed. The theoretical performance is obtained by training the model in an offline manner with all data and labels (given as Upper Bound).
+
+# 5.1 Experiments Setup
+
+Datasets and Metrics. We evaluated our framework on Pascal-VOC 2012 [15] with 20 foreground classes and a background class, and ADE20K [49] with 150 foreground classes. We use mean Intersection over Union (mIoU) as the performance metric. After the whole training process, the performance on initial classes $\mathcal{C}^0$ is denoted as old. On classes learned in incremental steps $\mathcal{C}^{1:T}$ , it is denoted as new. And on all classes $\mathcal{C}^{0:T}$ , it is denoted as all.
+
+Incremental Protocols. Two different settings of CSS are described in [3] concerning different split methods for training set. Disjoint setting: at step $t$ , the given images contain pixels only belonging to either old classes or current classes $\mathcal{C}^{0:t-1} \cup \mathcal{C}^t$ . Overlapped setting: at step $t$ , images that contain at least one pixel belonging to the current classes $\mathcal{C}^t$ are provided. In both settings, Only labels
+
+for $\mathcal{C}^t$ is provided, and $\mathcal{C}^{0:t - 1}$ are labeled as background. The main difference is that, the background in disjoint setting contains only seen classes $\mathcal{C}^{0:t - 1}$ . While in overlapped setting, it might contain old and future classes $\mathcal{C}^{0:t - 1} \cup \mathcal{C}^{t + 1:T}$ . This is a more realistic setting for CSS because it is hard to guarantee that there will not be a demand to learn new concepts that were ignored previously. It is also more challenging due to severer semantic shifts.
+
+Training Procedure. For fair comparison, we follow most of the settings in previous works [3,13]. We adopt the Deeplabv3 [6] with an output stride of 16. ResNet-101 [19] serves as the backbone and is pretrained on ImageNet [11]. The model is optimized using SGD with momentum, with a learning rate of $7e - 3$ for the initial step and $7e - 4$ for the following steps. The learning rate is decreased according to the polynomial decay rule of power 0.9. The model is trained with a batch size of 16 for 30 epochs on VOC2012 and 60 epochs on ADE20K. The input image is cropped to $512 \times 512$ for both training and validation. The data augmentation for training consists of a random scaling with a factor from 0.5 to 2.0 and a random left-right flip.
+
+# 5.2 Evaluation on Pascal VOC2012
+
+We present the results on Pascal-VOC 2012 in this section. Following [3,37,13], we use three experiment setups: adding one class for a step (19-1), adding five classes for a step (15-5), and adding one class sequentially for five steps (15-1). The results of disjoint and overlapped are reported in Table 1 and Table 2. The results of ours are averaged over three runs to increase statistical significance.
+
+Single step addition of one class (19-1). In this setup, the model first learns 19 classes and then the last class is added. Directly fine-tuning the model always leads to the worst performance. ILT, which is the first method targeting CSS, struggles to learn the new class but still suffers from forgetting. The methods from MiB start to explicitly consider the background shift in CSS and all of them have steady improvements. Our method achieves the best overall performance in both disjoint and overlapped settings. We notice that despite of only a single class being added, this setting is actually difficult since the training set is rather small and monotonous.
+
+Table 1. Results of different methods on overlapped Pascal-VOC 2012. Best in bold.
+
+| Method | 19-1 (2 tasks) | 15-5 (2 tasks) | 15-1 (6 tasks) |
| old | new | all | old | new | all | old | new | all |
| Finetune | 34.7 | 14.9 | 33.8 | 12.5 | 36.9 | 18.3 | 4.9 | 3.2 | 4.5 |
| ILT[36] | 67.1 | 12.3 | 64.4 | 66.3 | 40.6 | 59.9 | 4.9 | 7.8 | 5.7 |
| MiB[3] | 70.2 | 22.1 | 67.8 | 75.5 | 49.4 | 69.0 | 46.2 | 12.9 | 37.9 |
| SDR[37] | 69.1 | 32.6 | 67.4 | 75.4 | 52.6 | 69.9 | 44.7 | 21.8 | 39.2 |
| PLOP[13] | 75.3 | 37.3 | 73.5 | 75.7 | 51.7 | 70.0 | 65.1 | 21.1 | 54.6 |
| Ours | 76.5 | 36.2 | 74.6 | 78.1 | 52.9 | 72.1 | 66.2 | 23.3 | 56.0 |
| Upper Bound | 77.6 | 76.7 | 77.5 | 79.0 | 72.8 | 77.5 | 79.0 | 72.8 | 77.5 |
+
+Table 2. Results of different methods on disjoint Pascal-VOC 2012. Best in bold.
+
+| Method | 19-1 (2 tasks) | 15-5 (2 tasks) | 15-1 (6 tasks) |
| old | new | all | old | new | all | old | new | all |
| Finetune | 35.2 | 13.2 | 34.2 | 8.4 | 33.5 | 14.4 | 5.8 | 4.9 | 5.6 |
| ILT[36] | 69.1 | 16.4 | 66.4 | 63.2 | 39.5 | 57.3 | 3.7 | 5.7 | 4.2 |
| MiB[3] | 69.6 | 25.6 | 67.4 | 71.8 | 43.3 | 64.7 | 35.1 | 13.5 | 29.7 |
| SDR[37] | 69.9 | 37.3 | 68.4 | 73.5 | 47.3 | 67.2 | 59.2 | 12.9 | 48.1 |
| PLOP[13] | 75.3 | 38.8 | 73.6 | 71.0 | 42.8 | 64.2 | 57.8 | 13.6 | 46.4 |
| Ours | 75.5 | 38.0 | 73.7 | 75.3 | 48.7 | 69.0 | 59.6 | 15.6 | 49.1 |
| Upper Bound | 77.6 | 76.7 | 77.5 | 79.0 | 72.8 | 77.5 | 79.0 | 72.8 | 77.5 |
+
+Single step addition of five classes (15-5). In this setup, the remaining 5 classes are added in a single step after learning the first 15 classes. It has the most severe semantic shift due to the most classes being added in one go. Such a setup requires the model to have enough plasticity to learn 5 classes in one go while being stable on old knowledge. In this scenario, our method outperforms all previous works by a large margin in both disjoint and overlapped settings. In the disjoint setting, our method improves by about $2\%$ compared to SDR and about $5\%$ compared to PLOP. In the overlapped setting, our method has another gain of about $2\%$ compared to the second place. What's more, our method boosts the performance of old classes to only $1\%$ lower than the upper bound, together with a notable gain in new class performance.
+
+Multi-step addition of five classes (15-1). This is similar to 15-5 except that the last 5 classes are added one by one, making it the most challenging because of multiple learning phases. As presented in Table 1 and Table 2, all methods suffer a great performance drop. ILT almost forgets all the knowledge. Even the second place, PLOP, has a significant drop compared to 15-5. Our method again achieves state-of-the-art performance on both the disjoint and overlapped setups, proving its ability under longer learning sequences.
+
+Visual results. We visualize the results of all methods on different setups to unveil more details. As shown in Fig. 3, our method consistently produces better segmentation results than all competitors. For example, in 19-1 our method successfully distinguishes all three classes while the competitors fail to recognize at least one class. The same situation can be observed in 15-5 and 15-1, in which our method generates a segmentation map closer to the ground truth and less confusion between classes is observed. We further provide a visualization of each step in 15-1 setup to present the knowledge shift across each step. As shown in Fig. 4, all the competitors suffer more or less from catastrophic forgetting. The change is especially great in step 5, in which most of the old classes are misclassified into the new class train learned in this step. But our method shows good robustness against forgetting, which presents constant segmentation results across each step.
+
+# 5.3 Evaluation on ADE20K
+
+In this section, we evaluate our method on the ADE20K dataset. Following [13,3], we adopt three setups on the overlapped protocol: adding the last 50 classes in
+
+
+Fig.3. Visual results of competing methods on different setups of overlapped VOC2012. Best viewed in color.
+
+
+Fig. 4. Visual results of competing methods on each step of 15-1 overlapped VOC2012. Best viewed in color.
+
+a single step (100-50), adding 50 classes each step (50-50), and adding 10 classes each step for the last 50 classes (100-10). ADE20K is much more complex than VOC2012, as we can only get $37.9\%$ mIoU under the offline training. We compare the same methods as in Section 5.2 except for SDR since it does not provide their results on ADE20K.
+
+The full results are presented in Table 3. ILT suffers from critical forgetting, while PLOP and MiB achieve much better results. Our method outperforms all previous methods in both 100-50 and 50-50 setups with an improvement of more than $2\%$ compared to PLOP. When diving into longer learning sequences, our method shows higher performance on old classes, and achieves comparable overall performance compared to PLOP. These experiments show the effectiveness of our method on a large-scale dataset.
+
+Table 3. Results of different methods on overlapped ADE20K in mIoU, best in bold
+
+| Method | 100-50 (2 tasks) | 50-50 (3 tasks) | 100-10 (6 tasks). |
| old | new | all | old | new | all | old | new | all |
| ILT[36] | 18.2 | 14.4 | 17.0 | 3.5 | 12.8 | 9.7 | 0.1 | 3.0 | 1.0 |
| MiB[3] | 40.5 | 17.1 | 32.7 | 45.5 | 21.0 | 29.3 | 38.2 | 11.1 | 29.2 |
| PLOP[13] | 41.8 | 14.8 | 32.9 | 48.8 | 20.9 | 30.4 | 40.4 | 13.6 | 31.5 |
| Ours | 42.9 | 19.9 | 35.2 | 49.8 | 23.9 | 32.5 | 41.0 | 12.5 | 31.5 |
| Upper Bound | 43.5 | 26.7 | 37.9 | 50.3 | 31.7 | 37.9 | 43.5 | 26.7 | 37.9 |
+
+# 5.4 Ablation Study
+
+We investigate the effects of key components in our framework using an ablation study on 15-1 overlapped VOC2012. Starting from the basic fine-tuning, we gradually add the proposed components upon it. The full results are shown in Table 4. It can be seen that the performance is boosted steadily as more components are added. Each module in our framework can bring benefits to both old and new classes. We conducted another experiment by removing a single component from the framework to better show their individual contribution to per
+
+formance. Among all the components, the structure preserving loss contributes the most to performance $(-4.7\%$ if removed), and the second is the projected feature alignment $(-2.1\%$ if removed). This well demonstrates the effectiveness of the two proposed techniques.
+
+Table 4. Performance contribution of each component on 15-1 overlapped VOC2012
+
+| Lce | pseudo | Lali | Lstr | Lcont | old | new | all |
| ✓ | | | | | 4.9 | 3.2 | 4.5 |
| ✓ | ✓ | | | | 23.5 | 6.6 | 19.5 |
| ✓ | ✓ | ✓ | | | 60.8 | 17.2 | 50.4 |
| ✓ | ✓ | ✓ | ✓ | | 65.3 | 21.2 | 54.8 |
| ✓ | ✓ | ✓ | ✓ | ✓ | 66.2 | 23.0 | 55.9 |
| ✓ | ✓ | | ✓ | ✓ | 63.7 | 22.0 | 53.8 |
| ✓ | ✓ | ✓ | | ✓ | 61.7 | 17.8 | 51.2 |
+
+# 5.5 Further Analysis
+
+Forgetting in Decoder Head. To give a straightforward view of the forgetting phenomenon in decoder head, we utilize Canonical Correlation Analysis [38] to measure the model output similarity between adjacent incremental steps. Results are shown in Fig. 5. The X-axis indicates different layers of the network. The Y-axis represents learning steps. Lower value on step 1 indicates more forgetting. (a) only performs probability distillation and results in the most forgetting. (b) adds constraints on intermediate features, which alleviates the forgetting of encoder, but a clear gap can be observed in decoder output $(0.943\rightarrow 0.765)$ . (c) further applies constraints on decoder as in our framework, which alleviates this forgetting and improves the overall performance.
+
+Effect of Structure Preserving Loss. To demonstrate the effects of the structure preserving loss against the widely used prototype alignment, we performed an experiment by replacing structure preserving loss with the prototype alignment used in [37]. We select five old classes (plane, bicycle, bird, boat, bottle) and use t-SNE [31] to visualize their distributions in embedding space after training on new classes. To erase the randomness in initial learning phase, we use the same checkpoint learned the first 15 classes to start from. Results are shown in Fig. 6. Our structure preserving loss better maintains the discriminative power (i.e., a clearer boundary) of old classes than prototype alignment.
+
+Effect of Projected Feature Alignment. We conducted an experiment on 15-1 overlapped VOC by adding different feature space constraints on a simple baseline, which is made of $L_{ce} +$ pseudo label. Results of all classes are shown in Table 5. Pixel-wise aligns the feature map directly in a pixel-wise manner. Pooled indicates the practice in [13]. Our proposed module successfully surpasses its contenders by a clear margin of $2.3\%$ .
+
+
+Fig. 5. Visualization of the forgetting phenomena in segmentation network.
+
+
+Fig. 6. Comparing the embedding space distribution results by prototype alignment and structure preserving loss.
+
+Table 5. Performance comparison of different feature space constraints
+
+| Baseline | Pixel-wise | Pooled[13] | Ours |
| 18.9 | 33.7 | 48.2 | 50.5 |
+
+# 6 Limitation and Conclusion
+
+Continual learning is often applied to situations where computational and space overhead are important. Our method, which is exemplar-free, does not require any extra storage. But we do admit that there's some extra computational cost of our method. It is mainly from two aspects: The first is from the training of projector $P$ , which takes roughly 10 minutes per incremental step. The second is from all the proposed modules, which makes the training about $10\%$ slower than fine-tuning. We think this is within an acceptable range for most situations.
+
+In this paper, we present a novel framework to deal with the forgetting in both encoder and decoder of segmentation network. In detail, the projected feature alignment module is designed to disentangle the preservation of old knowledge from integrating new knowledge. The structure preserving loss exploits inter-class and intra-class structures to maintain the discriminability of each class in the embedding space. Their effects are demonstrated by extensive experiments. Though our method managed to achieve a better stability-plasticity trade-off, the cause of large performance gap to the upper bound for new classes still remains to be explored in the future work.
+
+Acknowledge This work is supported by the National Natural Science Foundation of China under Grant No.62176246 and No.61836008
+
+# References
+
+1. Badrinarayanan, V., Kendall, A., Cipolla, R.: Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence 39(12), 2481-2495 (2017)
+2. Castro, F.M., Marín-Jiménez, M.J., Guil, N., Schmid, C., Alahari, K.: End-to-end incremental learning. In: ECCV (2018)
+3. Cermelli, F., Mancini, M., Bulo, S.R., Ricci, E., Caputo, B.: Modeling the background for incremental learning in semantic segmentation. In: ICCV (2020)
+4. Chaudhry, A., Gordo, A., Dokania, P.K., Torr, P., Lopez-Paz, D.: Using hindsight to anchor past knowledge in continual learning. In: AAAI (2021)
+5. Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K., Yuille, A.L.: Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence 40(4), 834-848 (2017)
+6. Chen, L.C., Papandreou, G., Schroff, F., Adam, H.: Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587 (2017)
+7. Chen, L.C., Zhu, Y., Papandreou, G., Schroff, F., Adam, H.: Encoder-decoder with atrous separable convolution for semantic image segmentation. In: ECCV (2018)
+8. Cong, Y., Zhao, M., Li, J., Wang, S., Carin, L.: Gan memory with no forgetting. In: NIPS (2020)
+9. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: CVPR (2016)
+0. De Lange, M., Tuytelaars, T.: Continual prototype evolution: Learning online from non-stationary data streams. In: ICCV (2021)
+1. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR (2009)
+2. Dhar, P., Singh, R.V., Peng, K.C., Wu, Z., Chellappa, R.: Learning without memorizing. In: CVPR (2019)
+3. Douillard, A., Chen, Y., Dapogny, A., Cord, M.: Plop: Learning without forgetting for continual semantic segmentation. In: CVPR (2021)
+4. Douillard, A., Cord, M., Ollion, C., Robert, T., Valle, E.: Podnet: Pooled outputs distillation for small-tasks incremental learning. In: ECCV (2020)
+5. Everingham, M., Winn, J.: The pascal visual object classes challenge 2012 (voc2012) development kit. Pattern Analysis, Statistical Modelling and Computational Learning, Tech. Rep (2011)
+6. French, R.M.: Catastrophic forgetting in connectionist networks. Trends in cognitive sciences 3(4), 128-135 (1999)
+7. Fu, J., Liu, J., Tian, H., Li, Y., Bao, Y., Fang, Z., Lu, H.: Dual attention network for scene segmentation. In: CVPR (2019)
+8. Hayes, T.L., Kafle, K., Shrestha, R., Acharya, M., Kanan, C.: Remind your neural network to prevent catastrophic forgetting. In: ECCV (2020)
+9. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016)
+20. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015)
+21. Hinton, G.E., Salakhutdinov, R.R.: Reducing the dimensionality of data with neural networks. science 313(5786), 504-507 (2006)
+
+22. Hou, S., Pan, X., Loy, C.C., Wang, Z., Lin, D.: Learning a unified classifier incrementally via rebalancing. In: ICCV (2019)
+23. Hu, H., Cui, J., Wang, L.: Region-aware contrastive learning for semantic segmentation. In: ICCV (2021)
+24. Huang, Z., Wang, X., Huang, L., Huang, C., Wei, Y., Liu, W.: Ccnet: Criss-cross attention for semantic segmentation. In: ICCV (2019)
+25. Iscen, A., Zhang, J., Lazebnik, S., Schmid, C.: Memory-efficient incremental learning through feature adaptation. In: ECCV (2020)
+26. Kirkpatrick, J., Pascanu, R., Rabinowitz, N., Veness, J., Desjardins, G., Rusu, A.A., Milan, K., Quan, J., Ramalho, T., Grabska-Barwinska, A., et al.: Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences 114(13), 3521-3526 (2017)
+27. Lee, D.H., et al.: Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In: Workshop on challenges in representation learning, ICML (2013)
+28. Li, X., Zhou, Y., Wu, T., Socher, R., Xiong, C.: Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. In: ICML (2019)
+29. Li, Z., Hoiem, D.: Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence 40(12), 2935-2947 (2017)
+30. Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. In: CVPR (2015)
+31. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008)
+32. Mallya, A., Davis, D., Lazebnik, S.: Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In: ECCV (2018)
+33. Mallya, A., Lazebnik, S.: Packnet: Adding multiple tasks to a single network by iterative pruning. In: CVPR (2018)
+34. Maltoni, D., Lomonaco, V.: Continuous learning in single-incremental-task scenarios. Neural Networks 116, 56-73 (2019)
+35. Mehta, S., Rastegari, M., Caspi, A., Shapiro, L., Hajishirzi, H.: Espnet: Efficient spatial pyramid of dilated convolutions for semantic segmentation. In: ECCV (2018)
+36. Michieli, U., Zanuttigh, P.: Incremental learning techniques for semantic segmentation. In: ICCVW (2019)
+37. Michieli, U., Zanuttigh, P.: Continual semantic segmentation via repulsion-attraction of sparse and disentangled latent representations. In: CVPR (2021)
+38. Raghu, M., Gilmer, J., Yosinski, J., Sohl-Dickstein, J.: Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. In: NIPS (2017)
+39. Rebuffi, S.A., Kolesnikov, A., Sperl, G., Lampert, C.H.: Incremental classifier and representation learning. In: CVPR (2017)
+40. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems 28, 91-99 (2015)
+41. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: International Conference on Medical image computing and computer-assisted intervention (2015)
+42. Shin, H., Lee, J.K., Kim, J., Kim, J.: Continual learning with deep generative replay. In: NIPS (2017)
+43. Xiang, Y., Fu, Y., Ji, P., Huang, H.: Incremental learning using conditional adversarial networks. In: ICCV (2019)
+
+44. Yan, S., Xie, J., He, X.: Der: Dynamically expandable representation for class incremental learning. In: CVPR (2021)
+45. Yoon, J., Yang, E., Lee, J., Hwang, S.J.: Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547 (2017)
+46. Zenke, F., Poole, B., Ganguli, S.: Continual learning through synaptic intelligence. In: ICML. pp. 3987-3995 (2017)
+47. Zhao, H., Shi, J., Qi, X., Wang, X., Jia, J.: Pyramid scene parsing network. In: CVPR (2017)
+48. Zhao, H., Zhang, Y., Liu, S., Shi, J., Loy, C.C., Lin, D., Jia, J.: Psanet: Point-wise spatial attention network for scene parsing. In: ECCV (2018)
+49. Zhou, B., Zhao, H., Puig, X., Fidler, S., Barriuso, A., Torralba, A.: Scene parsing through ade20k dataset. In: CVPR (2017)
\ No newline at end of file
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/images.zip b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4c1ae8de7a61efb15a3ddc3ec1f098000966b5e5
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:830c079903ff15d88204a3777dbbb9d4fc15e506da5a57d75056472d953ee12d
+size 339347
diff --git a/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/layout.json b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7f208379b03ddece11b5a2e822d4311839856a4a
--- /dev/null
+++ b/continualsemanticsegmentationviastructurepreservingandprojectedfeaturealignment/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:938b695fd8c4002c6eeed54a9562006f70a0d810b1362e2da76f8b3613e424e4
+size 418626
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_content_list.json b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a5c8f5eb0a1e2718afc8535d3005e0e2c3659933
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:701a87abb132c5fcd07f003c9ed97d126bb9ea34be9d9fb7506ab1ab5f1ded29
+size 100807
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_model.json b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0c4ef1d0a8e1603484557b705e36744e8ac8de00
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dad8b033060425c9a4ea66b9ca180c945fd6178fbbad9a27ceddb6f84675c817
+size 124668
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_origin.pdf b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..fe543b4b441a11874cf72683c5f3a4e1e3bdf41e
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/f9210406-7d3d-44a0-9808-15e6fbe7ff4c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c594267b8e1a8053ddece1bab4868cf93a1892047cc54f32dd72ec3e5376817c
+size 1812923
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/full.md b/continualvariationalautoencoderlearningviaonlinecooperativememorization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0be8998b08aabae8188a0aa8dd29dbae412f142d
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/full.md
@@ -0,0 +1,386 @@
+# Continual Variational Autoencoder Learning via Online Cooperative Memorization
+
+Fei Ye and Adrian G. Bors
+
+Department of Computer Science, University of York, York YO10 5GH, UK {fy689, adrian.bors} @york.ac.uk
+
+Abstract. Due to their inference, data representation and reconstruction properties, Variational Autoencoders (VAE) have been successfully used in continual learning classification tasks. However, their ability to generate images with specifications corresponding to the classes and databases learned during Continual Learning (CL) is not well understood and catastrophic forgetting remains a significant challenge. In this paper, we firstly analyze the forgetting behaviour of VAEs by developing a new theoretical framework that formulates CL as a dynamic optimal transport problem. This framework proves approximate bounds to the data likelihood without requiring the task information and explains how the prior knowledge is lost during the training process. We then propose a novel memory buffering approach, namely the Online Cooperative Memorization (OCM) framework, which consists of a Short-Term Memory (STM) that continually stores recent samples to provide future information for the model, and a Long-Term Memory (LTM) aiming to preserve a wide diversity of samples. The proposed OCM transfers certain samples from STM to LTM according to the information diversity selection criterion without requiring any supervised signals. The OCM framework is then combined with a dynamic VAE expansion mixture network for further enhancing its performance.
+
+Keywords: VAE, Continual learning, Lifelong generative modelling
+
+# 1 Introduction
+
+One desired capability for an artificial intelligence system is to continually learn novel concepts without forgetting the knowledge learnt in the past. However, existing artificial systems are far away from such capabilities, characteristic of living organisms. A deep learning model which can recover the training data from a low-dimensional latent code space is the Variational Autoencoder (VAE) [25]. VAEs have been widely used in image synthesis [60, 62], semi-supervised learning [1, 63] and for image-to-image translation [38]. However, similar to other deep learning systems, VAEs suffer from degenerated performance when it is trained successively with new tasks, which is a result of catastrophic forgetting [42].
+
+Existing works to relieve VAE's forgetting can be summarized as two categories. The first would usually train a generator [2, 44, 49], or store a few past
+
+learnt samples [39] in a memory buffer which replays old samples together with learning new tasks to optimize the model. The methods from the second category would focus on dynamically adding new VAE components into a mixture model to adapt to the data distribution shift [35, 45] in which prior knowledge is preserved in the frozen network parameters and structures. These approaches have been extended for the case when the model is trained on non-stationary data streams without knowing the task information, a mechanism called Task Free Continual Learning (TFCL) [4, 5]. However, the theoretical analysis for VAE's forgetting behaviour under TFCL has not been studied before.
+
+In recent years, some studies have provided the theoretical analysis for continual learning from different perspectives including the NP-hard problem [27], risk bound [58, 64], Teacher-Student framework [34, 57] and game theory [43]. However, all these approaches require strong assumptions such as clearly defining the task identities, which is not applicable when the task information is missing. In this paper, we bridge this gap by developing a new theoretical framework which formulates TFCL as a dynamic optimal transport (OT) problem, and derives the approximate bounds on the data likelihood. The motivation behind OT is twofold: 1) OT models evaluate distances between pairs of probability density functions [8] and can be used for deriving the approximate bound to the data likelihood (See Section 4); 2) OT can be estimated by employing sampling [18], which is suitable for analysis and verification. The proposed theoretical analysis also highlights that the sample diversity in the memory used for training is crucial for overcoming forgetting and would not require the category information.
+
+Another contribution of this study, inspired by the above mentioned theoretical analysis, is to develop a new memorization approach aiming to store diverse samples for training a VAE through the TFCL. Other approaches have proposed diversifying the information for memorization by evaluating the similarity on the gradient information [3] or by assigning balanced samples to memory buffers according to their categories' information [6, 13]. However, most of these prior approaches require to access supervised signals, which are not available in unsupervised learning. Additionally, these approaches do not have theoretical guarantees and also ignore the data stream future information in the sample selection. Knowing both the past and future information was shown to improve time series prediction [22] and would be helpful for the sample selection.
+
+In this paper, we address the aforementioned problems by : 1) Proposing a new learning paradigm called Online Cooperative Memorization (OCM) which consists of three components: a Long-Term Memory (LTM), a Short-Term Memory (STM) and a model (Learner). OCM implements a memorization mechanism which transfers the temporary information from the STM to LTM, according to a certain criterion. 2) A kernel-based information importance criterion for evaluating the similarity among the data stored in the STM for selecting diverse characteristic samples for LTM, without requiring a class label. The kernel evaluation of the similarity of a pair of data samples [15], defined as an inner product of the latent representations of each pair of the data stored in the memory, is shown to be efficient. This procedure ensures achieving an appropriate diversifi-
+
+cation among the samples stored in the LTM. We summarize our contributions as follows : 1) Our work is the first to provide theory insights for the forgetting behaviour of VAE under TFCL. 2) We propose the Online Cooperative Memorization (OCM) that can be used in any VAE variant with minimal modification and can also be extended to a dynamic expansion mixture approach to further enhance performance. 3) We propose a new sample selection approach for dynamically transferring selected samples from the STM to LTM without requiring any supervised signal. To our best knowledge, this is the first work to explore the kernel-based distance for the sample selection under TFCL. 4) The proposed sample selection approach can be used in both supervised and unsupervised learning without modifying the selection strategy.
+
+# 2 Related work
+
+Continual learning. One of the most popular approaches is to use a regularization loss within the optimization procedure [14, 21, 23, 26, 36, 41, 47, 52, 56], where the network parameters which are important to the past learnt data are re-weighted when learning a new task, in order to attempt to preserve past knowledge. Other approaches would employ a small buffer to store a few past data [3, 10, 53] or would train a generator as a generative replay network that provides pseudo data samples for the future task learning [2, 44, 45, 49, 57-59, 66, 69]. However, these approaches can not guarantee the optimal performance on the past task since stored or generated samples can not represent the true underlying data distributions [64]. This issue can be solved by storing the information of past samples into the network's parameters which are then frozen when learning novel tasks [35, 64, 65, 67, 68].
+
+Task free continual learning. Recent works have driven the attention to a more challenging scenario where task boundaries are unknown. Most approaches would focus on the sample selection approach that stores certain samples into a buffer to train the model. This approach was firstly investigated in [5] for training a classifier under TFCL and for training both classifiers and VAEs [4] using a new retrieving mechanism selecting called the Maximal Interfered Retrieval (MIR). The Gradient Sample Selection (GSS) [3] formulates the sample selection as a constrained optimization reduction. More recently, a Learner-Evaluator framework, called the Continual Prototype Evolution (CoPE) [13] stores the same number of samples for each class in the memory to enforce the balance replay. Different from these approaches, the proposed OCM does not require any supervised signals for the sample selection in both supervised and unsupervised learning.
+
+Another approach for TFCL is based on the dynamic expansion mechanism [35], called the Continual Neural Dirichlet Process Mixture (CN-DPM), which introduces Dirichlet processes for the expansion of VAE components. This expansion mechanism was combined with the generative replay into the Continual Unsupervised Representation Learning (CURL) [45], for learning the shared and task-specific representations, befitting on the clustering task.
+
+Optimal Transport (OT). The OT aims to search for a minimal effort solution to transfer the mass from one distribution to another. OT has been recently applied in the domain adaptation problems [12, 16] and was also used in auto-encoders to provide a flexible training loss for the VAE [54]. However, these models require to fully access all samples at all times, and are failing to capture the underlying data distributions under TFCL. In this paper, we formulate TFCL as the dynamic optimal transport problem which provides a new perspective for the forgetting behaviour of VAEs. To our best knowledge, this paper is the first work to employ OT for forgetting analysis under TFCL.
+
+# 3 Preliminary
+
+In this section, we firstly introduce the background of VAEs. Then we explain how TFCL can be seen as a dynamic optimal transport problem.
+
+# 3.1 The Variational Autoencoder
+
+The VAE [25] aims to jointly optimize the observed variable $\mathbf{x}$ and their corresponding encoded latent variables $\mathbf{z}$ within an unified optimization framework by maximizing the marginal log-likelihood $\log p_{\theta}(\mathbf{x}) = \int p_{\theta}(\mathbf{x}|\mathbf{z})p(\mathbf{z})\mathrm{d}\mathbf{z}$ . This integral involves the Normal prior distribution $p(\mathbf{z})$ , which is intractable to optimize since it requires access to all $\mathbf{z}$ . The VAE maximizes the Evidence Lower Bound (ELBO) on $\log p_{\theta}(\mathbf{x})$ , while the distribution $p_{\theta}(\mathbf{z}|\mathbf{x})$ is approximated by a variational distribution $q_{\omega}(\mathbf{z}|\mathbf{x})$ :
+
+$$
+\mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) := \mathbb {E} _ {z \sim q _ {\omega} (\mathbf {z} \mid \mathbf {x})} \left[ \log p _ {\theta} (\mathbf {x} \mid \mathbf {z}) \right] - K L \left[ q _ {\omega} (\mathbf {z} \mid \mathbf {x}) | | p (\mathbf {z}) \right], \tag {1}
+$$
+
+where $p_{\theta}(\mathbf{x}|\mathbf{z})$ is the decoder parameterized by $\theta$ and $\mathcal{L}_{ELBO}(\mathbf{x};\theta ,\omega)$ is a lower bound to $\log p_{\theta}(\mathbf{x})$ . $KL(\cdot)$ represents the Kullback-Leibler (KL) divergence. Eq. (1) can be further extended when considering multiple samples, as the Importance Weighted Autoencoder (IWVAE) [9]:
+
+$$
+\mathcal {L} _ {I W} ^ {m} (\mathbf {x}; \theta , \omega) := \mathbb {E} _ {z _ {1}, \dots , z _ {m} \sim q _ {\omega} (\mathbf {z} | \mathbf {x})} \left[ \log \frac {1}{m} \sum_ {i = 1} ^ {m} w _ {i} \right], \tag {2}
+$$
+
+where $w_{i} = p_{\theta}(\mathbf{x}, \mathbf{z}_{i}) / q_{\omega}(\mathbf{z}_{i} \mid \mathbf{x})$ and $m$ is the number of importance samples. Since we have $\mathcal{L}_{IW}^{m}(\mathbf{x}; \theta, \omega) > \mathcal{L}_{ELBO}(\mathbf{x}; \theta, \omega)$ for $m > 1$ [9], Eq. (2) can be used as the estimator for the data likelihood [50].
+
+# 3.2 Formulate TFCL as a dynamic OT problem
+
+Learning setting. Let $\mathcal{D}^S$ be a training set over the image space $\mathcal{X} \in \mathbb{R}^d$ with $d$ dimensions, we assume that there are $N$ training steps $\{t_1, \dots, t_N\}$ , for the part-by-part learning of $\mathcal{D}^S$ , defined as $\mathcal{D}^S = \bigcup_{i=1}^{t_N} \mathbf{X}_b^i$ , where $\mathbf{X}_b^i \cap \mathbf{X}_b^j = \emptyset$ for $i \neq j$ . In each training step $t_i$ , a model only observes a small batch of images $\mathbf{X}_b^i$ drawn from $\mathcal{D}^S$ , without accessing all the prior batches $\{\mathbf{X}_b^1, \dots, \mathbf{X}_b^{i-1}\}$ . Once all training steps are finished, we evaluate the model on a testing dataset $\mathcal{D}^T$ by
+
+using two main criteria (negative log-likelihood estimation and reconstruction quality). In the following, we introduce several definitions and notations.
+
+Definition 1. (Memory.) Let $\mathcal{M}_i$ represent a memory data buffer updated at the step $t_i$ and $\mathbb{P}_{m_i}$ represent the probabilistic representation of the samples drawn from $\mathcal{M}_i$ . Let $\mathbb{P}_{\mathbf{x}}$ represent the probabilistic measure defined by the samples drawn from $\mathcal{D}^S$ .
+
+Definition 2. (Model.) Let $h^i$ be a VAE model trained on $\mathcal{M}_i$ at $t_i$ . Let $\mathbb{P}_{\mathbf{z}}$ be a prior distribution (Normal distribution) on the latent variable space $\mathcal{Z}$ .
+
+Definition 3. (Decoder.) Let $\mathbf{G}_i \colon \mathcal{Z} \to \mathcal{X}$ be a generator (decoder in the $h^i$ model trained at $t_i$ ). $\mathbf{G}_i(\mathbf{z}) = p_\theta(\mathbf{x}|\mathbf{z})$ in $h^i$ is implemented as the Gaussian decoder $\mathcal{N}(\mathbf{G}_i^\star(\mathbf{z}), \sigma^2\mathbf{I}_d)$ , where $\mathbf{G}_i^\star$ is a deterministic generator, $\sigma > 0$ represents a small random variation for ensuring randomness, and $\mathbf{I}_d$ is the unit vector of dimension $d$ . Let $\mathbb{P}_{\mathbf{G}_i}$ represent the probabilistic measure formed by samples drawn through the sampling process, $\mathbf{x} \sim p_\theta(\mathbf{x}|\mathbf{z}), \mathbf{z} \sim \mathbb{P}_{\mathbf{z}}$ of $h^i$ .
+
+In the generative modelling, we usually consider two probabilistic measures $\mathbb{P}_{\mathbf{x}}$ and $\mathbb{P}_{\mathrm{G}_i}$ over two distinct spaces, denoted as $\varOmega_{\mathbf{x}}$ and $\varOmega_{\mathrm{G}_i}$ , respectively. Let $\mathbf{T} \colon \varOmega_{\mathrm{G}_i} \to \varOmega_{\mathbf{x}}$ be a transport map if satisfying $\mathbf{T} \# \mathbb{P}_{\mathrm{G}_i} = \mathbb{P}_{\mathbf{x}}$ that transforms $\mathbb{P}_{\mathrm{G}_i}$ into $\mathbb{P}_{\mathbf{x}}$ . For a given arbitrary measurable cost function $\mathcal{L}$ , the optimal transportation problem can be defined by Monge's formulation, expressed by:
+
+$$
+\mathbf {T} ^ {*} = \arg \min _ {\mathbf {T}} \int_ {\Omega_ {\mathrm {G} _ {i}}} \mathcal {L} (\mathbf {x}, \mathbf {T} (\mathbf {x})) \mathrm {d} \mathbb {P} _ {\mathrm {G} _ {i}} (\mathbf {x}), s. t. \mathbf {T} \# \mathbb {P} _ {\mathrm {G} _ {i}} = \mathbb {P} _ {\mathbf {x}}. \tag {3}
+$$
+
+According to the optimal transport theory [12], the above problem is solved by the Kantorovitch formulation [24]:
+
+$$
+\mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\mathbf {x}}, \mathbb {P} _ {\mathrm {G} _ {i}}\right) = \inf _ {\mathbb {P} _ {\mathbf {x} \times \mathrm {G} _ {i}}} \mathbb {E} _ {\left(\mathbf {x} ^ {r}, \mathbf {x} ^ {g}\right) \sim \mathbb {P} _ {\mathbf {x} \times \mathrm {G} _ {i}}} \left[ \mathcal {L} \left(\mathbf {x} ^ {r}, \mathbf {x} ^ {g}\right) \right], \tag {4}
+$$
+
+where $\mathbb{P}_{\mathbf{x} \times \mathrm{G}_i}$ represents the set of all probabilistic couplings on $\varOmega_{\mathbf{x}} \times \varOmega_{\mathrm{G}_i}$ with marginals $\mathbb{P}_{\mathbf{x}}$ and $\mathbb{P}_{\mathrm{G}_i}$ . $\mathbf{X}^r$ and $\mathbf{X}^g$ are the samples drawn from $\mathbb{P}_{\mathbf{x} \times \mathrm{G}_i}$ . Different from the traditional OT problem, $\mathrm{W}_{\mathcal{L}}(\mathbb{P}_{\mathbf{x}}, \mathbb{P}_{\mathrm{G}_i})$ would be changed over time (when $i$ increases) because the model is trained on the dynamically evolved memory $\mathcal{M}_i$ . We call Eq. (4) as the dynamic OT problem where the optimal solution is evolved each training time $t_i$ . Eq. (4) has an upper bound when $\mathrm{G}_i$ is the Gaussian decoder [8, 54]:
+
+$$
+\mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\mathbf {x}}, \mathbb {P} _ {\mathrm {G} _ {i}}\right) \leq \inf _ {q _ {\omega} (\mathbf {z})} \mathbb {E} _ {\mathbb {P} _ {\mathbf {x}}} \mathbb {E} _ {q _ {\omega} (\mathbf {z} | \mathbf {x})} [ \mathcal {L} (\mathbf {x}, \mathrm {G} _ {i} (\mathbf {z})) ], \tag {5}
+$$
+
+where $q_{\omega}(\mathbf{z})$ is the marginal distribution of $q_{\omega}(\mathbf{z}|\mathbf{x})$ satisfying $q_{\omega}(\mathbf{z}) = p(\mathbf{z})$ . We implement $\mathcal{L}(\mathbf{x},\mathrm{G}_i(\mathbf{z})) = \| \mathbf{x} - \mathrm{G}_i(\mathbf{z})\|^2$ as the squared Euclidean cost function in which $\mathrm{W}_{\mathcal{L}}(\cdot)$ is the squared 2-Wasserstein distance [8].
+
+# 4 Theoretical framework
+
+ELBO is an important indicator of the VAE's performance and is used as its main optimization function [11]. In the following, we provide a new perspective
+
+for analyzing the forgetfulness behaviour of VAEs during the continuous learning of several batches of data by formulating the ELBO's variation as a learning and forgetting process. The code and Supplemental Materials (SM) are available at https://github.com/dtuzi123/OVAE.
+
+# 4.1 Analysis of forgetting in a single model
+
+Firstly, we derive an upper bound to ELBO of the target domain $\mathbb{P}_{\mathbf{x}}$ , based on the dynamic OT problem (Eq. (5)).
+
+Theorem 1. For a VAE model $h^i$ trained at $t_i$ , where $p_{\theta}(\mathbf{x}|\mathbf{z}) = \mathcal{N}(G_i(\mathbf{z}),\sigma^2\mathbf{I}_d)$ is the Gaussian decoder and $\sigma = 1 / \sqrt{2}$ , we have:
+
+$$
+\inf _ {q _ {\omega} (\mathbf {z}) = p (\mathbf {z})} \mathbb {E} _ {\mathbb {P} _ {\mathbf {x}}} [ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) ] \leq - \frac {1}{2} \log \pi - \mathrm {W} _ {\mathcal {L}} ^ {\star} (\mathbb {P} _ {\mathbf {x}}, \mathbb {P} _ {\mathrm {G} _ {i}}), \tag {6}
+$$
+
+The detailed proof is provided in Appendix-A from Supplemental Materials (SM). Based on the results from Theorem 1, we derive a bound that explains the forgetting process of VAEs.
+
+Theorem 2. Let $\mathbb{P}_{m_i}$ and $\mathbb{P}_{\mathbf{x}}$ be the source and target domains. From Eq. (6), we derive the bound on the ELBO between $\mathbb{P}_{m_i}$ and $\mathbb{P}_{\mathbf{x}}$ at the training step $t_i$ :
+
+$$
+\begin{array}{l} \mathbb {E} _ {\mathbb {P} _ {\mathbf {x}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] \leq \mathbb {E} _ {\mathbb {P} _ {m _ {i}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] \\ + 2 \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {m _ {i}}, \mathbb {P} _ {\mathrm {G} _ {i}}\right) - \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\mathbf {x}}, \mathbb {P} _ {m _ {i}}\right) + \widetilde {\mathrm {F}} \left(\mathbb {P} _ {\mathrm {G} _ {i}}, \mathbb {P} _ {m _ {i}}\right), \tag {7} \\ \end{array}
+$$
+
+where $\widetilde{\mathrm{F}} (\mathbb{P}_{\mathbf{G}_i},\mathbb{P}_{m_i})$ is expressed as:
+
+$$
+\begin{array}{l} \widetilde {\mathbf {F}} \left(\mathbb {P} _ {\mathrm {G} _ {i}}, \mathbb {P} _ {m _ {i}}\right) = \mathbb {E} _ {\mathbb {P} _ {m _ {i}}} \left[ D _ {K L} \left(q _ {\omega} (\mathbf {z} \mid \mathbf {x}) \mid p (\mathbf {z})\right) \right] \\ + \left| \mathbb {E} _ {\mathbb {P} _ {m _ {i}}} \mathbb {E} _ {q _ {\omega} (\mathbf {z} | \mathbf {x})} [ - \mathcal {L} (\mathbf {x}, \mathbf {G} _ {i} (\mathbf {z})) ] - \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {m _ {i}}, \mathbb {P} _ {\mathrm {G} _ {i}}\right) \right|. \tag {8} \\ \end{array}
+$$
+
+Remark. The detailed proof is provided in Appendix-B from SM. We have several observations from Theorem 2:1) Improving the performance on the source domain (ELBO on $\mathbb{P}_{m_i}$ ) would not lead to increasing ELBO on the target domain $\mathbb{P}_{\mathbf{x}}$ because the right hand side (RHS) of Eq. (7) involves the negative term, $-\mathrm{W}_{\mathcal{L}}^{\star}(\mathbb{P}_{\mathbf{x}},\mathbb{P}_{m_i})$ . 2) Since RHS of Eq. (7) is upper bounded to ELBO on $\mathbb{P}_{\mathbf{x}}$ , a large $\mathrm{W}_{\mathcal{L}}^{\star}(\mathbb{P}_{\mathbf{x}},\mathbb{P}_{m_i})$ decreases RHS of Eq. (7) and therefore leads to the degenerated performance, measured by ELBO, on $\mathbb{P}_{\mathbf{x}}$ , corresponding to forgetting the knowledge at the training step $t_i$ . This is usually caused by the memory $\mathcal{M}_i$ that fails to capture all information of $\mathbb{P}_{\mathbf{x}}$ during the initial training process (when $i$ is small) or after the training ( $i = t_N$ ).
+
+The effect of the memory diversity. In practice, $\mathbb{P}_{\mathbf{x}}$ is divided into several separate distributions (target domains) $\{\mathbb{P}_{\mathbf{x}^1},\dots ,\mathbb{P}_{\mathbf{x}^n}\}$ where each $\mathbb{P}_{\mathbf{x}^j}$ is the characteristic distribution of a data category. Under this setting we analyze the forgetting behaviour in the class-incremental scenario.
+
+Lemma 1. Let $\{\mathbb{P}_{\mathbf{x}^1},\dots ,\mathbb{P}_{\mathbf{x}^n}\}$ and $\mathbb{P}_{m_i}$ be the target domains and source domain, respectively. The bound on ELBO between the source and target domain
+
+is derived as :
+
+$$
+\begin{array}{l} \sum_ {j = 1} ^ {n} \mathbb {E} _ {\mathbb {P} _ {\mathbf {x} ^ {j}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] \leq \sum_ {j = 1} ^ {n} \left\{2 \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {m _ {i}}, \mathbb {P} _ {\mathrm {G} _ {i}}\right) \right. \tag {9} \\ \left. + \mathbb {E} _ {\mathbb {P} _ {m _ {i}}} [ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) ] - \mathrm {W} _ {\mathcal {L}} ^ {\star} (\mathbb {P} _ {\mathbf {x} ^ {j}}, \mathbb {P} _ {m _ {i}}) \right\} + n \widetilde {\mathrm {F}} (\mathbb {P} _ {\mathrm {G} _ {i}}, \mathbb {P} _ {m _ {i}}). \\ \end{array}
+$$
+
+Proof. We sum up the bounds between $\mathbb{P}_{\mathbf{x}^j}$ and $\mathbb{P}_{m_i}$ , where $j = 1, \dots, n$ and prove Lemma 1.
+
+Remark. We have several observations from Lemma 1:1) To maximize ELBO on target domains $\{\mathbb{P}_{\mathbf{x}^1},\dots ,\mathbb{P}_{\mathbf{x}^n}\}$ , $\mathrm{W}_{\mathcal{L}}^{\star}(\mathbb{P}_{\mathbf{x}^j},\mathbb{P}_{m_i}), j = 1,\dots ,n$ must be minimized, corresponding to the diverse samples replayed from $\mathbb{P}_{m_i}$ . 2) We also provide new insights into the backward transfer [39] by using Eq. (9). When a memory $\mathcal{M}_i$ prefers to store samples from a few recent data distributions $\{\mathbb{P}_{\mathbf{x}^{n - 1}},\mathbb{P}_{\mathbf{x}^n}\}$ , the model would lead to negative backward transfer on past target domains $\{\mathbb{P}_{\mathbf{x}^1},\dots ,\mathbb{P}_{\mathbf{x}^{n - 2}}\}$ . Data diversity in memory can relieve this negative effect.
+
+# 4.2 Forgetting analysis of the expanding VAE mixture model
+
+In this section, we extend the forgetting analysis from a single VAE model to the Dynamic Expansion Model (DEM).
+
+Definition 4. Let $\mathbf{H} = \{h_1, \dots, h_k\}$ be a dynamic expansion model trained at $t_i$ , which has built $k$ components during the learning, where each $h_i$ is a VAE model. Let $\mathbf{q} = \{q_1, \dots, q_k\}$ represent the training steps that each component converged on. For instance, $h_i$ converged on $\mathcal{M}_{q_i}$ at $t_{q_i}$ , is not updated in the following training steps. Then $\mathbb{P}_{\mathrm{G}_{q_i}}$ and $\mathbb{P}_{m_{q_i}}$ represent the generator distribution and the distribution of samples drawn from $\mathcal{M}_{q_i}$ .
+
+Lemma 2. Let $\{\mathbb{P}_{\mathbf{x}^1},\dots ,\mathbb{P}_{\mathbf{x}^n}\}$ be a set of $n$ target domains. From Definition 4, the bound on the ELBO for the dynamic expansion model is derived as:
+
+$$
+\sum_ {j = 1} ^ {n} \mathbb {E} _ {\mathbb {P} _ {\mathbf {x} ^ {j}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] \leq \sum_ {i = 1} ^ {n} \mathrm {F} ^ {\star} \left(\mathbb {P} _ {\mathbf {x} ^ {i}}\right), \tag {10}
+$$
+
+where $\mathbf{F}^{\star}(\mathbb{P}_{\mathbf{x}^i})$ is the selection function, defined as:
+
+$$
+\begin{array}{l} \mathrm {F} ^ {\star} \left(\mathbb {P} _ {\mathbf {x} ^ {i}}\right) = \max _ {j = 1, \dots , k} \left\{\mathbb {E} _ {\mathbb {P} _ {m _ {q _ {j}}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] \right. \tag {11} \\ \left. + 2 \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {m _ {q _ {j}}}, \mathbb {P} _ {\mathrm {G} _ {q _ {j}}}\right) - \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\mathbf {x} ^ {i}}, \mathbb {P} _ {m _ {q _ {j}}}\right) + \widetilde {\mathrm {F}} \left(\mathbb {P} _ {\mathrm {G} _ {q _ {j}}}, \mathbb {P} _ {m _ {q _ {j}}}\right) \right\}. \\ \end{array}
+$$
+
+The proof is provided in Appendix-C from SM. To compare with a single model (Lemma 1), DEM would provide a maximum upper bound to the Left Hand Side (LHS) of Eq. (10) due to the selection process, Eq. (11). Additionally, DEM can relieve the negative backward transfer by preserving prior knowledge into the frozen components.
+
+# 4.3 Mixture expansion with the task information
+
+Although the proposed theoretical framework is only used for TFCL, it can be extended for the case where task labels are known. We also apply the proposed theoretical framework for analyzing the forgetting behaviour of existing approaches (See details in Appendix-F from SM).
+
+Definition 5. (Learning setting.) Let $\mathcal{T} = \{\mathcal{T}_1,\dots ,\mathcal{T}_c\}$ represent a set of task labels where $c$ is the number of tasks and we consider that each $i$ -th task is associated with a testing dataset $\mathcal{D}_i^T$ and a training dataset $\mathcal{D}_i^S$ . Let $\mathbb{P}_{\mathbf{x}^i}$ and $\mathbb{P}_{\hat{\mathbf{x}}^i}$ represent the empirical distributions for $\mathcal{D}_i^S$ and $\mathcal{D}_i^T$ , respectively. Since the task label is given, a mixture model starts to learn the first task and then either builds a new component or selects an existing component to learn a new task after the task switch. When a certain component is selected to learn a new task, the Generative Replay Mechanism (GRM) is used to relieve forgetting.
+
+Definition 6. (Generative replay.) Let $\mathbb{P}_{\widetilde{\mathbf{x}}}^j$ represent the distribution of samples drawn from the generating process of $h_j$ . Let $f_t \colon \mathcal{X} \to \mathcal{T}$ be the true labelling function that returns the task label for the data sample. If the $i$ -th task is trained by $h_j$ , let $\mathbb{P}_{\widetilde{\mathbf{x}}^{(i,m)}}$ be the distribution of samples drawn from the process $\mathbf{x} \sim \mathbb{P}_{\widetilde{\mathbf{x}}}^j$ if $f_t(\mathbf{x}) = i$ , where $m$ represents that $\mathbb{P}_{\widetilde{\mathbf{x}}^{(i,0)}}$ is evolved to $\mathbb{P}_{\widetilde{\mathbf{x}}^{(i,m)}}$ through $m$ generative replay processes [58]. Let $\mathbb{P}_{\widetilde{\mathbf{x}}^{(i,0)}}$ and $\mathbb{P}_{\widetilde{\mathbf{x}}^{(i,-1)}}$ represent $\mathbb{P}_{\mathbf{x}^i}$ and $\mathbb{P}_{\widehat{\mathbf{x}}^i}$ for simplicity.
+
+Theorem 3. Let $\mathcal{A} = \{a_1, \dots, a_n\}$ be a set where each $a_i$ represents the index of the component that has trained only once. Let $\widetilde{\mathcal{A}} = \{\widetilde{a}_1, \dots, \widetilde{a}_n\}$ be a set of task labels where each $\widetilde{a}_i$ represents the index of the task learned by the $a_i$ -th component. Let $\mathcal{B} = \{b_1, \dots, b_{k-n}\}$ be a set where each $b_i$ represents the index of the component that is trained more than once. Let $\widetilde{b}_i = \{\widetilde{b}_i^1, \dots, \widetilde{b}_i^m\}$ be a set of task labels for the $b_i$ -th component. Let $c_i^j$ represent the number of generative replay processes for the $\widetilde{b}_i^j$ -th task, achieved by the $b_i$ -th component. Let $\mathbb{P}_{\mathrm{G}^i}$ represent the generator distribution of the $i$ -th component. We derive the bound for a mixture model with $k$ components trained on $c$ tasks as:
+
+$$
+\sum_ {i = 1} ^ {| \mathcal {A} |} \left\{\mathbb {E} _ {\mathbb {P} _ {\tilde {\mathbf {x}} ^ {\tilde {a} _ {i}}} [ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) ]} \right\} + \sum_ {i = 1} ^ {| \mathcal {B} |} \left\{\sum_ {q = 1} ^ {| \tilde {b} _ {i} |} \left\{\mathbb {E} _ {\mathbb {P} _ {\tilde {\mathbf {x}} ^ {\tilde {p} _ {i}}}} [ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) ] \right\} \right\} \leq \mathcal {R} _ {S} + \mathcal {R} _ {M} \tag {12}
+$$
+
+where $|\cdot|$ denotes the cardinal of a set. $\mathcal{R}_S$ is estimated by components that are trained only once, defined as:
+
+$$
+\begin{array}{l} \mathcal {R} _ {S} = \sum_ {i = 1} ^ {| \mathcal {A} |} \left\{2 \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\mathbf {x} ^ {\tilde {a} _ {i}}}, \mathbb {P} _ {\mathrm {G} ^ {a _ {i}}}\right) + + \widetilde {\mathrm {F}} \left(\mathbb {P} _ {\mathrm {G} ^ {a _ {i}}} \mathbb {P} _ {\mathbf {x} ^ {\tilde {a} _ {i}}}\right) \right. \tag {13} \\ \left. + \mathbb {E} _ {\mathbb {P} _ {\mathbf {x} ^ {\widetilde {a}} _ {i}}} \left[ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) \right] - \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\widehat {\mathbf {x}} ^ {\widetilde {a}} _ {i}}, \mathbb {P} _ {\mathbf {x} ^ {\widetilde {a}} _ {i}}\right) \right\}. \\ \end{array}
+$$
+
+$\mathcal{R}_M$ is estimated by components that are trained on more than one task, as :
+
+$$
+\begin{array}{l} \mathcal {R} _ {M} = \sum_ {i = 1} ^ {| \mathcal {B} |} \left\{\sum_ {q = 1} ^ {| \widetilde {b} _ {i} |} \left\{\mathbb {E} _ {\widetilde {\mathbf {x}} ^ {(\widetilde {b} _ {i} ^ {q}, c _ {i} ^ {q})}} [ \mathcal {L} _ {E L B O} (\mathbf {x}; \theta , \omega) ] + \sum_ {s = 0} ^ {c _ {i} ^ {q}} \left\{2 \mathrm {W} _ {\mathcal {L}} ^ {\star} (\mathbb {P} _ {\widetilde {\mathbf {x}} ^ {(\widetilde {b} _ {i} ^ {q}, s)}, \mathbb {P} _ {\mathrm {G} ^ {b _ {i}}}) \right. \right. \right. \\ \left.\left. + \widetilde {\mathrm {F}} \left(\mathbb {P} _ {\mathbf {G} ^ {b _ {i}}}, \mathbb {P} _ {\widetilde {\mathbf {x}} \left(\widetilde {b} _ {i} ^ {q}, s\right)}\right) - \mathrm {W} _ {\mathcal {L}} ^ {\star} \left(\mathbb {P} _ {\widehat {\mathbf {x}} \left(\widetilde {b} _ {i} ^ {q}, s - 1\right)}, \mathbb {P} _ {\widetilde {\mathbf {x}} \left(\widetilde {b} _ {i} ^ {q}, s\right)}\right)\right\}\right\}\left. \right\}. \tag {14} \\ \end{array}
+$$
+
+Remark. The detailed proof is provided in Appendix-D from SM. Theorem 3 has the following observations: 1) If the number of components $k$ is equal to the number of tasks, then $\mathcal{R}_M = 0$ and there is no forgetting. When the number of
+
+components decreases, forgetting happens because the last term in the RHS of Eq. (14) is increased, leading to a decrease in the RHS of Eq. (12) (corresponding to the decrease of ELBO on all target domains). 2) If $k = 1$ , then $\mathcal{R}_S$ is about only the last task, then $\mathcal{R}_M$ is increased significantly since the accumulated errors $\sum_{s=0}^{c_i^q} \{\mathrm{W}_{\mathcal{L}}^*(\mathbb{P}_{\widetilde{\mathbf{x}}^{(\widetilde{b}_i^q,s-1)}}, \mathbb{P}_{\widetilde{\mathbf{x}}^{(\widetilde{b}_i^q,s)}})\}$ in Eq. (14) increases. Learning early tasks would lead to more forgetting than when learning the recent tasks for $k = 1$ because early tasks would have more accumulated errors ( $c_i^q$ in $\mathcal{R}_M$ is large as $i$ increases (See Appendix-D from SM)).
+
+# 5 Methodology
+
+Previous approaches have proposed to learn a diverse memory according to the category information. However, these approaches do not provide a theoretical guarantee for the accumulated memory's diversity. To our best knowledge, this paper is the first to provide a theoretical forgetting analysis and guarantees for existing TFCL models (See details in Appendix-F of SM). Additionally, the proposed theoretical framework demonstrates that the diversity of memory content can be achieved without knowing the category information (Lemma 1). Based on the conclusion of Lemma 1, we introduce a new memory approach which consists of three modules: LTM, STM and the Learner. The proposed approach does not require any task information or supervised signals for unsupervised learning. Firstly, we introduce the proposed OCM with the Learner implemented as a single VAE, and then we extend this into a dynamic expansion mechanism.
+
+# 5.1 Online Cooperative Memorization (OCM)
+
+Notations. Let $\mathcal{M}_i^l = \{\mathbf{x}_{i,j}^l\}_{j = 1}^{n_i^l}$ and $\mathcal{M}_i^e = \{\mathbf{x}_{i,u}^e\}_{u = 1}^{n_i^e}$ represent the samples stored in the LTM and STM, respectively, at the training step $t_i$ while $n_i^l$ and $n_i^e$ represent the number of samples. Let $\mathcal{M}_{Max}^e$ represent the maximum number of samples which can be stored in $\mathcal{M}_i^e$ .
+
+The training procedure, presented in Fig. 1, consists of three main stages, as described in the following.
+
+Stage 1: Learning. At the training step $t_i$ , STM stores a new batch of samples $\mathbf{X}_i^b$ into $\mathcal{M}_i^e$ , while the model, consisting of a single VAE, is trained to update both $\mathcal{M}_i^e$ and $\mathcal{M}_i^l$ using Eq. (1). Once the training is finished, we perform the next step.
+
+Stage 2: Evaluation. We perform this step if and only if $n_i^e \geq \mathcal{M}_{Max}^e$ in order to reduce the computational cost. The main goal of this stage is to evaluate the correlation between stored samples from STM and LTM. Firstly, we treat each stored sample as a node and introduce a graph relationship matrix $\mathbf{S}_i \in \mathbb{R}^{n_i^e \times n_i^l}$ , whose elements $\mathbf{S}_i(j,u)$ represent the correlation between two samples $\mathbf{x}_{i,j}^e$ and $\mathbf{x}_{i,u}^l$ , from STM and LTM respectively. Directly evaluating each $\mathbf{S}_i(j,u)$ in the high-dimensional data space is intractable since it would require overloaded computations [17] and auxiliary training [7, 37]. Since the model has been trained on
+
+
+Fig. 1. The training of OCM consists of three stages: (Learning.) STM continually stores recent samples while the model is trained to adapt both LTM and STM; If STM is full, we perform the evaluation and selection stages, otherwise, we continually perform the learning stage. (Evaluation.) We obtain the feature vectors $\{\mathbf{z}_{(i,1)}^e,\dots ,\mathbf{z}_{(i,n_i^l)}^l\}$ from inputs $\{\mathbf{x}_{(i,1)}^{e},\dots ,\mathbf{x}_{(i,n_{i}^{l})}^{l}\}$ by using a VAE encoder, which is used for the evaluation of the sample similarity using the kernel from Eq. (15). This similarity information is preserved in the graph relationship matrix $\mathbf{S}_i$ . (Selection.) We transfer the samples from STM to LTM using the proposed criterion Eq. (18) by means of $\mathbf{S}_i$ from (16).
+
+
+(a) Real testing samples.
+
+
+(b) VAE-ELBO-Random.
+Fig. 2. Image reconstruction compared to real images.
+
+
+(c) VAE-ELBO-OCM.
+
+both past samples from LTM and the current samples from STM, it can be used as a discriminator. We then evaluate the distance between two samples based on the perceptual feature space of the learned model by using the Radial Basis Function (RBF) kernel :
+
+$$
+\mathrm {K} (\mathbf {x} _ {i, j} ^ {e}, \mathbf {x} _ {i, u} ^ {l}) = \exp \left(- \frac {\left\| \mathbf {z} _ {i , j} ^ {e} - \mathbf {z} _ {i , u} ^ {l} \right\| ^ {2}}{2 \alpha^ {2}}\right), \tag {15}
+$$
+
+where $\mathbf{z}_{i,j}^{e}$ and $\mathbf{z}_{i,u}^{l}$ are feature vectors extracted from $\mathbf{x}_{i,j}^{e}$ and $\mathbf{x}_{i,u}^{l}$ using the feature extractor implemented by the output layer of the encoder $q_{\omega}(\mathbf{z}|\mathbf{x})$ of the VAE model, as illustrated in Fig. 1. $\mathbf{S}_i(j,u) = \mathrm{K}(\mathbf{x}_{i,j}^e,\mathbf{x}_{i,u}^l)$ and $\| \cdot \| ^2$ is the squared Euclidean distance. $\alpha$ is the scale hyperparameter for the kernel and we set $\alpha = 10$ to ensure that the output of $\mathrm{K}(\cdot ,\cdot)$ is within [0, 1]. Eq. (15) can be further accelerated by the matrix operation, expressed as:
+
+$$
+\mathbf {S} _ {i} = \mathrm {F} _ {\exp} \left(- \left(\mathbf {Z} _ {i} ^ {e} \left(- \mathbf {Z} _ {i} ^ {l}\right) ^ {\mathrm {T}}\right) \odot \left(\mathbf {Z} _ {i} ^ {e} \left(- \mathbf {Z} _ {i} ^ {l}\right) ^ {\mathrm {T}}\right) / 2 \alpha^ {2}\right), \tag {16}
+$$
+
+where $\mathbf{Z}_i^e\in \mathbb{R}^{n_i^e\times d_z}$ and $\mathbf{Z}_i^l\in \mathbb{R}^{n_i^l\times d_z}$ are the feature matrices corresponding to $\mathcal{M}_i^e$ and $\mathcal{M}_i^l$ , where each row is a feature vector of dimension $d_{z}$ . $(\cdot)^{\mathrm{T}}$ and $\odot$ are the transpose operation and Hadamard product, respectively. $\mathrm{F}_{exp}(\cdot)$ is the exponential function for each element in a matrix.
+
+Stage 3: Sample selection. This stage also requires satisfying $N_{i}^{e} \geq \mathcal{M}_{Max}^{e}$ to avoid excessive LTM growing. The main goal of this stage is to choose samples that are very different from those already stored in LTM. We achieve this by calculating the average similarity scores using kernels between each candidate
+
+Table 1. The estimation of log-likelihood on all testing samples by using the IWVAE bound with 1000 importance samples.
+
+| Methods | Split MNIST | Split Fashion | Split MNIST-Fashion |
| Log | Memory | N | Log | Memory | N | Log | Memory | N |
| VAE-ELBO-Random | -150.79 | 3.0K | 1 | -280.54 | 3.0K | 1 | -247.46 | 3.0K | 1 |
| LIMix [64] | -146.23 | 2.0K | 30 | -262.52 | 2.0K | 30 | -238.63 | 2.0K | 30 |
| CNDPM [35] | -120.71 | 2.0K | 30 | -257.56 | 2.0K | 30 | -236.79 | 2.0K | 30 |
| VAE-ELBO-OCM | -132.07 | 1.6K | 1 | -250.74 | 1.6K | 1 | -215.62 | 2.0K | 1 |
| VAE-IWVAE50-OCM | -127.11 | 1.6K | 1 | -247.90 | 1.6K | 1 | -224.34 | 2.0K | 1 |
| Dynamic-ELBO-OCM | -115.89 | 1.1K | 5 | -237.69 | 1.3K | 10 | -187.49 | 1.4K | 10 |
+
+sample $\mathbf{x}_{i,j}^{e}$ and each sample from LTM using $\mathbf{S}_i$ from Eq. (16):
+
+$$
+\mathrm {R} ^ {S} \left(\mathbf {x} _ {i, j} ^ {e}\right) = \frac {1}{n _ {i} ^ {l}} \sum_ {k = 1} ^ {n _ {i} ^ {l}} \mathbf {S} _ {i} (j, k). \tag {17}
+$$
+
+Eq. (17) refers to the distance between $\mathbf{x}_{i,j}^{e}$ and all samples contained in the LTM. In order to control the size of LTM, we introduce a threshold $\lambda$ for the sample selection:
+
+$$
+\mathrm {R} ^ {S} \left(\mathbf {x} _ {i, j} ^ {e}\right) > \lambda \Rightarrow \mathcal {M} _ {i} ^ {l} = \mathcal {M} _ {i} ^ {l} \cup \mathbf {x} _ {i, j} ^ {e}. \tag {18}
+$$
+
+The choice for $\lambda$ influences the diversity and memory size of LTM. Empirically, according to the ablation study in Appendix H.4 from SM, $\lambda \in [0.2, 0.5]$ can achieve the best performance resulting in a reasonable LTM size for most datasets. Once the selection is finished, $\mathcal{M}_i^e$ is cleared for storing novel samples during the next training step $t_{i+1}$ .
+
+Table 2. IS and FID scores under Split CIFAR10.
+
+| Methods | IS | FID | Memory | N |
| VAE-ELBO-Random | 3.84 | 116.26 | 1.0K | 1 |
| CNDPM [35] | 4.12 | 95.23 | 1.0K | 30 |
| LIMix [64] | 3.02 | 156.46 | 1.0K | 30 |
| VAE-ELBO-OCM | 4.13 | 98.76 | 0.5K | 1 |
| Dynamic-ELBO-OCM | 4.16 | 92.99 | 0.4K | 3 |
+
+Table 3. The estimation of log-likelihood on "Cross domain"
+
+| Methods | Log | Memory | N |
| VAE-ELBO-Random | -239.71 | 3.0K | 1 |
| LIMix [64] | -226.63 | 2.0K | 30 |
| CNDPM [35] | -218.15 | 2.0K | 30 |
| VAE-ELBO-OCM | -201.31 | 2.0K | 1 |
| VAE-IWVAE50-OCM | -204.35 | 2.0K | 1 |
| Dynamic-ELBO-OCM | -177.29 | 1.5K | 11 |
+
+# 5.2 Combining OCM with expansion mechanism
+
+According to Lemma 2 and Section 4.3, by dynamically expanding the model with new components would lead to better performance. Moreover, the extension mechanism reduces negative transfer when each component learns different underlying data distributions (see detailed analysis in Appendix-C of SM). This analysis inspires us to implement the extension mechanism from two aspects. First, we introduce an expansion criterion to detect the data distribution shift by comparing the loss value between the previously learned and newly seen samples, which ensures a suitable network architecture. Second, to encourage each component to learn different underlying data distributions, we clear STM and LTM when we dynamically add a new component to the mixture model.
+
+The newly added component can be an independent VAE or one that shares its parameters with existing components. In the following, we describe the latter setting. Let $\mathrm{f}_{\omega_s}^e:\mathcal{X}\to \mathcal{Z}'$ and $\mathrm{f}_{\omega_i}^e:\mathcal{Z}'\rightarrow \mathcal{Z}$ be the shared module and the component-specific module for the encoding process, where $i$ represents the component index and $\mathcal{Z}'$ is the feature space. Similar to the encoding process, we have two modules for the decoding process, $\mathrm{f}_{\theta_s}^d:\mathcal{Z}\rightarrow \mathcal{X}'$ and $\mathrm{f}_{\theta_i}^d:\mathcal{X}'\rightarrow \mathcal{X}$ , where $\mathcal{X}'$ is the feature space. The encoding and decoding processes for the $i$ -th component can be implemented by $q_{\theta_{s,i}}(\mathbf{z}|\mathbf{x}) = \mathrm{f}_{\omega_s}^e\odot \mathrm{f}_{\omega_i}^e (\mathbf{x})$ and $p_{\theta_{s,i}}(\mathbf{x}|\mathbf{z}) = \mathrm{f}_{\theta_s}^e\odot \mathrm{f}_{\theta_i}^e (\mathbf{z})$ , respectively, where $\mathrm{f}_{\omega_s}^e\odot \mathrm{f}_{\omega_i}^e:\mathcal{X}\rightarrow \mathcal{Z}'\rightarrow \mathcal{Z}$ is the encoding process. The optimization for the $i$ -th component corresponds to maximizing ELBO:
+
+$$
+\mathcal {L} _ {E L B O} ^ {i} (\mathbf {x}; \theta , \omega) := \mathbb {E} _ {q _ {\omega_ {s, i}} (\mathbf {z} \mid \mathbf {x})} \left[ \log p _ {\theta_ {s, i}} (\mathbf {x} \mid \mathbf {z}) \right] - K L \left[ q _ {\omega_ {s, i}} (\mathbf {z} \mid \mathbf {x}) | | p (\mathbf {z}) \right] \tag {19}
+$$
+
+where $\mathbf{z} \sim q_{\omega_{s,i}}(\mathbf{z}|\mathbf{x})$ and the shared modules are only updated by using Eq. (19) for $i > 1$ in order to avoid forgetting.
+
+Criterion for dynamic expansion. When a mixture model has multiple components, we evaluate the sample similarity from Eq. (15) by using an augmented feature extractor that concentrates features from each component. The training process for the new components from the dynamic expansion model is the same as the one described in Section 5.1 where we incorporate a criterion for the model expansion in Step 3: (Sample selection):
+
+$$
+\left| \mathrm {R} _ {i} - \mathrm {R} _ {\text {l a s t}} \right| > \lambda_ {2}, \mathrm {R} _ {i} = \frac {1}{N ^ {\prime}} \sum_ {j = 1} ^ {N ^ {\prime}} \left\{\frac {1}{K} \sum_ {c = 1} ^ {K} \left\{\mathcal {L} _ {E L B O} ^ {c} (\mathbf {x} _ {j}; \theta , \omega) \right\} \right\}, \tag {20}
+$$
+
+where $\mathbf{x}_j$ is the $j$ -th sample from the joint memory $\mathcal{M}_i^e \cup \mathcal{M}_i^l$ . $N' = n_i^e + n_i^l$ and $\mathrm{R}_i$ is the loss evaluated on all memorized samples using the mixture model at the training step $t_i$ . $\mathrm{R}_{last}$ is the most recent loss value. The pseudocode of the algorithm is provided in Appendix-H from SM.
+
+# 6 Experiments
+
+# 6.1 Experiment setting and datasets
+
+Datasets. For the Log-likelihood evaluation, we have the following settings: 1) Split MNIST/Fashion. Split MNIST [33] into ten parts according to the category information and create a data stream by collecting these parts in a class incremental way. This is also done for Fashion database; 2) Split MNIST-Fashion. Combine Split MNIST and Split Fashion into a data stream; 3) Cross-Domain. Combine Split MNIST-Fashion and unsorted samples from OMNIGLOT [31]. We adapt CIFAR10 [28] and Tiny/ImageNet [32] for the generative modelling task. Similar to Split MNIST, we divide CIFAR10 and Tiny/ImageNet into ten parts, namely Split CIFAR10 and Split Tiny/ImageNet, respectively. The details of dataset, hyperparameter and network architecture are provided in Appendix-H.1 of SM.
+
+Evaluation Criteria. We use the Inception Score (IS) [48] and Fréchet Inception Distance (FID) [19] for the evaluation of reconstruction quality. For the density estimation task, we estimate the real sample log-likelihood by using IWVAE bound [9], as in Eq. (2), considering 5000 importance samples.
+
+Baseline. We introduce several baselines used in experiments: 1) VAE-ELBO-OCM : We train a single VAE model with ELBO using the proposed OCM. 2) VAE-IWVAE50-OCM : We train a single VAE model with IWVAE using the proposed OCM where the number of importance samples is 50. 3) VAE-ELBO-Random : We train a single VAE model with a memory that randomly removes samples when it reaches the maximum memory size. 4) Dynamic-ELBO-OCM : We train a mixture model with ELBO using the proposed OCM. 5) CNDPM [35] : CNDPM uses Dirichlet process for the expansion of the mixture system; 6) LIMix [64] : We assign an episodic memory with a fixed buffer size for the LIMix model used for TFCL. The maximum number of components for various models is set to 30 to avoid memory overload.
+
+Table 4. The classification accuracy of five independent Table 5. IS and FID on Images runs for various models on three datasets. geNet database.
+
+| Methods | Split MNIST | Split CIFAR10 | Split CIFAR100 | Model | IS | FID |
| finetune* | 19.75 ± 0.05 | 18.55 ± 0.34 | 3.53 ± 0.04 | MVAE-Gau [61] | 6.84 | / |
| GEM* [39] | 93.25 ± 0.36 | 24.13 ± 2.46 | 11.12 ± 2.48 | MVAE-Gau fixed [61] | 6.30 | / |
| iCARL* [46] | 83.95 ± 0.21 | 37.32 ± 2.66 | 10.80 ± 0.37 | MVAE-GS [61] | 6.52 | / |
| reservoir* [55] | 92.16 ± 0.75 | 42.48 ± 3.04 | 19.57 ± 1.79 | MSVI [30] | 6.12 | / |
| MIR* [4] | 93.20 ± 0.36 | 42.80 ± 2.22 | 20.00 ± 0.57 | InfoVAE [70] | 6.14 | / |
| GSS* [3] | 92.47 ± 0.92 | 38.45 ± 1.41 | 13.10 ± 0.94 | β-VAE [20] | 5.05 | / |
| CoPE-CE* [13] | 91.77 ± 0.87 | 39.73 ± 2.26 | 18.33 ± 1.52 | VAE [25] | 5.46 | / |
| CoPE* [13] | 93.94 ± 0.20 | 48.92 ± 1.32 | 21.62 ± 0.69 | MAE [40] | 5.87 | / |
| CURL* [45] | 92.59 ± 0.66 | - | - | VAE-ELBO-Random | 3.15 | 145.36 |
| CNDPM* [35] | 93.23 ± 0.09 | 45.21 ± 0.18 | 20.10 ± 0.12 | | | |
| Dynamic-OCM | 94.02 ± 0.23 | 49.16 ± 1.52 | 21.79 ± 0.68 | VAE-ELBO-OCM | 3.36 | 133.23 |
+
+# 6.2 Log-likelihood evaluation
+
+In this section, we implement each VAE model or component by using the Bernoulli decoder. All datasets are binarized according to the setting from [9]. The results for Split MNIST, Split Fashion, Split MNIST-Fashion and Cross-domain are provided in Tables 1 and 3, where "Memory" represents the number of samples $N^l$ in LTM. The proposed OCM can improve the performance on the density estimation tasks even when using a small memory size compared to the random selection approach. Additionally, the expansion mechanism combined with the proposed OCM can further improve the performance with a reasonable memory use, especially when learning multiple datasets (Split MNIST-Fashion and Cross-Domain). We also find that the use of IWVAE bound (Eq. (2)) into the proposed OCM can also improve the performance on a single dataset. To compare with the expansion models, such as LIMix and CNDPM, a single model with OCM outperforms these models by using a few more stored samples such as 2.0K for LTM and 0.5K for STM vs 2.0K for LIMix and CNDPM, in Cross-Domain experiments. However, OCM with the expansion mechanism outperforms LIMix and CNDPM by using fewer mixture components.
+
+# 6.3 Evaluation of the reconstruction quality
+
+To evaluate the reconstruction quality, we use $\beta$ -VAE loss [20] where $\beta = 0.01$ for all models in order to avoid the over-regularization issue [51]. We report the
+
+IS and FID scores for the reconstruction quality in Table 2. We can observe that the proposed OCM with the expansion mechanism outperforms other baselines. The IS and FID for Tiny-ImageNet are reported in Appendix-H.3 from SM.
+
+We also explore training a single VAE with OCM for learning ImageNet [29] under TFCL where the batch size is 64. The maximum size for STM and LTM is set to 512 and 2048, respectively, to avoid increasing the computational cost. We follow the settings from [61], as described in Appendix-H.3 from SM, after resizing all images to $64 \times 64$ pixels. The FID and IS results are provided in Table 5 and the results of all baselines (training on a single dataset) are cited from [61]. The visual results are shown in Fig. 2 where we can observe that the reconstruction of VAE-ELBO-Random is blurred when compared with VAE-ELBO-OCM. These results show that the proposed OCM outperforms the random selection approach in the large-scale dataset under TFCL.
+
+# 6.4 Classification task
+
+The proposed approach is mainly used in unsupervised learning. We also show that OCM can be used in classification tasks when we train a classifier with OCM on the labelled dataset. We adapt the setting and network architecture from [13] with a batch size of 10 and the memory size for Split MNIST, Split CIFAR10 and Split CIFAR100 is limited to 2K, 1K and 5K, respectively. We report the results in Table 4 where $*$ means that the result is cited from [13]. The additional information about baselines and the proposed Dynamic-OCM is provided in Appendix-H.2 of SM. The number of required parameters is provided in Appendix-H.6 of SM. These results show that the proposed OCM outperforms the state-of-the-art methods in the classification task using fewer parameters.
+
+# 6.5 Ablation study and theoretical results
+
+A full ablation study is performed including testing the configuration for the threshold $\lambda$ from Eq (18), STM memory size, batch size and $\lambda_{2}$ from Eq. (20). We also provide the empirical results for the theoretical analysis. These ablation results and their analysis are provided in Appendix-H.4 from SM.
+
+# 7 Conclusion
+
+We introduce a new theoretical framework for providing insights into the forgetting behaviour of deep models based on VAEs under TFCL. The theoretical analysis demonstrates that ensuring a diversity of data in the pre-training memory is crucial for relieving forgetting in continuous learning systems. Inspired by this result, we propose the Online Cooperative Memorization (OCM) that does not require any supervised signals and therefore can be used in an unsupervised fashion. The empirical results demonstrate the effectiveness of the proposed OCM method.
+
+# References
+
+1. Abbasnejad, E., Dick, M., van der Hengel, A.: Infinite variational autoencoder for semi-supervised learning. In: Proc. of IEEE Conf. on Computer Vision and Pattern Recognition (CVPR). pp. 5888-5897 (2017)
+2. Achille, A., Eccles, T., Matthew, L., Burgess, C., Watters, N., Lerchner, A., Higgins, I.: Life-long disentangled representation learning with cross-domain latent homologies. In: Proc. Advances in Neural Inf. Proc. Systems (NeurIPS). pp. 9873-9883 (2018)
+3. Aljundi, R., Lin, M., Goujaud, B., Bengio, Y.: Gradient based sample selection for online continual learning. In: Advances Neural Information Processing Systems (NeurIPS). vol. 33, pp. 11817-11826 (2019)
+4. Aljundi, R., Belilovsky, E., Tuytelaars, T., Charlin, L., Caccia, M., Lin, M., Page-Caccia, L.: Online continual learning with maximal interfered retrieval. In: Advances in Neural Information Processing Systems (NeurIPS). vol. 33, pp. 11872-11883 (2019)
+5. Aljundi, R., Kelchtermans, K., Tuytelaars, T.: Task-free continual learning. In: Proc. of IEEE/CVF Conf. on Computer Vision and Pattern Recognition. pp. 11254-11263 (2019)
+6. Bang, J., Kim, H., Yoo, Y., Ha, J.W., Choi, J.: Rainbow memory: Continual learning with a memory of diverse samples. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8218-8227 (2021)
+7. Belghazi, M.I., Baratin, A., Rajeshwar, S., Ozair, S., Bengio, Y., Courville, A., Hjelm, D.: Mutual information neural estimation. In: Proc. Inter. Conference on Machine Learning (ICML), vol. PMLR 80. pp. 531-540 (2018)
+8. Bousquet, O., Gelly, S., Tolstikhin, I., Simon-Gabriel, C.J., Schoelkopf, B.: From optimal transport to generative modeling: the VEGAN cookbook. arXiv preprint arXiv:1705.07642 (2017)
+9. Burda, Y., Grosse, R., Salakhutdinov, R.: Importance weighted autoencoders. arXiv preprint arXiv:1509.00519 (2015)
+0. Chaudhry, A., Rohrbach, M., Elhoseiny, M., Ajanthan, T., Dokania, P., Torr, P.H.S., Ranzato, M.: On tiny episodic memories in continual learning. arXiv preprint arXiv:1902.10486 (2019)
+1. Chen, L., Dai, S., Pu, Y., Li, C., Su, Q., Carin, L.: Symmetric variational autoencoder and connections to adversarial learning. In: Proc. Int. Conf. on Artificial Intel. and Statistics (AISTATS) 2018, vol. PMLR 84. pp. 661-669 (2018)
+2. Courty, N., Flamary, R., Tuia, D., Rakotomamonjy, A.: Optimal transport for domain adaptation. IEEE Trans. on Pattern Analysis and Machine Intelligence 39(9), 1853-1865 (2016)
+3. De Lange, M., Tuytelaars, T.: Continual prototype evolution: Learning online from non-stationary data streams. In: Proc. of the IEEE/CVF Int. Conference on Computer Vision (ICCV). pp. 8250-8259 (2021)
+4. Egorov, E., Kuzina, A., Burnaev, E.: BooVAE: Boosting approach for continual learning of VAE. Advances in Neural Information Processing Systems (NeurIPS) 35, 17889-17901 (2021)
+5. Fang, P., Harandi, M., Petersson, L.: Kernel methods in hyperbolic spaces. In: Proc. of the IEEE/CVF Int. Conference on Computer Vision (ICCV). pp. 10665-10674 (2021)
+6. Fatras, K., Séjourne, T., Flamary, R., Courty, N.: Unbalanced minibatch optimal transport; applications to domain adaptation. In: Int. Conf. on Machine Learning (ICML), vol. PMLR 139. pp. 3186-3197 (2021)
+
+17. Goldberger, J., Gordon, S., Greenspan, H., et al.: An efficient image similarity measure based on approximations of kl-divergence between two gaussian mixtures. In: Proc. IEEE Int. Conf. on Computer Vision (ICCV). vol. 3, pp. 487-493 (2003)
+18. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: Proc. Advances in Neural Inf. Proc. Systems (NIPS). pp. 2672–2680 (2014)
+19. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local Nash equilibrium. In: Proc. Advances in Neural Information Processing Systems (NIPS). pp. 6626-6637 (2017)
+20. Higgins, I., Matthew, L., Pal, A., Burgess, C., Glorot, X., Botvinick, M., Mohamed, S., Lerchner, A.: $\beta$ -VAE: Learning basic visual concepts with a constrained variational framework. In: Proc. Int. Conf. on Learning Representations (ICLR) (2017)
+21. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. In: Proc. NIPS Deep Learning Workshop, arXiv preprint arXiv:1503.02531 (2014)
+22. Hua, Y., Zhao, Z., Li, R., Chen, X., Liu, Z., Zhang, H.: Deep learning with long short-term memory for time series prediction. IEEE Communications Magazine 57(6), 114-119 (2019)
+23. Jung, H., Ju, J., Jung, M., Kim, J.: Less-forgetting learning in deep neural networks. arXiv preprint arXiv:1607.00122 (2016)
+24. Kantorovitch, L.: On the translocation of masses. Management science 5(1), 1-4 (1958)
+25. Kingma, D.P., Welling, M.: Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114 (2013)
+26. Kirkpatrick, J., Pascanu, R., Rabinowitz, N., Veness, J., Desjardins, G., Rusu, A.A., Milan, K., Quan, J., Ramalho, T., Grabska-Barwinska, A., Hassabis, D., Clopath, C., Kumaran, D., Hadsell, R.: Overcoming catastrophic forgetting in neural networks. Proc. of the National Academy of Sciences (PNAS) 114(13), 3521-3526 (2017)
+27. Knoblauch, J., Husain, H., Diethe, T.: Optimal continual learning has perfect memory and is NP-hard. In: Proc. International Conference on Machine Learning (ICML), vol PMLR 119. pp. 5327-5337 (2020)
+28. Krizhevsky, A., Hinton, G.: Learning multiple layers of features from tiny images. Tech. rep. (2009)
+29. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. In: Advances in Neural Inf. Proc. Systems (NIPS). pp. 1097-1105 (2012)
+30. Kurle, R., Gunnemann, S., van der Smagt, P.: Multi-source neural variational inference. In: Proc. of AAAI Conf. on Artificial Intelligence. vol. 33, pp. 4114-4121 (2019)
+31. Lake, B.M., Salakhutdinov, R., Tenenbaum, J.B.: Human-level concept learning through probabilistic program induction. Science 350(6266), 1332-1338 (2015)
+32. Le, Y., Yang, X.: Tiny imagenet visual recognition challenge. CS 231N 7(7), 3 (2015)
+33. LeCun, Y., Bottou, L., Bengio, Y., Haffner, P.: Gradient-based learning applied to document recognition. Proc. of the IEEE 86(11), 2278-2324 (1998)
+34. Lee, S., Goldt, S., Saxe, A.: Continual learning in the teacher-student setup: Impact of task similarity. In: International Conference on Machine Learning (ICML), vol. PMLR 139. pp. 6109-6119 (2021)
+35. Lee, S., Ha, J., Zhang, D., Kim, G.: A neural Dirichlet process mixture model for task-free continual learning. In: Proc. Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:2001.00689 (2020)
+
+36. Li, Z., Hoiem, D.: Learning without forgetting. IEEE Trans. on Pattern Analysis and Machine Intelligence 40(12), 2935-2947 (2017)
+37. Liu, H., Gu, X., Samaras, D.: Wasserstein GAN with quadratic transport cost. In: Proc. of the IEEE/CVF Int. Conf. on Computer Vision (ICCV). pp. 4832-4841 (2019)
+38. Liu, M.Y., Breuel, T., Kautz, J.: Unsupervised image-to-image translation networks. In: Advances in Neural Information Processing Systems. pp. 700-708 (2017)
+39. Lopez-Paz, D., Ranzato, M.: Gradient episodic memory for continual learning. In: Advances in Neural Information Processing Systems. pp. 6467-6476 (2017)
+40. Ma, X., Zhou, C., Hovy, E.: MAE: Mutual posterior-divergence regularization for variational autoencoders. In: Proc. Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:1901.01498 (2019)
+41. Nguyen, C.V., Li, Y., Bui, T.D., Turner, R.E.: Variational continual learning. In: Proc. of Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:1710.10628 (2018)
+42. Parisi, G.I., Kemker, R., Part, J.L., Kanan, C., Wermter, S.: Continual lifelong learning with neural networks: A review. Neural Networks 113, 54-71 (2019)
+43. Raghavan, K., Balaprakash, P.: Formalizing the generalization-forgetting tradeoff in continual learning. Advances in Neural Information Processing Systems 34 (2021)
+44. Ramapuram, J., Gregorova, M., Kalousis, A.: Lifelong generative modeling. In: Proc. Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:1705.09847 (2017)
+45. Rao, D., Visin, F., Rusu, A.A., Teh, Y.W., Pascanu, R., Hadsell, R.: Continual unsupervised representation learning. In: Advances Neural Inf. Processing Systems (NeurIPS). pp. 7645-7655 (2019)
+46. Rebuffi, S.A., Kolesnikov, A., Sperl, G., Lampert, C.H.: iCaRL: Incremental classifier and representation learning. In: Proc. of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR). pp. 2001-2010 (2017)
+47. Ren, B., Wang, H., Li, J., Gao, H.: Life-long learning based on dynamic combination model. Applied Soft Computing 56, 398-404 (2017)
+48. Salimans, T., Goodfellow, I., Zaremba, W., Cheung, V., Radford, A., Chen, X.: Improved techniques for training GANs. In: Proc. Advances in Neural Inf. Proc. Systems (NIPS). pp. 2234-2242 (2016)
+49. Shin, H., Lee, J.K., Kim, J., Kim, J.: Continual learning with deep generative replay. In: Advances in Neural Inf. Proc. Systems (NIPS). pp. 2990-2999 (2017)
+50. Sobolev, A., Vetrov, D.: Importance weighted hierarchical variational inference. In: Advances in Neural Information Processing Systems (NeurIPS). vol. 33 (2019)
+51. Takahashi, H., Iwata, T., Yamanaka, Y., Yamada, M., Yagi, S.: Variational autoencoder with implicit optimal priors. In: Proc. of the AAAI Conference on Artificial Intelligence. vol. 33, pp. 5066-5073 (2019)
+52. Tang, S., Chen, D., Zhu, J., Yu, S., Ouyang, W.: Layerwise optimization by gradient decomposition for continual learning. In: Proc. of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 9634-9643 (2021)
+53. Titsias, M.K., Schwarz, J., Matthews, A.G.d.G., Pascanu, R., Teh, Y.W.: Functional regularisation for continual learning with Gaussian processes. In: Proc. Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:1901.11356 (2019)
+54. Tolstikhin, I., Bousquet, O., Gelly, S., Schoelkopf, B.: Wasserstein auto-encoders. In: Int. Conf. on Learning Representations (ICLR), arXiv preprint arXiv:1711.01558 (2018)
+
+55. Vitter, J.S.: Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS) 11(1), 37-57 (1985)
+56. Wang, S., Li, X., Sun, J., Xu, Z.: Training networks in null space of feature covariance for continual learning. In: Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR). pp. 184-193 (2021)
+57. Ye, F., Bors, A.: Lifelong teacher-student network learning. IEEE Trans. on Pattern Analysis and Machine Intelligence (2021). https://doi.org/10.1109/TPAMI.2021.3092677
+58. Ye, F., Bors, A.G.: Learning latent representations across multiple data domains using lifelong VAEGAN. In: Proc. European Conf. on Computer Vision (ECCV), vol. LNCS 12365. pp. 777-795 (2020)
+59. Ye, F., Bors, A.G.: Lifelong learning of interpretable image representations. In: Proc. Int. Conf. on Image Processing Theory, Tools and Applications (IPTA). pp. 1-6 (2020)
+60. Ye, F., Bors, A.G.: Mixtures of variational autoencoders. In: 2020 Tenth International Conference on Image Processing Theory, Tools and Applications (IPTA). pp. 1-6 (2020)
+61. Ye, F., Bors, A.G.: Deep mixture generative autoencoders. IEEE Transactions on Neural Networks and Learning Systems pp. 1-15 (2021). https://doi.org/10.1109/TNNLS.2021.3071401
+62. Ye, F., Bors, A.G.: Infovaegan: Learning joint interpretable representations by information maximization and maximum likelihood. In: Proc. IEEE Int. Conf. on Image Processing (ICIP). pp. 749-753 (2021). https://doi.org/10.1109/ICIP42928.2021.9506169
+63. Ye, F., Bors, A.G.: Learning joint latent representations based on information maximization. Information Sciences 567, 216-236 (2021)
+64. Ye, F., Bors, A.G.: Lifelong infinite mixture model based on knowledge-driven Dirichlet process. In: Proc. of the IEEE Int. Conf. on Computer Vision (ICCV) (2021)
+65. Ye, F., Bors, A.G.: Lifelong mixture of variational autoencoders. IEEE Transactions on Neural Networks and Learning Systems pp. 1-14 (2021). https://doi.org/10.1109/TNNLS.2021.3096457
+66. Ye, F., Bors, A.G.: Lifelong twin generative adversarial networks. In: Proc. IEEE Int. Conf. on Image Processing (ICIP). pp. 1289-1293 (2021)
+67. Ye, F., Bors, A.G.: Learning an evolved mixture model for task-free continual learning (2022)
+68. Ye, F., Bors, A.G.: Lifelong generative modelling using dynamic expansion graph model. In: AAAI on Artificial Intelligence. AAAI Press (2022)
+69. Zhai, M., Chen, L., Tung, F., He, J., Nawhal, M., Mori, G.: Lifelong GAN: Continual learning for conditional image generation. In: Proc. of the IEEE/CVF Int. Conf. on Computer Vision (ICCV). pp. 2759-2768 (2019)
+70. Zhao, S., Song, J., Ermon, S.: InfoVAE: Balancing learning and inference in variational autoencoders. In: Proc. AAAI Conf. on Artif. Intel. vol. 33, pp. 5885-5892 (2019)
\ No newline at end of file
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/images.zip b/continualvariationalautoencoderlearningviaonlinecooperativememorization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..dccd47daa647337515b12db65c6d28758fc38f45
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:35ddc379c317e3387ce33903f52786e84dd1300ec2cdc4c84ca515659cefacf1
+size 406010
diff --git a/continualvariationalautoencoderlearningviaonlinecooperativememorization/layout.json b/continualvariationalautoencoderlearningviaonlinecooperativememorization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..4f2229e738b2440fcae36d59d189078d33066d7a
--- /dev/null
+++ b/continualvariationalautoencoderlearningviaonlinecooperativememorization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e84523150fda5e933848f328518dd20d24772dad484a7bb97e412d9aaa1e73f5
+size 607953
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_content_list.json b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c1b5f0ae4e8118d31addb2808a1ada53ef540e51
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e034073dc1fa06a107c533a6ee2aa69343acf23a2d6b776046463ce548e14096
+size 79312
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_model.json b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2492aeb63eba9b4ed5cfe3a68f5e0fcba53293db
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab66f0e0676c9c0083cfaa48c36884e28b399240609153185024b57f0e2deb3f
+size 97338
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_origin.pdf b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..38aca3626ebe8c483b15ede18930f63bd36f47bf
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/6f12b6d8-2f99-4e59-9e32-283b718439b5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1707ddbaa107652c39e49af699cc3ae2e5b920b36a62239de69dbdaca74b31f4
+size 1530832
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/full.md b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1231a6d102f72d769074f719a6ebbedc0e9f305c
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/full.md
@@ -0,0 +1,328 @@
+# Contrasting quadratic assignments for set-based representation learning
+
+Artem Moskalev1, Ivan Sosnovik1, Volker Fischer2, and Arnold Smeulders1
+
+1 UvA-Bosch Delta Lab, University of Amsterdam {a.moskalev,i.sosnovik,a.w.m.smeulders}@uva.nl
+2 Bosch Center for AI (BCAI) volker.fischer@de.bosch.com
+
+Abstract. The standard approach to contrastive learning is to maximize the agreement between different views of the data. The views are ordered in pairs, such that they are either positive, encoding different views of the same object, or negative, corresponding to views of different objects. The supervisory signal comes from maximizing the total similarity over positive pairs, while the negative pairs are needed to avoid collapse. In this work, we note that the approach of considering individual pairs cannot account for both intra-set and inter-set similarities when the sets are formed from the views of the data. It thus limits the information content of the supervisory signal available to train representations. We propose to go beyond contrasting individual pairs of objects by focusing on contrasting objects as sets. For this, we use combinatorial quadratic assignment theory designed to evaluate set and graph similarities and derive set-contrastive objective as a regularizer for contrastive learning methods. We conduct experiments and demonstrate that our method improves learned representations for the tasks of metric learning and self-supervised classification.
+
+Keywords: contrastive learning, representation learning, self-supervised, optimal assignment
+
+# 1 Introduction
+
+The common approach to contrastive learning is to maximize the agreement between individual views of the data [33, 28]. The views are ordered in pairs, such that they either positive, encoding different views of the same object, or negative, corresponding to views of different objects. The pairs are compared against one another by a contrastive loss-objective [39, 44, 12]. Contrastive learning was successfully applied among others in metric learning [23], self-supervised classification [12, 21], and pre-training for dense prediction tasks [45]. However, when two views of an object are drastically different, the view of object A will resemble the same view of object B much more than it resembles the other view of object A. By comparing individual pairs, the common patterns in the differences
+
+
+(a) Contrasting pairs and contrasting sets
+
+
+(b) Comparing alignment costs
+Fig. 1. (a) Contrasting views by similarity over pairs (pairwise linear alignment) versus similarity over sets with set-alignment (set-wise quadratic alignment). (b) Comparing total pairwise similarities versus set similarities for different configurations of representation graphs. In both configurations, the total similarity over pairs remains the same, being unable to discriminate between the internal structures of different views as quadratic alignment can.
+
+between two views will not be exploited. In this paper, we propose to go beyond contrasting individual pairs of objects and focus on contrasting sets of objects.
+
+In contrastive learning, the best alignment of objects follows from maximizing the total similarity over positive pairs, while the negative pairs are needed to encourage diversity. The diversity in representations is there to avoid collapse [42]. We note that one number, the total similarity from contrasting individual pairs, cannot both account for the inter-set similarities of the objects from the same view and the intra-set similarities with objects from another view. Therefore, considering the total similarity over pairs essentially limits the information content of the supervisory signal available to the model. We aim to exploit the information from contrasting sets of objects rather than contrasting objects pairwise only, further illustrated in Figure 1a. From the perspective of set assignment theory [8], two sets may expose the same linear pairwise alignment costs, yet have different internal structures and hence have different set alignment costs, see Figure 1b. Therefore, contrastive learning from sets provides a richer supervisory signal.
+
+To contrast objects as sets, we turn to combinatorial quadratic assignment theory [8] designed to evaluate set and graph similarities. Quadratic assignment has advanced from linear assignment [9], which relies on pairwise similarities between objects. We pose contrastive learning by structural risk minimization [43] in assignment problems. In this, pairwise contrastive learning methods emerge from the linear assignment case. We aim to extend the contrastive objective to the set level by generalizing the underlying assignment problem from linear to quadratic, as illustrated in Figure 1a. Since directly computing set similarities from quadratic alignment is computationally expensive, we derive
+
+an efficient approximation. It can be implemented as a regularizer for existing contrastive learning methods. We provide a theory for the proposed method from the perspective of assignment problems and dependence maximization. And, we experimentally demonstrate the advantages of contrasting objects by quadratic alignment.
+
+We make the following contributions:
+
+- Using combinatorial assignment theory, we propose to learn representations by contrasting objects as sets rather than as pairs of individual instances.
+- We propose a computationally efficient implementation, where the set contrastive part is implemented as a regularizer for existing contrastive learning methods.
+- We demonstrate that set-contrastive regularization improves recent contrastive learning methods for the tasks of metric learning and self-supervised classification.
+
+As a byproduct of viewing representation learning through the lens of combinatorial assignment theory, we additionally propose SparseCLR contrastive loss, a modification of the popular InfoNCE [39] objective. Different from InfoNCE, SparseCLR enjoys sparse support over negative pairs, which permits better use of hard negative examples. Our experiments demonstrate that such an approach improves the quality of learned representations for self-supervised classification.
+
+# 2 Related work
+
+# 2.1 Contrastive learning
+
+In contrastive learning, a model is trained to align representations of the data from different views (modalities), which dates back to the work of Becker et al. [4]. Contrastive learning is made up of a joint embedding architecture like Siamese networks [7] and a contrastive objective function. The network maps different views of the data into the embedding space, where the alignment between embeddings is measured by contrasting positive and negative pairs. The pairs either from a complete set of observations [41, 12, 40, 13] or from partially-complete views [26, 47, 32, 46]. And as a contrastive objective, contrastive loss functions are used [39, 12, 21, 44]. Van den Oord et al. [39] derived the InfoNCE contrastive loss as a mutual information lower bound between different views of the signal. In computer vision, Chen et al. apply the InfoNCE to contrast the images with their distorted version. In PIRL [37], the authors propose to maintain a memory bank of image representations to improve the generalization of the model by sampling negative samples better. Along the same lines, MoCO [21, 14] proposes a running queue of negative samples and a momentum-encoder to increase the contrasting effect of negative pairs. All of these contrastive methods are based on measuring the alignment between individual pairs of objects. This approach does not account for patterns in the views of objects beyond contrasting them pairwise. We aim to extend contrastive learning to include set similarities.
+
+# 2.2 Information maximization methods
+
+In contrastive learning information maximization methods aim to improve contrastive representations by maximizing the information content of the embeddings [2]. In W-MSE [16], batch representations are passed through a whitening, Karhunen-Loève transformation before computing the contrastive loss. Such transformations help to avoid collapsing representations when the contrastive objective can be minimized without learning the discriminative representations. In [48], the authors follow the redundancy-reduction principle to design a loss function to bring the cross-correlation matrix of representations from different views close to identity. In the recent work of Zbontar et al., the authors extend the above formulation of Barlow Twins with an explicit variance term, which helps to stabilize the training. In this paper, we also seek to maximize the information content of the embeddings but we aim to do so by computing the rich representation of set similarities between data views. In contrast to existing methods, our approach does not require any additional transformations like whitening and can be easily incorporated into other contrastive learning methods.
+
+# 2.3 Distillation methods
+
+Another branch of self-supervised methods is not based on contrastive learning but rather based on knowledge distillation [24]. Instead of contrasting positive and negative pairs of samples, these methods try to predict one positive view from another. We discuss them here for completeness. BYOL [19] uses a student network that learns to predict the output of a teacher network. SimSiam [15] simplifies the BYOL by demonstrating that the stop-gradient operation suffices to learn a generalized representation from distillation. In SWaV [11], the authors combine online clustering and distillation by predicting swapped cluster assignments. These self-supervised methods have demonstrated promising results in the task of learning representations. We prefer to follow a different path of contrastive learning, where we do not exclude the possibility that set-based methods may also be applicable to distillation.
+
+# 2.4 Assignment theory
+
+Generally, optimal assignment problems can be categorized into linear and higher-order assignments. Linear assignment problems can be viewed as a transportation problem over a bipartite graph, where the transportation distances are defined on individual pairs of nodes. Linear assignment problems have many real-world applications such as scheduling or vehicle routing, we refer to [9]. Higher-order or in particular Quadratic assignment problems [17,8] extend the domain of the transportation distances from individual pairs to sets of objects. Where the linear assignment problem seeks to optimally match individual instances, its quadratic counterpart matches the inter-connected graphs of instances, bringing additional structure to the task. In this work, we aim to exploit linear and quadratic assignment theory to rethink contrastive learning.
+
+# 2.5 Structured predictions
+
+In a structured prediction problem, the goal is to learn a structured object such as a sequence, a tree, or a permutation matrix [1]. Training a structure is non-trivial as one has to compute the loss on the manifold defined by the structured output space. In the seminal work of Tsochantaridis et al. [43], the authors derive a structured loss for support vector machines and apply it to a sequence labeling task. Later, structured prediction was applied to learn parameters of constraint optimization problems [20, 6]. In this work, we utilize structured prediction principles to implement set similarities into contrastive losses.
+
+# 3 Background
+
+We start by formally introducing contrastive learning and linear assignment problems. Then, we argue about the connection between these two problems and demonstrate how one leads to another. This connection is essential for the derivation of our contrastive method.
+
+# 3.1 Contrastive representation learning
+
+Consider a dataset $\mathcal{D} = \{d_i\}_{i=1}^N$ and an encoder function $f_\theta : \mathcal{D} \longrightarrow \mathbb{R}^{N \times E}$ , which outputs an embedding vector of dimension $E$ for each of the objects in $\mathcal{D}$ . The task is to learn a such $f_\theta$ that embeddings of objects belonging to the same category are pulled together, while the embeddings of objects from different categories are pushed apart.
+
+As category labels are not available during training, the common strategy is to maximize the agreement between different views of the instances, i.e. to maximize the mutual information between different data modalities. The mutual information between two latent variables $X, Y$ , can be expressed as:
+
+$$
+M I (X, Y) = H (X) - H (X | Y) \tag {1}
+$$
+
+where $X$ and $Y$ correspond to representations of two different views of a dataset. Minimizing the conditional entropy $H(X|Y)$ aims at reducing uncertainty in the representations from one view given the representations of another, while $H(X)$ enforces the diversity in representations and prevents trivial solutions. In practice, sample-based estimators of the mutual information such as InfoNCE [39] or NT-Xent [12] are used to maximize the objective in (1).
+
+# 3.2 Linear assignment problem
+
+Given two input sets, $\mathcal{A} = \{a_i\}_{i=1}^N$ and $\mathcal{B} = \{b_j\}_{j=1}^N$ , we define the inter-set similarity matrix $\mathbf{S} \in \mathbb{R}^{N \times N}$ between each element in set $\mathcal{A}$ and each element in $\mathcal{B}$ . This similarity matrix encodes pairwise distances between the elements of the sets, i.e. $[\mathbf{S}]_{i,j} = \phi(a_i, b_j)$ , where $\phi$ is a distance metric. The goal of the linear
+
+assignment problem is to find a one-to-one assignment $\hat{y}(\mathbf{S})$ , such that the sum of distances between assigned elements is optimal. Formally:
+
+$$
+\hat {y} (\mathbf {S}) = \underset {\mathbf {Y} \in \Pi} {\operatorname {a r g m i n}} t r (\mathbf {S} \mathbf {Y} ^ {T}) \tag {2}
+$$
+
+where $\varPi$ corresponds to a set of all $N\times N$ permutation matrices.
+
+The linear assignment problem in (2) is also known as the bipartite graph matching problem. It can be efficiently solved by linear programming algorithms [5].
+
+# 3.3 Learning to produce correct assignments
+
+Consider two sets, $\mathcal{D}_{\mathcal{Z}_1}$ and $\mathcal{D}_{\mathcal{Z}_2}$ , which encode two different views of the dataset $\mathcal{D}$ under two different views $\mathcal{Z}_1$ and $\mathcal{Z}_2$ . By design, the two sets consist of the same instances, but the modalities and the order of the objects may differ. With the encoder, which maximizes the mutual information, objects in both sets can be uniquely associated with one another by comparing their representations as the uncertainty term in (1) should be minimized. In other words, $\hat{y}(\mathbf{S}) = \mathbf{Y}_{gt}$ , where $\mathbf{Y}_{gt} \in \varPi$ is a ground truth assignment between elements of $\mathcal{D}_{\mathcal{Z}_1}$ and $\mathcal{D}_{\mathcal{Z}_2}$ .
+
+Thus, a natural objective to supervise an encoder function is to train it to produce the correct assignment between the different views of the data. As the assignment emerges as a result of the optimization problem, we employ a structured prediction framework [43] to define a structural loss from the linear assignment problem as follows:
+
+$$
+L (\mathbf {S}, \mathbf {Y} _ {g t}) = t r (\mathbf {S} \mathbf {Y} _ {g t} ^ {T}) - \min _ {\mathbf {Y} \in \Pi} t r (\mathbf {S} \mathbf {Y} ^ {T}) \qquad (3)
+$$
+
+where $\mathbf{S} = \phi\big(f_{\theta}(\mathcal{D}_{\mathcal{Z}_1}),f_{\theta}(\mathcal{D}_{\mathcal{Z}_2})\big)$ . Note that $L\geq 0$ and $L = 0$ only when the similarities produced by an encoder lead to the correct optimal assignment. Intuitively, the structured linear3 assignment loss in (3) encodes the discrepancy between the true cost of the assignment and the cost induced by an encoder.
+
+By minimizing the objective in (3), we train the encoder $f_{\theta}$ to correctly assign objects from one view to another. In practice, it is desirable that such assignment is robust under small perturbations in the input data. The straightforward way to do so is to enforce a separation margin $m$ in the input similarities as $\mathbf{S}_m = \mathbf{S} + m\mathbf{Y}_{gt}$ . Then, the structured linear assignment loss with separation margin reduces to a known margin Triplet loss [23].
+
+Proposition 1 The structured linear assignment loss $L(S_{m}, \mathbf{Y}_{gt})$ with separation margin $m \geq 0$ is equivalent to the margin triplet loss.
+
+Mining strategies. By default, the loss in (3) enforces a one-to-one negative pair mining strategy due to the structural domain constraint $\mathbf{Y} \in \Pi$ . By relaxing this domain constraint to row-stochastic binary matrices, we arrive at the known batch-hard mining [23]. This is essential to have a computationally tractable implementation of structured assignment losses.
+
+Smoothness. An immediate issue when directly optimizing the structured linear assignment loss is the non-smoothness of the minimum function in (3). It is known that optimizing smoothed functions can be more efficient than directly optimizing their non-smooth counterparts [3]. The common way to smooth a minimum is by log-sum-exp approximation. Thus, we can obtain a smoothed version of structured linear assignment loss:
+
+$$
+L _ {\tau} (\mathbf {S}, \mathbf {Y} _ {g t}) = t r (\mathbf {S} \mathbf {Y} _ {g t} ^ {T}) + \tau \log \sum_ {\mathbf {Y} \in \Pi} \exp \left(- \frac {1}{\tau} t r (\mathbf {S} \mathbf {Y} ^ {T})\right) \tag {4}
+$$
+
+where $\tau$ is a temperature parameter controlling the degree of smoothness. Practically, the formulation in (4) requires summing $N!$ terms, which makes it computationally intractable under the default structural constraints $\mathbf{Y} \in \Pi$ . Fortunately, similar to the non-smooth case, we can utilize batch-hard mining, which leads to $O(N^2)$ computational complexity. The smoothed structured linear assignment loss with batch-hard mining reduces to known normalized-temperature cross entropy [12] also known as the InfoNCE [39] loss.
+
+Proposition 2 The smoothed structured linear assignment loss $L_{\tau}(\mathbf{S}, \mathbf{Y}_{gt})$ with batch-hard mining is equivalent to the normalized-temperature cross entropy loss.
+
+Connection to mutual information It is known that the InfoNCE objective is a lower bound on the mutual information between the representations of data modalities [39]. Thus, Propositions 1 and 2 reveal a connection between mutual information maximization and minimization of structured losses for assignmnet problems. In fact, the assignment cost $tr(\mathbf{S}\mathbf{Y}_{gt}^{T})$ in (2) is related to the conditional entropy $H(X|Y)$ , while $\min_{\mathbf{Y} \in \Pi} tr(\mathbf{S}\mathbf{Y}^{T})$ aims to maximize the diversity in representations. This connection allows for consideration of contrastive representation learning methods based on InfoNCE as a special case the structured linear assignment loss.
+
+# 4 Extending contrastive losses
+
+We next demonstrate how to exploit the connection between contrastive learning and assignment problems to extend contrastive losses the set level. As a byproduct of this connection, we also derive the SparseCLR contrastive objective.
+
+# 4.1 Contrastive learning with quadratic assignments on sets
+
+Quadratic assignment problem As in the linear case, we are given two input sets $\mathcal{A},\mathcal{B}$ and the inter-set similarity matrix $\mathbf{S}$ . For the Quadratic Assignment Problem (QAP), we define intra-set similarity matrices $\mathbf{S}_{\mathcal{A}}$ and $\mathbf{S}_{\mathcal{B}}$ measuring similarities within the sets $\mathcal{A}$ and $\mathcal{B}$ respectively, i.e. $[\mathbf{S}_{\mathcal{A}}]_{ij} = \phi (a_i,a_j)$ . A goal of the quadratic assignment problem is to find a one-to-one assignment $\hat{y}_{\mathcal{Q}}(\mathbf{S},\mathbf{S}_{\mathcal{A}},\mathbf{S}_{\mathcal{B}})\in \varPi$ that maximizes the set similarity between $\mathcal{A},\mathcal{B}$ , where the set similarity is defined as follows:
+
+$$
+\mathcal {Q} (\mathbf {S}, \mathbf {S} _ {\mathcal {A}}, \mathbf {S} _ {\mathcal {B}}) = \min _ {\mathbf {Y} \in \Pi} \left\{t r (\mathbf {S} \mathbf {Y} ^ {T}) + t r (\mathbf {S} _ {\mathcal {A}} \mathbf {Y} \mathbf {S} _ {\mathcal {B}} ^ {T} \mathbf {Y} ^ {T}) \right\} \tag {5}
+$$
+
+Compared to the linear assignment problem, the quadratic term $\mathcal{Q}(\mathbf{S},\mathbf{S}_{\mathcal{A}},\mathbf{S}_{\mathcal{B}})$ in (5) additionally measures the discrepancy in internal structures between sets $\mathbf{S}_{\mathcal{A}}$ and $\mathbf{S}_{\mathcal{B}}$ .
+
+Learning with quadratic assignments Following the similar steps as for the linear assignment problem in Section 3.3, we next define the structured quadratic assignment loss by extending the linear assignment problem in (3) with the quadratic term:
+
+$$
+L _ {Q A P} = t r (\mathbf {S} \mathbf {Y} _ {g t}) - \mathcal {Q} (\mathbf {S}, \mathbf {S} _ {\mathcal {A}}, \mathbf {S} _ {\mathcal {B}}) \tag {6}
+$$
+
+Minimization of the structured quadratic assignment loss in (6) encourages the encoder to learn representations resulting in the same solutions of the linear and quadratic assignment problems, which is only possible when the inter-set and intra-set similarities are sufficiently close [8]. Note that we do not use a ground truth quadratic assignment in $L_{QAP}$ , but a ground truth linear assignment objective is used for the supervision. This is due to a quadratic nature of $\mathcal{Q}$ , where minimizing the discrepancy between ground truth and predicted assignments is a subtle optimization objective, e.g. for an equidistant set of points the costs of all quadratic assignments are identical.
+
+To compute $L_{QAP}$ , we first need to evaluate the quadratic term $\mathcal{Q}(\mathbf{S},\mathbf{S}_A,\mathbf{S}_B)$ which requires solving the quadratic assignment. This problem is known to be notoriously hard to solve exactly even when an input dimensionality is moderate [8]. To alleviate this, we use a computationally tractable upper-bound:
+
+$$
+\begin{array}{l} L _ {O A P} \leq t r (\mathbf {S Y} _ {g t}) - \min t r (\mathbf {S Y} ^ {T}) - \min t r (\mathbf {S} _ {A} \mathbf {Y} \mathbf {S} _ {\kappa} ^ {T} \mathbf {Y} ^ {T}) \\ \mathbf {Y} \in \Pi , \quad \mathbf {Y} \in \Pi \tag {7} \\ \leq L (\mathbf {S}, \mathbf {Y} _ {g t}) - \langle \lambda_ {\mathcal {A}}, \lambda_ {\mathcal {B}} \rangle_ {-} \\ \end{array}
+$$
+
+where $\langle \lambda_A, \lambda_B \rangle_{-}$ corresponds to a minimum dot product between eigenvalues of matrices $S_A$ and $S_B$ .
+
+The first inequality is derived from Jensen's inequality for (6) and the second inequality holds due to the fact that $\langle \lambda_F, \lambda_D \rangle_{-} \leq tr(\mathbf{F}\mathbf{X}\mathbf{D}^T\mathbf{X}^T) \leq \langle \lambda_F, \lambda_D \rangle_{+}$ .
+
+Algorithm 1 Pseudocode for set-based InfoNCE with Euclidean distance similarity and Quadratic Assignment Regularization (QARe).
+```txt
+f: encoder network
+alpha: weighting for the pairwise contrastive part (linear assignment)
+beta: weighting for the set contrastive part
+N: batch size
+E: dimensionality of the embeddings
+for x in loader: # load a batch with N samples
+# two randomly augmented views of x
+y_a, y_b = augment(x)
+# compute embeddings
+z_a = f(y_a) # NxE
+z_b = f(y_b) # NxE
+# compute inter-set and intra-set similarities
+S_AB = similarity(z_a, z_b) # NxN
+S_A = similarity(z_a, z_a) # NxN
+S_B = similarity(z_b, z_b) # NxN
+# compute pairwise contrastive InfoNCE loss
+pairwise_term = infonce(S_AB)
+# compute eigenvalues
+eigs_a = eigenvalues(S_A) #N
+eigs_b = eigenvalues(S_B) #N
+# compute QAR e from minimum dot product of eigenvalues
+eigs_a Sorted = sort(eigs_a, descending = True) #N
+eigs_b Sorted = sort(eigs_b, descending = False) #N
+qare $=$ -1\* (eigs_a Sorted.T@eigs_bsorted)
+# combine pairwise contrastive loss with QAR e
+loss $=$ alpha\*pairwise_term + beta\*qare/(N^2)
+# optimization step
+loss.backup()
+optimizer-step()
+```
+
+for symmetric matrices $\mathbf{F},\mathbf{D}$ and $\mathbf{X}\in \varPi$ as shown in Theorem 5 by Burkard [8]. The above derivations are for the case when the similarity metric is a valid distance function, i.e. minimizing a distance leads to maximizing a similarity. The derivation for the reverse case can be done analogously by replacing min with max in the optimal assignment problem formulation (we provide more details in supplementary material).
+
+Optimizing the upper-bound in (7) is computationally tractable compared to optimizing the exact version of $L_{QAP}$ . Another advantage is that the upper-bound in (7) breaks down towards minimizing the sum of the structured linear assignment loss $L(\mathbf{S},\mathbf{Y}_{gt})$ and the regularizing term, which accounts for the set similarity. This allows to easily modify existing contrastive learning approaches like those in [12, 23, 36, 39] that are based on pairwise similarities and thus stem from the linear assignment problem by simply plugging in the regularizing term. We provide a simple pseudocode example demonstrating InfoNCE with the quadratic assignment regularization (Algorithm 1).
+
+Computational complexity Computing the upper-bound in (7) has a computational complexity of $O(N^3)$ as one needs to compute eigenvalues of the intra-set
+
+similarity matrices. This is opposed to (6) that requires directly computing quadratic assignments, for which it is known there exist no polynomial-time algorithms [8]. The computational complexity can be pushed further down to $O(k^2 N)$ by evaluating the only top-k eigenvalues instead of computing all eigenvalues. In supplementary materials, we also provide an empirical analysis of how the proposed approach influences a training time of a baseline contrastive method.
+
+# 4.2 SparseCLR
+
+In Section 3 we noted that the smoothness of a loss function is a desirable property for optimization and that the log-sum-exp smoothing of the structured linear assignment loss yields the normalized temperature cross-entropy objective as a special case. Such an approach, however, is known to have limitations. Specifically, the log-sum-exp smoothing yields dense support over samples, being unable to completely rule out irrelevant examples [38]. That can be statistically and computationally overwhelming and can distract the model from fully utilizing information from hard negative examples.
+
+We propose to use `sparsemax` instead of `log-sum-exp` approximation to alleviate the non-smoothness of the structured linear assignment objective, yet keep the sparse support of the loss function. Here `sparsemax` is defined as the minimum distance Euclidean projection to a k-dimensional simplex as in [38, 35].
+
+Let $\tilde{x} \in \mathbb{R}^{N!}$ be a vector that consists of the realizations of all possible assignment costs for the similarity matrix $\mathbf{S}$ . With this we can define SparseCLR as follows:
+
+$$
+L _ {\text {s p a r s e}} (\mathbf {S}, \mathbf {Y} _ {g t}) = \operatorname {t r} \left(\mathbf {S} \mathbf {Y} _ {g t} ^ {T}\right) - \frac {1}{2} \sum_ {j \in \Omega (\tilde {x})} \left(\tilde {x} _ {j} ^ {2} - \mathcal {T} ^ {2} (- \tilde {x})\right) \tag {8}
+$$
+
+where $\varOmega(X)=\{j\in X:\text{sparsemax}(X)_j>0\}$ is the support of sparsemax function, and $\mathcal{T}$ denotes the thresholding operator [35]. In practice, to avoid summing over a factorial number of terms, as well as for other methods, we use batch-hard mining strategy resulting in $O(N^2)$ computational complexity for SparseCLR.
+
+# 5 Experiments
+
+In this section, we evaluate the quality of representations trained with and without our Quadratic Assignment Regularization (QARe). We also evaluate the performance of SparseCLR and compare it with other contrastive losses. As we consider the representation learning from the perspective of the assignment theory, we firstly conduct the instance matching experiment, where the goal is to learn to predict the correct assignment between different views of the dataset. Then, we test the proposed method on the task of self-supervised classification and compare it with other contrastive learning approaches. Next, we present ablation studies to visualize the role of the weighting term, when combining QARe with the baseline contrastive learning method.
+
+| Method | Triplet | SparseCLR | InfoNCE | NTLogistic |
| pairwise | 54.85±0.77 | 53.03±0.43 | 57.87±1.19 | 40.30±0.42 |
| +QARe | 58.48±1.67 | 54.84±1.40 | 61.96±1.38 | 43.48±1.41 |
+
+Table 1. Matching accuracy for instances from different views of CUHK-03 dataset. The pairwise corresponds to the contrastive losses acting on the level of pairs. $+QAR e$ denotes methods with quadratic assignment regularization. Best results are in bold.
+
+# 5.1 Matching instances from different views
+
+In this experiment, the goal is to train representations of objects from different views, such that the learned representations provide a correct matching between identities in the dataset. This problem is closely related to a metric learning and can be solved by contrasting views of the data [23].
+
+Data We adopt the CUHK-03 dataset [31] designed for the ReID [23] task. CUHK-03 consists of 1467 different identities recorded each from front and back views. To train and test the models, we randomly divide the dataset into $70/15/15$ train/test/validation splits.
+
+Evaluation We evaluate the quality of representations learned with contrastive losses by computing the matching accuracy between front and back views. In practice, we first obtain the embeddings of the views of the instances from the encoder and then compute their inter-view similarity matrix using the Euclidean distance. Given this, the matching accuracy is defined as the mean Hamming distance between the optimal assignment from the inter-view similarity matrix and the ground truth assignment. We report the average matching accuracy and the standard deviation over 3 runs with the same fixed random seeds. As a baseline, we chose Triplet with batch-hard mining [23], InfoNCE [39] and NTLogistic [36] contrastive losses, which we extend with the proposed QARe.
+
+Implementation details As the encoder, we use ResNet-18 [22] with the top classification layer replaced by the linear projection head that outputs feature vectors of dimension 64. To obtain representations, we normalize the feature vectors to be L2 unit-norm.
+
+We train the models for 50 epochs using Adam optimizer [29] with the cosine annealing without restarts [34]. Initial learning rate is 0.01 and a batch size is set to 128. During the training, we apply random color jittering and horizontal flip augmentations. To compute the test matching accuracy, we select the best model over the epochs based on the validation split. We provide detailed hyperparameters of the losses, QARe weighting, and augmentations in the supplementary material.
+
+Results The results are reported in Table 1. As can be seen, adding QARe regularization to a baseline contrastive loss leads to a better matching accuracy,
+
+| Method | Conv-4 | ResNet-32 |
| CIFAR-10 | CIFAR-100 | tiny-ImageNet | CIFAR-10 | CIFAR-100 | tiny-ImageNet |
| Supervised (upper bound) | 80.46±0.39 | 49.29±0.85 | 36.47±0.36 | 90.87±0.41 | 65.32±0.22 | 50.09±0.32 |
| Random Weights (lower bound) | 32.92±1.88 | 10.79±0.59 | 6.19±0.13 | 27.47±0.83 | 7.65±0.44 | 3.24±0.43 |
| DeepCluster [10] | 42.88±0.21 | 21.03±1.56 | 12.60±1.23 | 43.31±0.62 | 20.44±0.80 | 11.64±0.21 |
| RotationNet [18] | 56.73±1.71 | 27.45±0.80 | 18.40±0.95 | 62.00±0.79 | 29.02±0.18 | 14.73±0.48 |
| Deep InfoMax [25] | 44.60±0.27 | 22.74±0.21 | 14.19±0.13 | 47.13±0.45 | 24.07±0.05 | 17.51±0.15 |
| SimCLR* [12] | 59.64±0.93 | 30.75±0.23 | 21.15±0.16 | 76.45±0.10 | 40.18±0.13 | 23.44±0.27 |
| SimCLR+QAR e (Ours) | 61.54±1.17 | 31.18±0.41 | 21.33±0.18 | 76.85±0.39 | 41.20±0.34 | 25.05±0.18 |
+
+Table 2. Self-supervised training and linear probing for a self-supervised classification. Average classification accuracy (percentage) and standard deviation over 3 runs with common fixed random seeds are reported. * we report the results from our implementation of SimCLR.
+
+which indicates an improved quality of representations. Notably, QARe delivers $3.6\%$ improvement when combined with Triplet loss and $4.1\%$ increase in accuracy with the InfoNCE objective. This demonstrates that the quadratic assignment regularization on sets helps the model to learn generalized representation space.
+
+# 5.2 Self-supervised classification
+
+Next, we evaluate the quadratic assignments on sets in the task of self-supervised classification. The goal in this experiment is to learn a representation space from an unlabeled data that provides a linear separation between classes in a dataset. This is a common problem to test contrastive learning methods.
+
+Evaluation We follow the standard linear probing protocol [30]. The evaluation is performed by retrieving embeddings from a contrastively trained backbone and fitting a linear classifier on top of the embeddings. Since linear classifiers have a low discriminative power on their own, they heavily rely on input representations. Thus, a higher classification accuracy indicates a better quality of learned representations. As the baseline for pairwise contrastive learning methods, we select popular SimCLR and proposed SparseCLR. We extend the methods to the set level by adding the quadratic assignment regularization. We compare the set-level contrastive methods with other self-supervised [10, 18] and contrastive approaches [12, 11].
+
+Implementation details We train shallow convolutional (Conv-4) and deep (ResNet-32) backbone encoders to obtain representations. We follow the standard approach and attach an MLP projection head that outputs feature vectors of dimension 64 to compute a contrastive loss. We use the cosine distance to get similarities between embeddings. We provide more details on the encoder architectures in the supplementary material.
+
+We train the models for 200 epochs using Adam optimizer with a learning rate of 0.001 and a batch size is set to 128. For contrastive learning methods, we adopt
+
+
+Fig. 2. Influence of the weighting of the QARe term in the self-supervised classification for ResNet-32 trained with SimCLR. The accuracy is recorded over 3 runs with common fixed random seeds.
+
+
+
+
+
+| Method | Conv-4 | ResNet-32 |
| CIFAR-10 | CIFAR-100 | tiny-ImageNet | CIFAR-10 | CIFAR-100 | tiny-ImageNet |
| SimCLR* [12] | 59.64±0.93 | 30.75±0.23 | 21.15±0.16 | 76.45±0.10 | 40.18±0.13 | 23.44±0.27 |
| SparseCLR (Ours) | 59.86±0.56 | 32.04±0.26 | 22.41±0.39 | 70.37±0.12 | 41.05±0.20 | 25.87±0.59 |
| SparseCLR+QAR e (Ours) | 61.06±0.39 | 33.05±0.32 | 22.45±0.30 | 71.39±0.30 | 42.07±0.35 | 27.03±0.40 |
+
+Table 3. Self-supervised training on unlabeled data and linear evaluation on labeled data. Comparing SimCLR [12] with the proposed SparseCLR and SparseCLR with QARe. Average accuracy and standard deviation over three runs over 3 runs with common fixed random seeds.
+
+a set of augmentations from [12] to form different views of the data. For linear probing, we freeze the encoder weights and train a logistic regression on top of the learned representation for 100 epochs with Adam optimizer, using a learning rate of 0.001 and a batch size of 128. We provide detailed hyperparameters of the contrastive losses and augmentations in the supplementary material.
+
+We perform training and testing on standard CIFAR-10, CIFAR-100, and tiny-ImageNet datasets. For each dataset, we follow the same training procedure and fine-tune the optimal weighting of the quadratic assignment regularizer.
+
+QARe results The results for the quadratic assignment regularization are reported in Table 2 for SimCLR and in Table 3 for proposed SparseCLR. For SimCLR, adding QARe delivers $1.9\%$ accuracy improvement on CIFAR-10 for the shallow encoder network and up to $1.6\%$ improvement for ResNet-32 on tinyImageNet. We observed a consistent improvement in other dataset-architecture setups, except tiny-ImageNet with shallow Conv-4 encoder, where the performance gain from adding QARe is modest. For this case, we investigated the training behavior of the models and observed that both SimCLR and SimCLR+QARe for Conv-4 architecture very quickly saturate to a saddle point, where the quality of representations stops improving. Since this does not happen with ResNet-32 architecture, we attribute this phenomenon to the limited discriminative power of the shallow Conv-4 backbone, which can not be extended by regularizing the loss.
+
+For SparseCLR, we observed the same overall pattern. As can be seen from Table 3, extending SparseCLR to set level with QARe delivers $1.6\%$ accuracy improvement for ResNet-32 on tiny/ImageNet and also steadily improve the performance on other datasets. This indicates that QARe helps to provide a richer supervisory signal for the model to train representations.
+
+SparseCLR results Next, we compare SimCLR against the proposed SparseCLR. As can be seen in Table 3, SparseCLR consistently improves over the baseline on CIFAR-100 and tiny-ImageNet datasets, where it delivers $2.4\%$ improvement. Surprisingly, we noticed a significant drop in performance for ResNet-32 on CIFAR-10. For this case, we investigated the training behavior of the model and observed that in the case of CIFAR-10, the batch often includes many false negative examples, which results in uninformative negative pairs. Since SparseCLR assigns the probability mass only to a few hardest negative pairs, a lot of false-negative examples in the batch impede obtaining a clear supervisory signal. We assume the problem can be alleviated by using false-negative cancellation techniques [27].
+
+# 5.3 Ablation study
+
+Here we illustrate how the weighting of the QARe term influences the quality of representations learned with SimCLR under a linear probing evaluation. We search for the optimal weighting in the range from 0 to 1.875 with a step of 0.125. The results are depicted in Figure 2. In practice, we observed that QARe is not too sensitive to a weighting and the values in the range 0.75-1.25 provide consistent improvement.
+
+# 6 Discussion
+
+In this work, we present set contrastive learning method based on quadratic assignments. Different from other contrastive learning approaches, our method works on the level of set similarities as opposed to only pairwise similarities, which allows improving the information content of the supervisory signal. For derivation, we view contrastive learning through the lens of combinatorial assignment theory. We show how pairwise contrastive methods emerge from learning to produce correct optimal assignments and then extend them to a set level by generalizing an underlying assignment problem, implemented as a regularization for existing methods. As a byproduct of viewing representation learning through the lens of assignment theory, we additionally propose SparceCLR contrastive loss.
+
+Our experiments in instance matching and self-supervised classification suggest that adding quadratic assignment regularization improves the quality of representations learned by backbone methods. We suppose, that our approach would be most useful in the problems where the joint analysis of objects and their groups appears naturally and labeling is not readily available.
+
+# References
+
+1. BakIr, G., Hofmann, T., Schölkopf, B., Smola, A.J., Taskar, B., Vishwanathan, S.: Predicting Structured Data. The MIT Press (2007)
+2. Bardes, A., Ponce, J., LeCun, Y.: Vicreg: Variance-invariance-covariance regularization for self-supervised learning. In: ICLR (2022)
+3. Beck, A., Teboulle, M.: Smoothing and first order methods: A unified framework. SIAM Journal on Optimization 22(2), 557-580 (2012)
+4. Becker, S., Hinton, G.E.: Self-organizing neural network that discovers surfaces in random-dot stereograms. Nature 355, 161–163 (1992)
+5. Bertsimas, D., Tsitsiklis, J.: Introduction to Linear Optimization. Athena Scientific (1998)
+6. Blondel, M., Martins, A., Niculae, V.: Learning classifiers with fenchel-young losses: Generalized entropies, margins, and algorithms. In: Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics. Proceedings of Machine Learning Research, vol. 89, pp. 606-615. PMLR (2019)
+7. Bromley, J., Guyon, I., LeCun, Y., Säckinger, E., Shah, R.: Signature verification using a "siamese" time delay neural network. In: Advances in Neural Information Processing Systems. vol. 6. Morgan-Kaufmann (1993)
+8. Burkard, R.E.: Quadratic Assignment Problems, pp. 2741-2814. Springer New York (2013)
+9. Burkard, R.E., Cela, E.: Linear assignment problems and extensions. In: Handbook of Combinatorial Optimization (1999)
+0. Caron, M., Bojanowski, P., Joulin, A., Douze, M.: Deep clustering for unsupervised learning of visual features. In: European Conference on Computer Vision (2018)
+1. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., Joulin, A.: Unsupervised learning of visual features by contrasting cluster assignments. In: Advances in Neural Information Processing Systems. vol. 33, pp. 9912-9924 (2020)
+2. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning, pp. 1597-1607 (2020)
+3. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.E.: Big self-supervised models are strong semi-supervised learners. Advances in neural information processing systems 33, 22243-22255 (2020)
+4. Chen, X., Fan, H., Girshick, R., He, K.: Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297 (2020)
+5. Chen, X., He, K.: Exploring simple siamese representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15750-15758 (2021)
+6. Ermolov, A., Siarohin, A., Sangineto, E., Sebe, N.: Whitening for self-supervised representation learning. In: International Conference on Machine Learning. pp. 3015-3024 (2021)
+7. Finke, G., Burkard, R.E., Rendl, F.: Quadratic assignment problems. In: Surveys in Combinatorial Optimization, North-Holland Mathematics Studies, vol. 132, pp. 61-82. North-Holland (1987)
+8. Gidaris, S., Singh, P., Komodakis, N.: Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728 (2018)
+9. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al.: Bootstrap your own latent-a new approach to self-supervised learning. Advances in neural information processing systems 33, 21271-21284 (2020)
+
+20. Hazan, T., Keshet, J., McAllester, D.: Direct loss minimization for structured prediction. In: Advances in Neural Information Processing Systems. vol. 23 (2010)
+21. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 9729-9738 (2020)
+22. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+23. Hermans, A., Beyer, L., Leibe, B.: In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737 (2017)
+24. Hinton, G., Vinyals, O., Dean, J., et al.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015)
+25. Hjelm, D., Fedorov, A., Lavoie-Marchildon, S., Grewal, K., Bachman, P., Trischler, A., Bengio, Y.: Learning deep representations by mutual information estimation and maximization. ICLR (2019)
+26. Huang, Z., Hu, P., Zhou, J.T., Lv, J., Peng, X.: Partially view-aligned clustering. Advances in Neural Information Processing Systems 33, 2892-2902 (2020)
+27. Huynh, T., Kornblith, S., Walter, M.R., Maire, M., Khademi, M.: Boosting contrastive self-supervised learning with false negative cancellation. Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV) (2022)
+28. Jaiswal, A., Babu, A.R., Zadeh, M.Z., Banerjee, D., Makedon, F.: A survey on contrastive self-supervised learning. Technologies 9(1) (2020)
+29. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+30. Kolesnikov, A., Zhai, X., Beyer, L.: Revisiting self-supervised visual representation learning. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (2019)
+31. Li, W., Zhao, R., Xiao, T., Wang, X.: Deepreid: Deep filter pairing neural network for person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 152–159 (2014)
+32. Lin, Y., Gou, Y., Liu, Z., Li, B., Lv, J., Peng, X.: Completer: Incomplete multi-view clustering via contrastive prediction. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2021)
+33. Linsker, R.: Self-organization in a perceptual network. IEEE Computer 21, 105-117 (03 1988). https://doi.org/10.1109/2.36
+34. Loshchilov, I., Hutter, F.: Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983 (2016)
+35. Martins, A.F.T., Astudillo, R.F.: From softmax to sparsemax: A sparse model of attention and multi-label classification. In: Proceedings of the 33rd International Conference on International Conference on Machine Learning (ICML) (2016)
+36. Mikolov, T., Chen, K., Corrado, G., Dean, J.: Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781 (2013)
+37. Misra, I., Maaten, L.v.d.: Self-supervised learning of pretext-invariant representations. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6707-6717 (2020)
+38. Niculae, V., Martins, A., Blondel, M., Cardie, C.: Sparsemap: Differentiable sparse structured inference. In: International Conference on Machine Learning (ICML). pp. 3799-3808 (2018)
+39. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018)
+
+40. Patacchiola, M., Storkey, A.: Self-supervised relational reasoning for representation learning. In: Advances in Neural Information Processing Systems (2020)
+41. Peng, X., Huang, Z., Lv, J., Zhu, H., Zhou, J.T.: Comic: Multi-view clustering without parameter selection. In: International Conference on Machine Learning (ICML) (2019)
+42. Tschannen, M., Djolonga, J., Rubenstein, P.K., Gelly, S., Lucic, M.: On mutual information maximization for representation learning. In: International Conference on Learning Representations (ICLR) (2020)
+43. Tsochantaridis, I., Joachims, T., Hofmann, T., Altun, Y.: Large margin methods for structured and interdependent output variables. Journal of Machine Learning Research 6(50), 1453-1484 (2005)
+44. Wang, T., Isola, P.: Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In: International Conference on Machine Learning (ICML) (2020)
+45. Wang, X., Zhang, R., Shen, C., Kong, T., Li, L.: Dense contrastive learning for self-supervised visual pre-training. In: Conference on Computer Vision and Pattern Recognition (CVPR) (2021)
+46. Yang, M., Li, Y., Hu, P., Bai, J., Lv, J.C., Peng, X.: Robust multi-view clustering with incomplete information. IEEE Transactions on Pattern Analysis and Machine Intelligence (2022)
+47. Yang, M., Li, Y., Huang, Z., Liu, Z., Hu, P., Peng, X.: Partially view-aligned representation learning with noise-robust contrastive loss. In: Conference on Computer Vision and Pattern Recognition (CVPR) (2021)
+48. Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised learning via redundancy reduction. In: International Conference on Machine Learning (ICML) (2021)
\ No newline at end of file
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/images.zip b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cc4a675f0dcffc843f6a85d291e8c00201b8ec0d
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59d819fff6cb6fe78fe9561273bc8d5fb3be189e5b8e31c25d4f5c06c722800d
+size 238667
diff --git a/contrastingquadraticassignmentsforsetbasedrepresentationlearning/layout.json b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..623ccdbe167423571d15ac1022053fe89d628e24
--- /dev/null
+++ b/contrastingquadraticassignmentsforsetbasedrepresentationlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e8f97bd6499eec75da081a93f7db07ffd86dc3821106558cea51d6eee7b331ac
+size 381693
diff --git a/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_content_list.json b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e547ed3a8e7610fb978eb692ce3760b0cfb00360
--- /dev/null
+++ b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:13918b6caa32552c18aa0362aabb984b077ece3ce562fd504b4271f8c951781d
+size 94317
diff --git a/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_model.json b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8591ba841530b46dcad3b23737b0dab6f745eab3
--- /dev/null
+++ b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f04d7b091e2ce0a8858f695bb14cf7fb79adad33d77ba8993accbc5f50402f8e
+size 120792
diff --git a/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_origin.pdf b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f9a07497230445615bbabd753a8b2b7d9beadcf7
--- /dev/null
+++ b/contrastivedeepsupervision/cdd7bdfc-b70e-4ccc-bd55-d2e3f1fb5975_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41970854c588eb8f845925c609ccf5d83ebff4643e5e94f236487a938e0567d3
+size 837178
diff --git a/contrastivedeepsupervision/full.md b/contrastivedeepsupervision/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a821cff103bab4fec473e9b4a38c0ee91fbc39fe
--- /dev/null
+++ b/contrastivedeepsupervision/full.md
@@ -0,0 +1,352 @@
+# Contrastive Deep Supervision
+
+Linfeng Zhang $^{1}$ , Xin Chen $^{2}$ , Junbo Zhang $^{1}$ , Runpei Dong $^{3}$ , Kaisheng Ma $^{1\star}$
+
+Tsinghua University1, Intel Corporation2, Xi'an Jiaotong University3
+
+Abstract. The success of deep learning is usually accompanied by the growth in neural network depth. However, the traditional training method only supervises the neural network at its last layer and propagates the supervision layer-by-layer, which leads to hardship in optimizing the intermediate layers. Recently, deep supervision has been proposed to add auxiliary classifiers to the intermediate layers of deep neural networks. By optimizing these auxiliary classifiers with the supervised task loss, the supervision can be applied to the shallow layers directly. However, deep supervision conflicts with the well-known observation that the shallow layers learn low-level features instead of task-biased high-level semantic features. To address this issue, this paper proposes a novel training framework named Contrastive Deep Supervision, which supervises the intermediate layers with augmentation-based contrastive learning. Experimental results on nine popular datasets with eleven models demonstrate its effects on general image classification, fine-grained image classification and object detection in supervised learning, semi-supervised learning and knowledge distillation. Codes have been released in Github.
+
+# 1 Introduction
+
+Along with the growth in large-scale datasets and computation resources, deep neural networks have become the most dominant models for various tasks [14,52]. However, the increasing depth of neural networks also introduces challenges in their training process. Traditional supervised training method only applies the supervision to the last layer and then propagates the error from the last layer to the shallow layers (Figure 1(a)), which leads to hardship in optimizing the intermediate layers such as gradient vanishing [29].
+
+Recently, deep supervision (a.k.a. deeply-supervised net) has been proposed to address this issue by optimizing the intermediate layers directly [38]. As shown in Figure 1(b), deep supervision adds several auxiliary classifiers to the intermediate layers in different depths. During the training phase, these classifiers are optimized with the original final classifier together by the same training loss (e.g. cross entropy for classification tasks). Both experimental and theoretical analyses have demonstrated its effectiveness in facilitating model convergence [62].
+
+However, success comes with remaining obstacles. In general, different layers in convolutional neural networks tend to learn features at different levels. Usually, the shallow layers learn low-level features such as colors and edges, while the
+
+
+(a) Traditional Supervised Learning
+
+
+(b) Contrastive Learning
+
+
+(c) Deep Supervision
+
+
+(d) Contrastive Deep Supervision(Ours)
+Fig. 1. The overview of the four methods. “ $\rightarrow$ ” and “ $\rightarrow$ ” indicate the path of forward computation and gradients backward computation. “proj” and “fc” indicate the projection heads and the fully connected classifiers, respectively. The gray dash line indicates whether the feature is task-irrelevant or task-biased. (a) Traditional supervised learning only applies supervision to the last layer and propagates it to the previous layers, leading to gradient vanishing. (c) Deep supervision trains both the last layer and the intermediate layers directly, which addresses gradient vanishing but makes all the layers be biased to the task. (d) Our method introduces contrastive learning to supervise the intermediate layer and thus avoid these problems.
+
+last several layers learn more high-level task-related semantic features such as categorical knowledge for classification tasks [82]. However, deep supervision forces the shallow layers to learn the task-related knowledge, which disobeys the original feature extraction process in neural networks. As pointed out in MSDNet [28], this conflict sometimes leads to accuracy degradation in the final classifier. This observation indicates that the supervised task loss is probably not the best supervision for optimizing the intermediate layers.
+
+In this paper, we argue that contrastive learning can provide better supervision for intermediate layers than the supervised task loss. Contrastive learning is one of the most popular and effective techniques in representation learning [7,8,34]. Usually, it regards two augmentations from the same image as a positive pair and different images as negative pairs. In the training period, the neural network is trained to minimize the distance of a positive pair while maximizing the distance of a negative pair. As a result, the network can learn the invariance to various data augmentation, such as Color Jitter and Random Gray Scale. Considering that these data augmentation invariances are usually low-level, task-irrelevant and transferable to various vision tasks [3,64], we argue that they are more beneficial knowledge to be learned by intermediate layers.
+
+Motivated by these observations, we propose a novel training framework named Contrastive Deep Supervision. It optimizes the intermediate layers with
+
+contrastive learning instead of traditional supervised learning. As shown in Figure 1(d), several projection heads are attached in the intermediate layers of the neural networks and trained to perform contrastive learning. These projection heads can be discarded in the inference period to avoid additional computation and storage. Different from deep supervision which trains the intermediate layers to learn the knowledge for a specific task, the intermediate layers in our method are trained to learn the invariance to data augmentation, which makes the neural network generalize better. Besides, since contrastive learning can be performed on unlabeled data, the proposed contrastive deep supervision can also be easily extended in the semi-supervised learning paradigm.
+
+Moreover, contrastive deep supervision can be further utilized to boost the performance of another deep learning technique - knowledge distillation. Knowledge distillation (KD) is a popular model compression approach which aims to transfer the knowledge from a cumbersome teacher model to a lightweight student model [2,23,15]. Recently, abundant research finds that distilling the "crucial knowledge" inside the backbone features such as attention and relation [72,49,58] leads to better performance than directly distilling all the backbone features. In this paper, we show that the data augmentation invariances learned by the intermediate layers in contrastive deep supervision are more beneficial knowledge to be distilled. By combining contrastive deep supervision with the naive feature distillation, the distilled ResNet18 achieves $73.23\%$ accuracy on ImageNet, which outperforms the baseline and the second-best KD method by $4.02\%$ and $2.16\%$ , respectively.
+
+Extensive experiments on nine datasets with eleven neural networks methods have been conducted to evaluate its effectiveness on general image classification, fine-grained image classification, object detection in supervised learning, semi-supervised learning and knowledge distillation, which demonstrates that contrastive deep supervision enables neural networks to learn better visual representation. In the discussion section, we further explain the effectiveness of our method from the perspective of regularization methods, which prevents models from overfitting and leads to better uncertainty estimation. To sum up, the main contributions of our paper can be summarized as follows.
+
+- We propose contrastive deep supervision, a neural network training method in which the intermediate layers are directly optimized with contrastive learning. It enables neural networks to learn better visual representation at no expense of additional parameters and computation during inference.
+- From the perspective of deep supervision, this paper firstly shows that the intermediate layers can be trained with supervision besides the task loss.
+- From the perspective of representation learning, we firstly show that contrastive learning and supervised learning can be combined in a one-stage deep-supervision manner instead of the two-stage "pretrain-finetune" scheme
+- Extensive experiments on nine datasets, eleven neural networks with eleven comparison methods demonstrate the effectiveness of our method on general classification, fine-grained classification and object detection in supervised learning, semi-supervised learning and knowledge distillation.
+
+# 2 Related Work
+
+# 2.1 Deep Supervision
+
+Deep neural networks usually contain a large number of layers, which increases the difficulty of optimization. To address this issue, deeply supervised net (a.k.a. deep supervision) is proposed to directly supervise the intermediate layers of deep neural networks [38]. Wang et al. show that deep supervision can alleviate the vanishing gradient problem and thus leads to significant performance improvements [62]. Usually, deep supervision attaches several auxiliary classifiers at the intermediate layers and supervises these auxiliary classifiers with the task loss (e.g. cross-entropy loss in classification). Recently, several methods have been proposed to improve deep supervision with knowledge distillation, which aims to minimize the difference between the prediction of the deepest classifier and the auxiliary classifiers in the intermediate layers [55,40]. Besides classification, abundant research has also demonstrated the effectiveness of deep supervision methods in dynamic neural networks [78], semantic segmentation [81,73,51], object detection [39], knowledge distillation [76] and so on.
+
+# 2.2 Contrastive Learning
+
+In the last several years, contrastive learning has become the most popular method in representation learning [74,63,32,27,68,18,60,5,24,61]. Oord et al. propose the contrastive predictive coding, which aims to predict the low dimension embedding of future signals with an auto-regressive model [47]. He et al. propose MoCo, which introduces a dynamic memory bank to record the embeddings of negative samples [19,9,11]. Then, SimCLR is proposed to show the importance of large batch size and long training time in contrastive learning [7,8]. Recently, abundant research has been proposed to study the influence of negative samples further. BYOL is introduced to demonstrate that contrastive learning is effective even without negative samples [16]. SimSiam gives a detailed study on the importance of batch normalization, negative samples, memory bank, and the stop-gradient operation [10]. Besides self-supervised learning, contrastive learning has also shown its power in the traditional supervised learning paradigm. Khosla et al. show that state-of-the-art performance can be achieved on ImageNet with the basic contrastive learning in SimCLR by building the positive pairs with label supervision [34,6]. Park et al. apply contrastive learning to unpaired image-to-image translation, which breaks the limitation of cycle reconstruction [48].
+
+# 2.3 Knowledge Distillation
+
+Knowledge distillation, which aims to facilitate the training of a lightweight student model under the supervision of an over-parameterized teacher model, has become one of the most popular methods in model compression. Knowledge distillation is first proposed by Bucilua et al. [2] and then expanded by Hinton et al. [23], who introduces a temperature-characterized softmax to soften
+
+the distribution of teacher logits. Instead of distilling the knowledge of the logits, more and more techniques are proposed to distill the information in teacher features or its variants, such as attention maps [72,42], negative values [22], task-oriented information [76], relational information [49,58,43], Gram matrix [69], mutual information [1], context information [75] and so on. Besides model compression, knowledge distillation has also achieved significant success in self-supervised learning [30,46], semi-supervised learning [37,56], multi-exit neural network [78,77,70], incremental learning [83] and model robustness [65,79]
+
+# 3 Methodology
+
+# 3.1 Deep Supervision
+
+In this subsection, we revisit the formulation of deep supervision methods. Let $c$ be a given backbone classifier, deep supervision introduces several shallow classifiers by using the intermediate features in $c$ . More specifically, assume $c = g \circ f$ where $g$ is the final classifier, $f$ is the feature extractor operator and $f = f_{K} \circ f_{K-1} \circ \dots \circ f_{1}$ . $K$ denotes the number of convolutional stages in $f$ . At each feature extraction stage $i$ , deep supervision attaches an auxiliary classifier $g_{i}$ for providing intermediate supervision. Thus, there are $K$ classifiers in total which have the following form:
+
+$$
+c _ {1} (x) = g _ {1} \circ f _ {1} (x)
+$$
+
+$$
+\begin{array}{l} c _ {2} (x) = g _ {2} \circ f _ {2} \circ f _ {1} (x) \\ \dots \end{array} \tag {1}
+$$
+
+$$
+c _ {K} (x) = g _ {K} \circ f _ {K} \circ f _ {K - 1} \circ \dots \circ f _ {1} (x).
+$$
+
+Given a set of training samples $\mathcal{X} = \{x_i\}_{i=1}^n$ and its corresponding labels $\mathcal{Y} = \{y_i\}_{i=1}^n$ , the training loss of deep supervision $\mathcal{L}_{\mathrm{DS}}$ can be formulated as
+
+$$
+\mathcal {L} _ {\mathrm {D S}} = \underbrace {\mathcal {L} _ {\mathrm {C E}} \left(c _ {K} (\mathcal {X}) , \mathcal {Y}\right)} _ {\text {f r o m s t a n d a r d t r a i n i n g}} + \alpha \cdot \sum_ {i = 1} ^ {K - 1} \underbrace {\mathcal {L} _ {\mathrm {C E}} \left(c _ {i} (\mathcal {X}) , \mathcal {Y}\right)} _ {\text {f r o m d e e p s u p e r v i s i o n}}, \tag {2}
+$$
+
+where $\mathcal{L}_{\mathrm{CE}}$ indicates the cross entropy loss. The first and the second item in the loss function indicate the standard training loss and the additional loss from deep supervision for the intermediate layers, respectively. $\alpha$ is a hyper-parameter to balance the two loss items. Recently, some research has been proposed to apply layer-wise consistency on deep supervision, which additionally minimizes the KL divergence between the prediction of auxiliary classifiers and the final classifier [55,40]. These methods can also be considered as the knowledge distillation which regards the final classifier as the teacher and the auxiliary classifiers as the students. Their training loss can be formulated as
+
+$$
+\mathcal {L} _ {\mathrm {D S}} + \beta \cdot \sum_ {i = 1} ^ {K - 1} \mathcal {L} _ {\mathrm {K L}} \left(c _ {i} (\mathcal {X}), c _ {K} (\mathcal {X})\right), \tag {3}
+$$
+
+where $\beta$ is a hyper-parameter to balance the two loss functions.
+
+# 3.2 Contrastive Deep Supervision
+
+In this subsection, we first introduce the formulation of contrastive learning. For a minibatch of $N$ images $\{x_{1}, x_{2}, \ldots, x_{N}\}$ , we apply stochastic data augmentation to each image twice, resulting in a batch of $2N$ images. For convenience, we denote $x_{i}$ and $x_{N + i}$ images as the two augmentations from the same image, which is regarded as a positive pair. Denote $z = c(x)$ as the normalized projection head outputs, contrastive learning loss (a.k.a. NT-Xtent [7]) can be formulated as
+
+$$
+\mathcal {L} _ {\text {C o n t r a}} = - \sum_ {i = 1} ^ {N} \log \frac {\exp \left(z _ {i} \cdot z _ {i + N}\right) / \tau}{\sum_ {k = 1} ^ {2 N} \mathbb {1} _ {[ k \neq i ]} \exp \left(z _ {i} \cdot z _ {k}\right) / \tau}, \tag {4}
+$$
+
+where $\mathbb{1} \in \{0, 1\}$ is an indicator function evaluating to 1 if $k \neq i$ and $\tau$ is a temperature hyper-parameter. Intuitively, $\mathcal{L}_{\mathrm{Contra}}$ encourages the encoder network to learn similar representation for different augmentations from the same image while increasing the difference between representations of the augmentations from different images.
+
+The main difference between deep supervision and our method is that deep supervision trains the auxiliary classifiers by the cross entropy loss while our method trains them with the contrastive loss $\mathcal{L}_{\mathrm{Contra}}$ . By denoting the contrastive loss at $c_{i}$ as $\mathcal{L}_{\mathrm{Contra}}(\mathcal{X}; c_{i})$ , then the training loss of our contrastive deep supervision $\mathcal{L}_{\mathrm{CDS}}$ can be formulated as
+
+$$
+\mathcal {L} _ {\mathrm {C D S}} = \underbrace {\mathcal {L} _ {\mathrm {C E}} \left(c _ {K} (\mathcal {X}) , \mathcal {Y}\right)} _ {\text {f r o m s t a n d a r d t r a i n i n g}} + \lambda_ {1} \sum_ {i = 1} ^ {K - 1} \underbrace {\mathcal {L} _ {\text {C o n t r a}} \left(\mathcal {X} ; c _ {i}\right)} _ {\text {f r o m o u r m e t h o d}}, \tag {5}
+$$
+
+where the first and the second item indicate the standard training loss and the additional loss in our method for the intermediate layers, respectively. $\lambda_{1}$ is a hyper-parameter to balance the two loss items.
+
+Based on the above formulation on supervised learning, we can extend contrastive deep supervision in semi-supervised learning and knowledge distillation.
+
+Semi-supervised Learning In semi-supervised learning, we assume that there is a labeled dataset $\mathcal{X}_1$ with its labels $\mathcal{Y}_1$ and an unlabeled dataset $\mathcal{X}_2$ . On the labeled data, contrative deep supervision can be applied directly with $\mathcal{L}_{\mathrm{CDS}}$ . On the unlabeled data, due to the lack of labels, contrastive deep supervision only optimize the contrastive learning loss $\mathcal{L}_{\mathrm{Contra}}$ , which can be formulated as
+
+$$
+\mathcal {L} _ {\mathrm {C D S}} \left(\mathcal {X} _ {1}, \mathcal {Y} _ {1}\right) + \mathcal {L} _ {\text {C o n t r a}} \left(\mathcal {X} _ {2}\right) \tag {6}
+$$
+
+Knowledge Distillation The intermediate layers in contrastive deep supervision are supervised with contrastive learning and thus they can learn the invariance to different data augmentation. As shown in previous research, these data augmentation invariance is beneficial to various downstream tasks [31]. In this paper, we further propose to improve knowledge distillation with contrastive
+
+deep supervision by transferring the data augmentation invariance learned by the teachers to the students. Denote the student model and the teacher model in knowledge distillation as $f^S$ and $f^T$ respectively, the naive feature-based knowledge distillation directly minimizes the distance between the backbone features of the student and the teacher, which can be formulated as
+
+$$
+\sum_ {i = 1} ^ {K} \left\| f _ {i} ^ {\mathcal {T}} (\mathcal {X}) - f _ {i} ^ {\mathcal {S}} (\mathcal {X}) \right\| _ {2}. \tag {7}
+$$
+
+In contrast, knowledge distillation with contrastive deep supervision minimizes the distance between the embedding vectors (the output of the projection heads) of the student and the teacher, which can be formulated as
+
+$$
+\mathcal {L} _ {\text {C D S f o r K D}} = \sum_ {i = 1} ^ {K - 1} \| c _ {i} ^ {\mathcal {T}} (\mathcal {X}) - c _ {i} ^ {\mathcal {S}} (\mathcal {X}) \| _ {2}. \tag {8}
+$$
+
+Now we can formulate the overall training loss of the student as
+
+$$
+\mathcal {L} _ {\mathrm {D C D S}} = \mathcal {L} _ {\mathrm {C D S}} + \lambda_ {2} \cdot \mathcal {L} _ {\mathrm {C D S f o r K D}} + \lambda_ {3} \cdot \mathcal {L} _ {\mathrm {K L}} \left(c _ {K} ^ {\mathcal {T}} (\mathcal {X}), c _ {K} ^ {\mathcal {S}} (\mathcal {X})\right), \tag {9}
+$$
+
+where $\lambda_{2}$ and $\lambda_{3}$ are the hyper-parameters to balance different loss items. Following previous works in deep supervision, we do not set an individual hyperparameter for each projection head for convenience in hyper-parameter tuning.
+
+# 3.3 Other Details and Tricks
+
+Design of Projection Heads In contrastive deep supervision, several projection heads are added to the intermediate layers of neural networks during the training period. These projection heads map the backbone features into a normalized embedding space, where the contrastive learning loss is applied. As discussed in related works, the architecture of the projection head is crucial to model performance [8]. Usually, the projection head is a non-linear projection stacked by two fully connected layers and a ReLU function. However, in contrastive deep supervision, the input feature comes from the intermediate layers instead of the final layer, and thus it is more challenging to project them properly [8]. Hence, we increase the complexity of these projection heads by adding convolutional layers before the non-linear projection.
+
+Contrastive Learning The proposed contrastive deep supervision is a general training framework and does not depend on a specific contrastive learning method. In this paper, we adopt SimCLR [7] and SupCon [34] as the contrastive learning method in most experiments. We argue that the performance of our method can be further improved by using better contrastive learning method.
+
+Negative Samples Previous studies show that the number of negative samples has a vital influence on the performance of contrastive learning. Accordingly, a large batch size, a momentum encoder or a memory bank is usually required [7,19,16]. In contrastive deep supervision, we do not use any of these solutions because the supervised loss $(\mathcal{L}_{\mathrm{CE}}$ in Equation 5) is enough to prevent contrastive learning from converging to the collapsing solutions.
+
+Table 1. Comparison experiments (top-1 accuracy / %) with the other deep supervision methods on CIFAR100.
+
+| Method | RNT18 | RNT50 | RNT101 | RXT50 | RXT101 | WRN50 | WRN101 | SET18 | SET50 | PAT18 |
| Base | 77.45 | 77.81 | 78.65 | 79.85 | 80.67 | 79.46 | 79.98 | 77.46 | 78.02 | 76.84 |
| DSN | 78.30 | 78.96 | 79.37 | 81.02 | 81.70 | 80.98 | 81.30 | 78.28 | 79.46 | 77.40 |
| DKS | 78.96 | 80.95 | 81.39 | 82.27 | 82.98 | 81.95 | 82.58 | 79.32 | 80.76 | 78.96 |
| DHM | 78.82 | 81.12 | 81.27 | 82.14 | 83.27 | 81.76 | 82.76 | 79.14 | 80.72 | 78.32 |
| Ours | 80.84 | 81.31 | 83.12 | 82.81 | 83.87 | 82.28 | 83.93 | 80.13 | 81.51 | 80.76 |
+
+Table 2. Comparison experiments (top-1 accuracy / %) with the other deep supervision methods on CIFAR10.
+
+| Method | RNT18 | RNT50 | RNT101 | RXT50 | RXT101 | WRN50 | WRN101 | SET18 | SET50 | PAT18 |
| Base | 94.96 | 95.07 | 95.13 | 95.09 | 95.34 | 95.01 | 95.27 | 94.86 | 95.11 | 94.78 |
| DSN | 95.31 | 95.41 | 95.63 | 95.39 | 95.70 | 95.27 | 95.78 | 95.21 | 95.41 | 95.13 |
| DKS | 95.72 | 95.90 | 96.21 | 95.98 | 96.10 | 95.50 | 96.12 | 95.74 | 95.72 | 95.47 |
| DHM | 95.61 | 95.87 | 96.04 | 96.10 | 96.27 | 95.62 | 96.31 | 95.59 | 95.77 | 95.38 |
| Ours | 96.49 | 96.78 | 97.02 | 96.76 | 97.05 | 96.88 | 97.01 | 96.50 | 96.73 | 96.37 |
+
+Table 3. Comparison with the other deep supervision methods on ImageNet.
+
+| Metric | Model | Baseline | DSN | DKS | DHM | Ours |
| top-1 | RNT18 | 69.21 | 69.54 | 71.32 | 71.29 | 72.85 |
| RNT34 | 73.17 | 73.29 | 74.01 | 73.89 | 76.19 |
| RNT50 | 75.30 | 75.37 | 76.47 | 76.57 | 78.25 |
| top-5 | RNT18 | 89.01 | 88.87 | 89.20 | 90.06 | 91.30 |
| RNT34 | 91.24 | 91.30 | 91.87 | 91.66 | 93.08 |
| RNT50 | 92.20 | 92.49 | 93.60 | 93.24 | 93.99 |
+
+# 4 Experiment
+
+# 4.1 Experiment Setting
+
+Common Image Classification For common image classification, our method has been evaluated on three datasets, including CIFAR10, CIFAR100 and ImageNet [36,13] with kinds of neural networks including ResNet (RNT), ResNeXt (RXT), Wide ResNet (WRN), SENet (SET), PreAct ResNet (PAT), MobileNetv1, MobileNetv2, ShuffleNetv1 and ShuffleNetv2 [20,66,71,26,21,25,54,80].
+
+Fine-grained Image Classification For fine-grained image classification, our method has been evaluated on five popular datasets, including CUB200-
+
+Table 4. Experiments on different object detection models on COCO2017. ResNet50 models are pre-trained on ImageNet with different deep supervision methods and then utilized as the backbones of these detectors.
+
+| Model | Method | AP | APS | APM | APL |
| Faster RCNN | Baseline | 37.4 | 21.2 | 41.0 | 48.1 |
| DSN | 37.3-0.1 | 21.0-0.2 | 40.8-0.2 | 48.3-0.2 |
| DKS | 37.5+0.1 | 21.2+0.0 | 41.5+0.5 | 47.6-0.5 |
| DHM | 37.6+0.2 | 21.3+0.1 | 41.3+0.3 | 48.2+0.1 |
| Ours | 38.3+0.9 | 21.6+0.4 | 42.0+1.0 | 50.1+2.0 |
| RetinaNet | Baseline | 36.5 | 20.4 | 40.3 | 48.1 |
| DSN | 36.3-0.2 | 20.1-0.3 | 40.0-0.3 | 48.10.0 |
| DKS | 36.7+0.2 | 20.1-0.3 | 40.9+0.6 | 48.2+0.1 |
| DHM | 36.7+0.2 | 20.0-0.4 | 40.7+0.4 | 48.5+0.4 |
| Ours | 37.3+0.8 | 21.2+0.8 | 41.0+0.7 | 47.9-0.2 |
+
+Table 5. Comparison (top-1 acc. / %) with deep supervision methods with ResNet50 for fine-grained classification. Models are trained from scratch.
+
+| Method | CUB | Cars | Flowers | Dogs | Aircrafts |
| Baseline | 60.65 | 79.86 | 87.52 | 64.00 | 74.07 |
| DSN | 62.37+1.72 | 81.04+1.18 | 88.54+1.02 | 66.32+2.32 | 74.49+0.42 |
| DKS | 63.59+2.94 | 81.52+1.66 | 88.94+0.40 | 68.31+4.31 | 75.07+1.00 |
| DHM | 64.01+3.36 | 81.49+1.63 | 89.03+1.51 | 68.38+4.38 | 75.00+0.93 |
| Ours | 64.65+4.00 | 82.07+2.21 | 89.26+1.74 | 69.02+5.02 | 75.43+1.36 |
+
+Table 6. Comparison (top-1 acc. %) with deep supervision methods with ResNet50 for fine-grained classification. Models are finetuned from ImageNet pre-trained weights.
+
+| Method | CUB | Cars | Flowers | Dogs | Aircrafts |
| Baseline | 78.50 | 90.25 | 97.68 | 76.47 | 87.43 |
| DSN | 80.14+1.64 | 91.32+1.07 | 98.64+0.96 | 77.21+0.74 | 89.31+1.88 |
| DKS | 81.34+2.84 | 92.54+2.29 | 99.01+1.33 | 78.32+1.85 | 89.20+1.77 |
| DHM | 81.27+2.77 | 92.31+2.06 | 98.84+1.16 | 78.20+1.73 | 89.57+2.14 |
| Ours | 82.10+3.60 | 92.90+2.65 | 99.39+1.71 | 80.99+4.52 | 90.52+3.09 |
+
+2011 [59], Stanford Cars [35], Oxford Flowers [45], Stanford Dogs [33] and FGVC Aircraft [44]. ResNet50 is utilized as the classifier for all the experiments.
+
+Object Detection For object detection, our method has been evaluated on MS COCO2017 [41] with Faster RCNN and RetinaNet by MMdetection [4].
+
+Semi-supervised Learning Semi-supervised learning experiments have been conducted on CIFAR100, CIFAR10 with ResNet18. For each dataset, we have evaluated our method with $10\%$ , $20\%$ , $30\%$ and $40\%$ labels.
+
+Table 7. Comparison experiments (top-1 and top-5 accuracy / %) with the other eight knowledge distillation methods on ImageNet with ResNet. Numbers in bold indicate the highest. Results marked with $\dagger$ come from the paper of SSKD [67].
+
+| Metric | Model | Base | KD | AT | RKD | SP | CRD | CC† | OKD† | SSKD† | Ours |
| top-1 | RNT18 | 69.21 | 70.52 | 70.74 | 70.63 | 70.61 | 71.07 | 69.96 | 70.55 | 71.62 | 73.23 |
| RNT34 | 73.17 | 74.44 | 74.69 | 74.61 | 74.60 | 74.99 | - | - | - | 76.65 |
| RNT50 | 75.30 | 76.62 | 76.79 | 76.92 | 76.88 | 77.21 | - | - | - | 78.68 |
| top-5 | RNT18 | 89.01 | 89.88 | 90.00 | 89.71 | 89.80 | 91.06 | 89.17 | 89.59 | 90.67 | 91.56 |
| RNT34 | 91.24 | 92.07 | 92.18 | 92.14 | 92.10 | 92.58 | - | - | - | 93.38 |
| RNT50 | 92.20 | 93.36 | 93.51 | 93.60 | 93.58 | 93.88 | - | - | - | 94.42 |
+
+
+Fig. 2. Experimental results of semi-supervised training on CIFAR100 and CIFAR10 with ResNet18.
+
+
+Fig.3.Influence from the number of projection heads.
+
+
+
+Comparison Methods Three previous deep supervision methods are utilized for comparison, including DSN [38], DKS [55] and DHM [40]. In knowledge distillation experiments, we have evaluated our method with nine knowledge distillation methods, including KD [23], FitNet [53], AT [72], RKD [49], SP [58] and CRD [57]. Besides, we also cite results on ImageNet of CC [50], OKD [84], and SSKD [67] from the paper of SSKD.
+
+# 4.2 Experimental Results
+
+Image Classification Experimental results on CIFAR100, CIFAR10 and ImageNet are shown in Table 1, Table 2 and Table 3, respectively. It is observed that: (a) Our method achieves $3.44\%$ and $1.70\%$ top-1 accuracy improvements on CIFAR100 and CIFAR10 on average, respectively. It consistently outperforms the second-best deep supervision method by $1.05\%$ and $0.90\%$ on the two datasets, respectively. (b) On ImageNet, contrastive deep supervision leads to $3.64\%$ , $3.02\%$ and $2.95\%$ top-1 accuracy improvements on ResNet18, ResNet34 and ResNet50, respectively. On average, it outperforms the baseline and the second-best method by $3.20\%$ and $1.83\%$ top-1 accuracy, respectively.
+
+Object Detection Table 4 shows the performance of our method on object detection. In these experiments, We firstly pretrain the ResNets on ImageNet with standard training (Baseline), three deep supervision methods, and
+
+Table 8. Comparison with the other knowledge distillation methods on CIFAR.
+
+| CIFAR100 |
| Model | Base | KD | FitNet | AT | RKD | SP | CRD | Ours |
| ResNet18 | 77.45 | 78.68 | 78.15 | 78.09 | 78.21 | 78.19 | 81.41 | 83.31 |
| ResNet50 | 77.81 | 79.19 | 78.42 | 78.34 | 78.94 | 78.81 | 82.45 | 83.53 |
| ResNet101 | 78.65 | 80.40 | 80.78 | 80.97 | 81.24 | 80.94 | 82.57 | 84.80 |
| ResNeXt50 | 79.85 | 81.41 | 82.67 | 82.59 | 83.71 | 82.67 | 83.41 | 84.41 |
| ResNeXt101 | 80.67 | 82.03 | 82.51 | 82.43 | 83.01 | 82.64 | 84.50 | 85.37 |
| WRNet50 | 79.46 | 81.02 | 81.29 | 81.16 | 82.06 | 82.07 | 82.94 | 84.27 |
| WRNet101 | 79.98 | 81.82 | 82.07 | 82.16 | 82.54 | 82.49 | 83.07 | 85.04 |
| SENet18 | 77.46 | 78.92 | 79.09 | 79.15 | 79.41 | 79.31 | 81.22 | 82.68 |
| SENet50 | 78.02 | 79.78 | 80.13 | 80.45 | 80.69 | 80.71 | 81.79 | 83.36 |
| SENet101 | 78.92 | 80.31 | 80.54 | 80.53 | 80.74 | 80.52 | 82.75 | 84.15 |
| MobileNetV1 | 68.32 | 70.04 | 70.25 | 70.17 | 70.89 | 70.19 | 72.68 | 73.79 |
| MobileNetV2 | 69.34 | 70.58 | 70.64 | 70.51 | 70.83 | 70.68 | 71.82 | 72.61 |
| ShuffleNetV1 | 72.46 | 74.08 | 74.19 | 74.11 | 74.56 | 74.68 | 75.11 | 75.77 |
| ShuffleNetV2 | 72.81 | 74.39 | 74.47 | 74.51 | 74.82 | 74.67 | 75.62 | 76.11 |
| PreActNet18 | 76.84 | 78.25 | 78.34 | 78.67 | 79.01 | 79.12 | 81.62 | 82.83 |
| PreActNet50 | 77.31 | 79.04 | 79.27 | 79.54 | 79.82 | 79.76 | 81.27 | 83.42 |
+
+| CIFAR10 |
| Model | Base | KD | FitNet | AT | RKD | SP | CRD | Ours |
| ResNet18 | 94.96 | 95.24 | 95.31 | 95.26 | 95.31 | 95.27 | 95.81 | 96.84 |
| ResNet50 | 95.07 | 95.31 | 95.45 | 95.47 | 95.33 | 95.29 | 96.21 | 97.08 |
| ResNet101 | 95.13 | 95.39 | 95.71 | 95.49 | 95.43 | 95.18 | 96.37 | 97.40 |
| ResNeXt50 | 95.09 | 95.27 | 95.36 | 95.68 | 95.59 | 95.37 | 96.49 | 97.15 |
| ResNeXt101 | 95.34 | 95.68 | 95.92 | 95.78 | 95.81 | 95.38 | 96.51 | 97.40 |
| WRNet50 | 95.01 | 95.34 | 95.38 | 95.34 | 95.61 | 95.73 | 96.17 | 97.37 |
| WRNet101 | 95.27 | 95.51 | 95.48 | 95.71 | 95.99 | 95.82 | 96.34 | 97.39 |
| SENet18 | 94.86 | 95.21 | 95.30 | 95.47 | 95.34 | 95.41 | 96.00 | 96.96 |
| SENet50 | 95.11 | 95.39 | 95.44 | 95.64 | 95.57 | 95.47 | 96.21 | 97.19 |
| SENet101 | 95.30 | 95.64 | 95.81 | 95.78 | 95.81 | 95.77 | 96.19 | 97.36 |
| MobileNetV1 | 90.24 | 91.27 | 92.59 | 92.87 | 93.01 | 92.90 | 93.27 | 93.94 |
| MobileNetV2 | 90.76 | 91.09 | 91.57 | 91.75 | 91.82 | 91.83 | 92.17 | 92.87 |
| ShuffleNetV1 | 91.57 | 91.99 | 92.30 | 92.19 | 92.47 | 92.38 | 93.08 | 94.04 |
| ShuffleNetV2 | 91.19 | 91.87 | 92.23 | 92.41 | 92.30 | 92.54 | 92.90 | 93.16 |
| PreActNet18 | 94.78 | 95.08 | 95.28 | 95.39 | 95.51 | 95.69 | 96.07 | 96.70 |
| PreActNet50 | 94.89 | 95.21 | 95.57 | 95.49 | 95.37 | 95.48 | 96.11 | 96.93 |
+
+our method, and then finetuning them as the backbone for object detection models, including RetinaNet and Faster RCNN on COCO2017 datasets. It is observed that with backbones pre-trained with our method, there are 0.9 and 0.8 AP improvements on Faster RCNN and RetinaNet respectively, which outperforms the second-best method by 0.6 AP, indicating that the representation learned with our method are more beneficial to downstream tasks.
+
+Fine-grained Image Classification Experiments on fine-grained image classification are shown in Table 6. It is observed that: (a) Contrastive deep supervision leads to consistent and significant accuracy improvements on the five datasets. On average, it leads to $3.80\%$ , $2.43\%$ , $1.73\%$ , $4.77\%$ and $2.25\%$ accuracy improvements on the five datasets, respectively. (b) Besides, the benefits of our method in "finetuning from ImageNet" and "training from scratch" are very similar (except on Aircraft), which indicates that the effectiveness of our method is consistent in different training settings.
+
+Semi-supervised Learning Experiments on semi-supervised learning with ResNet18 on CIFAR10 and CIFAR100 are shown in Figure 2. It is observed that: (a) Our method leads to consistent accuracy improvements at all the ratios of labeled data. (b) The benefits of our method become larger when there is less labeled data, which indicates that our method is effective in using the unlabeled data to optimize the intermediate layers.
+
+Knowledge Distillation Knowledge distillation experiments on ImageNet and CIFAR are shown in Table 7 and Table 8, respectively. It is observed that: (a) Our method achieves $5.07\%$ and $2.20\%$ top-1 accuracy improvements on CIFAR100 and CIFAR10 on average, outperforming the second-best KD method by $1.40\%$ and $0.87\%$ on the two datasets, respectively. (b) The similar results can also be observed in ImageNet experiments. Our method leads to $4.02\% / 2.55\%$ , $3.48\% / 2.14\%$ and $3.38\% / 2.22\%$ top-1/top-5 accuracy improvements on ResNet18, ResNet34 and ResNet50, respectively. On average, it outperforms the baseline and the second-best method by $3.62\%$ and $1.76\%$ top-1 accuracy, respectively.
+
+# 5 Discussion
+
+# 5.1 Contrastive Deep Supervision as a Regularizer
+
+Loss Curves Regularization methods in deep learning are usually utilized to avoid model overfitting by introducing additional penalties or loss. In this subsection, we show that the contrastive learning loss introduced by our method in the intermediate layers works as a regularizer. Figure 4 shows the cross entropy loss between predicted results and labels during the training period from two ResNet18 models trained by the standard method and our method, respectively. It is observed that at most of epochs, the baseline model has lower cross entropy loss than our model. When both models are converged (epoch 280-300), the baseline model has only 0.005 loss while our model still has 0.025 loss. These observations indicate that there is serve overfitting in the baseline model while deep contrastive supervision can alleviate overfitting and thus improve the accuracy.
+
+Uncertainty Estimation Besides, the comparison on expected calibrated error (ECE) of models trained with the standard method and our method has been shown in Figure 5. A lower ECE indicates that the predicted probability of a neural network estimates representative of the true correctness likelihood better [17]. It is observed that compared with the baseline model, our method leads to a lower ECE, indicating better uncertainty estimation and interpretability.
+
+Table 9. Comparison between our method and contrastive learning methods with ResNet50 on ImageNet. Baseline1 - 2: Two baselines trained with and without AutoAugmentation [12]. SupCon1-3: Three models trained by supervised contrastive learning with different hyper-parameters. BYOL: ResNet50 unsupervisedly pre-trained by 1000 epochs and then supervisedly finetuned. BYOL+DSN: ResNet50 pretrained with BYOL and then finetuned with deep supervision. Ours1,3: ResNet50 trained with contrastive deep supervision in different settings. Ours2: ResNet50 trained with contrastive deep supervision+ knowledge distillation.
+
+| Method | Batchsize | Epoch | AutoAug | top-1 acc. (%) |
| \( Baseline^1 \) | 256 | 90 | × | 75.3 |
| \( Baseline^2 \) | 4096 | 270 | ✓ | 77.6 |
| \( SupCon^1 \) | 6144 | 350 | ✓ | 78.7 |
| \( SupCon^2 \) | 512 | 350 | ✓ | 74.5 |
| \( SupCon^3 \) | 6144 | 100 | ✓ | 77.0 |
| BYOL | 1024 | 1080 | × | 77.7 |
| BYOL+DSN | 1024 | 1080 | × | 78.2 |
| \( Ours^1 \) | 256 | 90 | × | 78.3 |
| \( Ours^2 \) | 256 | 90 | × | 78.7 |
| \( Ours^3 \) | 256 | 350 | ✓ | 79.8 |
+
+# 5.2 Comparison with Contrastive Learning
+
+Comparison between our method and two "pretrain & finetune" contrastive learning methods is shown in Table 9. It is observed that without a large batch size and the advanced data augmentation policy (AutoAugment), contrastive deep supervision $(\text{Ours}^1)$ with only $25\%$ training time achieves $0.4\%$ lower accuracy than $\text{SupCon}^3$ . Besides, contrastive deep supervision with the same training time and data augmentation $(\text{Ours}^3)$ achieves $1.1\%$ and $1.6\%$ higher accuracy than $\text{SupCon}^3$ and $\text{BYOL+DSN}$ , respectively, which demonstrates the advantage of our method over the traditional contrastive learning methods.
+
+# 5.3 Ablation Study on Knowledge Distillation
+
+The main difference between the naive feature distillation and feature distillation with our contrastive deep supervision is "what to distill". Naive feature distillation distills the backbone features while our method distills the embedding learned by contrastive deep supervision. To further demonstrate its effectiveness, we have trained a ResNet50 model on CIFAR100 with both contrastive deep supervision and distillation on backbone features. Experimental results show this model achieves $82.26\%$ accuracy, which is $1.27\%$ lower than distilling the embedding. These results demonstrate that distilling the embedding learned by contrastive deep supervision is more beneficial.
+
+
+Fig.4. Comparison on the cross entropy loss between predicted results and labels during the training period. Note that our method also leads to better accuracy (80.84% vs 77.45%)
+
+
+Fig.5. Comparison on reliability diagrams. "GAP" indicates the difference between confidence and accuracy. "Output" indicates accuracy. ECE: Expected Calibrated Error (lower is better).
+
+
+
+
+
+# 5.4 Sensitivity Study
+
+Where to Apply Projection Heads We study the influence from the position of projection heads with the following four schemes: (1) uniform scheme - applying projection heads into different depths uniformly; (2) downsampling scheme - applying projection heds into the layers before downsampling; (3) shallow scheme - applying projection heads into only the shallower layers; (4) deep scheme - applying projection heads to only the deeper layers; Experimental results on CIFAR100 with ResNet50 show that the four schemes achieves $81.23\%$ , $81.31\%$ , $81.07\%$ and $80.99\%$ accuracy, respectively. It is observed that both uniform and downsampling schemes leads to excellent performance, indicating our method is not sensitive to where to apply projection heads.
+
+The Number of Projection Heads We have studied the influence from the number of projection heads in Figure 3. It is observed that when there are less than five projection heads, more projection heads tend to achieve better performance. The fifth projection head does not lead to more accuracy improvements.
+
+# 6 Conclusion
+
+This paper proposes contrastive deep supervision, a novel training methodology that directly optimizes the intermediate layers of deep neural networks with contrastive learning. It enables the neural network to learn better visual representation without additional computation and storage in inference. Experiments on nine datasets with eleven neural networks have demonstrated its effectiveness in general image classification, fine-grained image classification and object detection for traditional supervised learning, semi-supervised learning and knowledge distillation. It outperforms the previous deep supervision methods, knowledge distillation methods, and contrastive learning methods by a clear margin. Besides, we also show that contrastive deep supervision works as a regularizer to prevent models from overfitting, and thus leads to better uncertainty estimation.
+
+# References
+
+1. Ahn, S., Hu, S.X., Damianou, A., Lawrence, N.D., Dai, Z.: Variational information distillation for knowledge transfer. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 9163-9171 (2019)
+2. Bucilua, C., Caruana, R., Niculescu-Mizil, A.: Model compression. In: Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining. pp. 535-541. ACM (2006)
+3. Chaitanya, K., Erdil, E., Karani, N., Konukoglu, E.: Contrastive learning of global and local features for medical image segmentation with limited annotations. Advances in Neural Information Processing Systems 33 (2020)
+4. Chen, K., Wang, J., Pang, J., Cao, Y., Xiong, Y., Li, X., Sun, S., Feng, W., Liu, Z., Xu, J., et al.: Mmdetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155 (2019)
+5. Chen, L., Wang, D., Gan, Z., Liu, J., Henao, R., Carin, L.: Wasserstein contrastive representation distillation. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 16296-16305. Computer Vision Foundation / IEEE (2021)
+6. Chen, L., Wang, D., Gan, Z., Liu, J., Henao, R., Carin, L.: Wasserstein contrastive representation distillation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16296-16305 (2021)
+7. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+8. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.E.: Big self-supervised models are strong semi-supervised learners. Advances in neural information processing systems 33, 22243-22255 (2020)
+9. Chen, X., Fan, H., Girshick, R., He, K.: Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297 (2020)
+0. Chen, X., He, K.: Exploring simple siamese representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15750-15758 (2021)
+1. Chen, X., Xie, S., He, K.: An empirical study of training self-supervised visual transformers. arXiv e-prints pp. arXiv-2104 (2021)
+2. Cubuk, E.D., Zoph, B., Mane, D., Vasudevan, V., Le, Q.V.: Autoaugment: Learning augmentation strategies from data. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (June 2019)
+3. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR. pp. 248-255 (2009)
+4. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. In: NAACL (2018)
+5. Furlanello, T., Lipton, Z.C., Tschannen, M., Itti, L., Anandkumar, A.: Born again neural networks. In: ICML (2018)
+6. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al.: Bootstrap your own latent-a new approach to self-supervised learning. Advances in Neural Information Processing Systems 33, 21271-21284
+7. Guo, C., Pleiss, G., Sun, Y., Weinberger, K.Q.: On calibration of modern neural networks. In: International Conference on Machine Learning. pp. 1321-1330. PMLR (2017)
+
+18. Han, Z., Fu, Z., Chen, S., Yang, J.: Contrastive embedding for generalized zero-shot learning. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 2371-2381. Computer Vision Foundation / IEEE (2021)
+19. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+20. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR. pp. 770-778 (2016)
+21. He, K., Zhang, X., Ren, S., Sun, J.: Identity mappings in deep residual networks. In: European conference on computer vision. pp. 630-645. Springer (2016)
+22. Heo, B., Kim, J., Yun, S., Park, H., Kwak, N., Choi, J.Y.: A comprehensive overhaul of feature distillation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1921-1930 (2019)
+23. Hinton, G., Vinyls, O., Dean, J.: Distilling the knowledge in a neural network. In: NeurIPS (2014)
+24. Hou, J., Graham, B., Nießner, M., Xie, S.: Exploring data-efficient 3d scene understanding with contrastive scene contexts. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 15587-15597. Computer Vision Foundation / IEEE (2021)
+25. Howard, A.G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., Adam, H.: Mobilenets: Efficient convolutional neural networks for mobile vision applications. In: CVPR (2017)
+26. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: CVPR. pp. 7132-7141 (2018)
+27. Hu, Q., Wang, X., Hu, W., Qi, G.: Adco: Adversarial contrast for efficient learning of unsupervised representations from self-trained negative adversaries. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 1074-1083 (2021)
+28. Huang, G., Chen, D., Li, T., Wu, F., van der Maaten, L., Weinberger, K.Q.: Multiscale dense networks for resource efficient image classification. In: ICLR (2018)
+29. Huang, G., Sun, Y., Liu, Z., Sedra, D., Weinberger, K.Q.: Deep networks with stochastic depth. In: ECCV. pp. 646-661 (2016)
+30. Hyun Lee, S., Ha Kim, D., Cheol Song, B.: Self-supervised knowledge distillation using singular value decomposition. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 335-350 (2018)
+31. Jaiswal, A., Babu, A.R., Zadeh, M.Z., Banerjee, D., Makedon, F.: A survey on contrastive self-supervised learning. Technologies 9(1), 2 (2021)
+32. Jeon, S., Min, D., Kim, S., Sohn, K.: Mining better samples for contrastive learning of temporal correspondence. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 1034-1044 (2021)
+33. Khosla, A., Jayadevaprakash, N., Yao, B., Fei-Fei, L.: Novel dataset for fine-grained image categorization. In: First Workshop on Fine-Grained Visual Categorization, IEEE Conference on Computer Vision and Pattern Recognition. Colorado Springs, CO (June 2011)
+34. Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., Krishnan, D.: Supervised contrastive learning. Advances in Neural Information Processing Systems 33, 18661-18673 (2020)
+35. Krause, J., Stark, M., Deng, J., Fei-Fei, L.: 3d object representations for fine-grained categorization. In: 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13). Sydney, Australia (2013)
+
+36. Krizhevsky, A., Hinton, G.: Learning multiple layers of features from tiny images. Tech. rep., Citeseer (2009)
+37. Laine, S., Aila, T.: Temporal ensembling for semi-supervised learning. In: International Conference on Learning Representations (ICLR). vol. 4, p. 6 (2017)
+38. Lee, C.Y., Xie, S., Gallagher, P., Zhang, Z., Tu, Z.: Deeply-supervised nets. In: Artificial Intelligence and Statistics. pp. 562-570 (2015)
+39. Li, C., Zeeshan Zia, M., Tran, Q.H., Yu, X., Hager, G.D., Chandraker, M.: Deep supervision with shape concepts for occlusion-aware 3d object parsing. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 5465-5474 (2017)
+40. Li, D., Chen, Q.: Dynamic hierarchical mimicking towards consistent optimization objectives. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7642-7651 (2020)
+41. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision. pp. 740-755. Springer (2014)
+42. Liu, M., Chen, X., Zhang, Y., Li, Y., Rehg, J.M.: Attention distillation for learning video representations. In: BMVC (2020)
+43. Liu, Y., Shu, C., Wang, J., Shen, C.: Structured knowledge distillation for dense prediction. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020)
+44. Maji, S., Kannala, J., Rahtu, E., Blaschko, M., Vedaldi, A.: Fine-grained visual classification of aircraft. Tech. rep. (2013)
+45. Nilsback, M.E., Zisserman, A.: Automated flower classification over a large number of classes. In: 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing. pp. 722-729. IEEE (2008)
+46. Noroozi, M., Vinjimoor, A., Favaro, P., Pirsiavash, H.: Boosting self-supervised learning via knowledge transfer. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 9359-9367 (2018)
+47. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018)
+48. Park, T., Efros, A.A., Zhang, R., Zhu, J.Y.: Contrastive learning for unpaired image-to-image translation. In: European Conference on Computer Vision. pp. 319-345. Springer (2020)
+49. Park, W., Kim, D., Lu, Y., Cho, M.: Relational knowledge distillation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3967-3976 (2019)
+50. Peng, B., Jin, X., Liu, J., Li, D., Wu, Y., Liu, Y., Zhou, S., Zhang, Z.: Correlation congruence for knowledge distillation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 5007-5016 (2019)
+51. Reiß, S., Seibold, C., Freytag, A., Rodner, E., Stiefelhagen, R.: Every annotation counts: Multi-label deep supervision for medical image segmentation. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 9532-9542. Computer Vision Foundation / IEEE (2021)
+52. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. In: Advances in neural information processing systems. pp. 91-99 (2015)
+53. Romero, A., Ballas, N., Kahou, S.E., Chassang, A., Gatta, C., Bengio, Y.: Fitnets: Hints for thin deep nets. In: ICLR (2015)
+54. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.C.: Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4510-4520 (2018)
+
+55. Sun, D., Yao, A., Zhou, A., Zhao, H.: Deeply-supervised knowledge synergy. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6997-7006 (2019)
+56. Tarvainen, A., Valpola, H.: Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In: Advances in neural information processing systems. pp. 1195-1204 (2017)
+57. Tian, Y., Krishnan, D., Isola, P.: Contrastive representation distillation. In: ICLR (2020)
+58. Tung, F., Mori, G.: Similarity-preserving knowledge distillation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1365-1374 (2019)
+59. Wah, C., Branson, S., Welinder, P., Perona, P., Belongie, S.: The caltech-ucsd birds200-2011 dataset. Tech. Rep. CNS-TR-2011-001, California Institute of Technology (2011)
+60. Wang, F., Liu, H.: Understanding the behaviour of contrastive loss. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 2495-2504. Computer Vision Foundation / IEEE (2021)
+61. Wang, L., Huang, J., Li, Y., Xu, K., Yang, Z., Yu, D.: Improving weakly supervised visual grounding by contrastive knowledge distillation. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 14090-14100. Computer Vision Foundation / IEEE (2021)
+62. Wang, L., Lee, C.Y., Tu, Z., Lazebnik, S.: Training deeper convolutional networks with deep supervision. arXiv preprint arXiv:1505.02496 (2015)
+63. Wang, P., Han, K., Wei, X., Zhang, L., Wang, L.: Contrastive learning based hybrid networks for long-tailed image classification. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 943-952 (2021)
+64. Xie, E., Ding, J., Wang, W., Zhan, X., Xu, H., Li, Z., Luo, P.: Detco: Unsupervised contrastive learning for object detection. arXiv preprint arXiv:2102.04803 (2021)
+65. Xie, Q., Luong, M.T., Hovy, E., Le, Q.V.: Self-training with noisy student improves imagenet classification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10687-10698 (2020)
+66. Xie, S., Girshick, R., Dólár, P., Tu, Z., He, K.: Aggregated residual transformations for deep neural networks. In: CVPR. pp. 5987-5995 (2017)
+67. Xu, G., Liu, Z., Li, X., Loy, C.C.: Knowledge distillation meets self-supervision. In: European Conference on Computer Vision. pp. 588-604. Springer (2020)
+68. Yang, M., Li, Y., Huang, Z., Liu, Z., Hu, P., Peng, X.: Partially view-aligned representation learning with noise-robust contrastive loss. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 1134-1143. Computer Vision Foundation / IEEE (2021)
+69. Yim, J., Joo, D., Bae, J., Kim, J.: A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4133-4141 (2017)
+70. Yu, J., Huang, T.S.: Universally slimmable networks and improved training techniques. In: The IEEE International Conference on Computer Vision (ICCV) (October 2019)
+71. Zagoruyko, S., Komodakis, N.: Wide residual networks. In: BMVC (2016)
+72. Zagoruyko, S., Komodakis, N.: Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In: ICLR (2017)
+
+73. Zeng, G., Yang, X., Li, J., Yu, L., Heng, P.A., Zheng, G.: 3d u-net with multi-level deep supervision: fully automatic segmentation of proximal femur in 3d mr images. In: International workshop on machine learning in medical imaging. pp. 274-282. Springer (2017)
+74. Zhang, H., Koh, J.Y., Baldridge, J., Lee, H., Yang, Y.: Cross-modal contrastive learning for text-to-image generation. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. pp. 833-842. Computer Vision Foundation / IEEE (2021)
+75. Zhang, L., Kaisheng, M.: Improve object detection with feature-based knowledge distillation: Towards accurate and efficient detectors. In: ICLR (2021)
+76. Zhang, L., Shi, Y., Shi, Z., Ma, K., Bao, C.: Task-oriented feature distillation. In: NeurIPS (2020)
+77. Zhang, L., Song, J., Gao, A., Chen, J., Bao, C., Ma, K.: Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In: arXiv preprint:1905.08094 (2019)
+78. Zhang, L., Tan, Z., Song, J., Chen, J., Bao, C., Ma, K.: Scan: A scalable neural networks framework towards compact and efficient models. ArXiv abs/1906.03951 (2019)
+79. Zhang, L., Yu, M., Chen, T., Shi, Z., Bao, C., Ma, K.: Auxiliary training: Towards accurate and robust models. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 372-381 (2020)
+80. Zhang, X., Zhou, X., Lin, M., Sun, J.: Shufflenet: An extremely efficient convolutional neural network for mobile devices. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 6848-6856 (2018)
+81. Zhang, Y., Chung, A.C.: Deep supervision with additional labels for retinal vessel segmentation task. In: International conference on medical image computing and computer-assisted intervention. pp. 83-91. Springer (2018)
+82. Zhou, B., Khosla, A., Lapedriza, A., Oliva, A., Torralba, A.: Object detectors emerge in deep scene cnns. arXiv preprint arXiv:1412.6856 (2014)
+83. Zhou, P., Mai, L., Zhang, J., Xu, N., Wu, Z., Davis, L.S.: M2kd: Multi-model and multi-level knowledge distillation for incremental learning. arXiv preprint arXiv:1904.01769 (2019)
+84. Zhu, X., Gong, S., et al.: Knowledge distillation by on-the-fly native ensemble. Advances in neural information processing systems 31 (2018)
\ No newline at end of file
diff --git a/contrastivedeepsupervision/images.zip b/contrastivedeepsupervision/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..85f4914169cb8304feabaa7f925b5fad3b8cbc42
--- /dev/null
+++ b/contrastivedeepsupervision/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b9ecef9d0ec15cfd9604f990eb5ca40cb68e12f0712d92f15bad18a096fcde61
+size 748623
diff --git a/contrastivedeepsupervision/layout.json b/contrastivedeepsupervision/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9a264d9ed8d864a0820ba9063f19cf00e870c796
--- /dev/null
+++ b/contrastivedeepsupervision/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e8186c6ce85783f9df7fd60872537fec900a345a21cb72140f1bd47bbd3060b9
+size 476830
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_content_list.json b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b41a2aa32b8cdfaec1c942d571c90a8fbdb768d4
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb73cfee4698d82db6bdfd47f6916d67f9a0c59620d21dba365ba2a640760d80
+size 74708
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_model.json b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b434b7a63103c84ff5549f808ddc53da6f88f2d1
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b9de00b2e5f450a4bde5fbd5bc41e4e5a68eab929dd9657d03cffb040a2d6ad5
+size 94883
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_origin.pdf b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3bd2dad7983c4915228cc0bea95d60a5e2abc926
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/2c454464-7de3-423f-975f-563ee3faed5a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fcba4899aeaff2a10b7a925699203bcc885cb3661d767f2a86af246a8efd9069
+size 2633957
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/full.md b/contrastivelearningfordiversedisentangledforegroundgeneration/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..61c7556b3633d686cc321200cb5aa68adbcaa23d
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/full.md
@@ -0,0 +1,274 @@
+# Contrastive Learning for Diverse Disentangled Foreground Generation
+
+Yuheng Li $^{1,2}$ , Yijun Li $^{2}$ , Jingwan Lu $^{2}$ , Eli Shechtman $^{2}$ , Yong Jae Lee $^{1}$ , and Krishna Kumar Singh $^{2}$
+
+1University of Wisconsin-Madison 2Adobe Research
+
+Abstract. We introduce a new method for diverse foreground generation with explicit control over various factors. Existing image inpainting based foreground generation methods often struggle to generate diverse results and rarely allow users to explicitly control specific factors of variation (e.g., varying the facial identity or expression for face inpainting results). We leverage contrastive learning with latent codes to generate diverse foreground results for the same masked input. Specifically, we define two sets of latent codes, where one controls a pre-defined factor ("known"), and the other controls the remaining factors ("unknown"). The sampled latent codes from the two sets jointly bi-modulate the convolution kernels to guide the generator to synthesize diverse results. Experiments demonstrate the superiority of our method over state-of-the-art in result diversity and generation controllability.
+
+Keywords: Foreground generation, diversity, disentanglement
+
+# 1 Introduction
+
+Foreground object generation is the task of filling in the missing foreground region in a given context, such as generating human faces as shown in Figure 1. This task is useful in practice, e.g., for privacy-related applications (anonymizing a person's face by generating a new identity) or replacing/adding objects in an image (replacing a car in a photo if one does not like the original one). It is a special case of image inpainting in which the entire foreground object is masked. In inpainting, when the missing region (hole) is small, there may only be one or few "correct" completions (e.g., if only one eye is masked, then it mostly can be inferred from the other eye), but as the hole gets bigger there should be more diversity in the generated completion, especially when an entire object is masked. As there can be many different plausible solutions for filling in the missing region, this task naturally demands learning a "one-to-many" mapping between the input and outputs (e.g., Figure 1). That is, a good method should 1) synthesize foreground objects that are both realistic and semantically coherent with the surrounding unmasked context; 2) have the capability to generate diverse results for the same missing region and context; and 3) provide control over different properties of the synthesized results. While tremendous progress has been made to obtain better realism and coherence [60, 11, 40, 26], progress in diversity is
+
+
+Fig. 1. Foreground generation on the same mask. We use contrastive learning to increase generation diversity. We also explicitly disentangle out an expected predefined factor (human identity here) to increase diversity and controllability.
+
+still unsatisfactory and increasing controllability for the results is also relatively under explored.
+
+Like the inpainting task [4, 12, 3, 32, 28, 61], foreground generation needs to consider coherence between the given context and the generated object. Existing inpainting work can generate good quality object/foreground, but it usually lacks diversity and controllability. Although there are many inpainting methods trying to generate diverse results [61, 59, 60, 26], the results are still less satisfactory. These methods typically have an encoder-decoder architecture. To achieve diversity, different latent codes can be sampled and injected into these models. However, although the output is a function of both the masked image as well as the latent code, the spatial features from the encoder usually dominate the final results and prevent the latent codes from inducing large changes. For example, in [60], an encoder is used to extract 2D spatial features from the masked image, and skip connections are added to all levels of the encoder and decoder. The information from the latent code can be easily submerged by the large number of features from the encoder.
+
+In this paper, we propose a novel approach for diverse and controllable foreground generation. As shown in Figure 1, our method can generate diverse results for the same input. To synthesize diverse content, we condition the generation on both the masked image and the sampled latent codes, and apply contrastive learning [5] so that the latent codes that are close/far in code space result in corresponding synthesized images that are close/far in image space.
+
+Besides diversity, controllability is another desired property in foreground generation. Thus, we also try to explicitly disentangle a predefined factor by using a pretrained classifier on this factor. For example, as shown in Figure 1, one can disentangle human identity (rows) from other attributes (columns) for face images. We explicitly use two sets of latent codes, where one represents the predefined factor ("known"), and the other controls all the other factors ("un-
+
+known"). This allows us to change the unknown factors while keeping the known factor fixed (e.g., in Figure 1, changing the facial attributes which are unknown during training while keeping the identity of the face intact). To inject these two codes, we propose a bi-modulated convolution module where the convolution kernels are modulated by the two latent codes from different spaces. We design each training batch to contain a mix of instances that share the same known latent code while differing in the unknown, and instances that share the same unknown latent code while differing in the known. We use a contrastive loss to ensure that known and unknown codes control their respective factors.
+
+Contributions. (1) We propose a novel contrastive learning based approach for diverse foreground generation; (2) An explicit disentangled latent space for controllability via a novel bi-modulated convolution module; (3) More diverse results compared to existing state-of-the-art methods on three different datasets.
+
+# 2 Related Work
+
+Image inpainting This problem has been studied for decades due to its importance. Traditional methods [2, 4, 41, 12, 3] typically rely on low-level assumptions and image statistics, leading to over smoothing and results with limited visual semantics. Recently, deep learning methods [8, 18, 33, 34, 46, 48, 50, 51, 53, 57, 28, 55, 59] dramatically boosted the quality, in terms of both visual quality and semantic coherence. [32] first uses an encoder-decoder architecture in inpainting with reconstruction loss and adversarial loss [10]. [28] and [55] proposes the use of partial and gated convolutions on irregular masks. However, these methods only generate deterministic results. Thus [61] proposes a VAE-based [23] method allowing pluralistic image completion. Recently proposed [60, 26] use StyleGAN [20, 21] architecture for inpainting. [60] combines encoded features from a masked image with a random latent code to co-modulate StyleGAN convolution kernels. [26] has a similar setting as ours as instead of traditional inpainting, they use a foreground model to synthesize high quality foreground objects conditioned on the background context. In both work, diverse images can be generated by sampling different latent codes injected into StyleGAN. But their diversity in the latent code space is restricted due to extra spatial features from the encoder which usually determine most of the aspects of the generation. [45, 56] also try to use transformer to realize diversity in image inpainting. They both use bidirectional attention to predict missing tokens. However, their image quality suffers compared to styleGAN2-based architectures. Also, none of the existing pluralistic inpainting work enables user controllability in the results via latent code disentanglement.
+
+Contrastive learning Contrastive learning [63, 42, 13, 30, 5] has shown great potential in representation learning. Among them, [5] proposes a simple framework for contrastive learning without requiring specialized architectures or memory bank. Recently [31] proposes to use contrastive learning in image translation task. Also, there are a few work [62, 29] studying contrastive learning in the image inpainting task. Like most inpainting methods, [62, 29] use encoder-decoder
+
+architecture. [62] encode more discriminative features using contrastive loss in different semantic sub-regions. [29] applies the contrastive loss to the output features of encoder by setting two identical images with different masks as positive pairs while different images as negative pairs. However, they are both deterministic inpainting methods which means they only produce a single result per input. Different from prior work, instead of learning a better intermediate feature using contrastive loss, we use contrastive learning to achieve disentanglement and diversity in the latent space, enabling us to produce diverse inpainting results for foreground generation in a controllable way.
+
+Disentanglement learning For a generative model, it is desirable to disentangle the factors of variation. One way is to explicitly learn a disentangled latent space: having separate codes for different factors. A large number of work try to disentangle object shape/structure from appearance [39, 27, 37, 7, 49]. Searching for semantic directions in a pre-trained GAN latent space is another way to achieve disentanglement. This method is getting popular recently and both unsupervised methods [43, 17, 36] and supervised methods [19, 35, 52] are heavily explored. Despite the progress made in the field, few work explore it for the foreground generation task. We use contrastive learning to explicitly learn a disentangled latent space for controllable foreground generation.
+
+# 3 Approach
+
+Our goal is to propose a model (ContrasFill) which is able to generate diverse foreground objects for the same masked region while providing control over different factors of generated results. We encode spatial features corresponding to masked image and modulate them with randomly sampled latent codes to generate diverse results. However, without applying explicit training loss on diversity, different latent codes might introduce only minor changes as in [60, 26]. Thus we use contrastive learning to encourage the model to synthesize diverse results by forcing latent codes closer in the latent space to produce images closer in the image space and vice versa. To gain explicit control over certain factor, we also try to disentangle the latent space into two spaces: a known factor space which corresponds to an expected factor, and an unknown factor space which controls the rest of other factors. Section 3.1 introduces the training details for achieving diversity and disentanglement using the contrastive loss. Section 3.2 talks about how do we inject two codes into our model using the proposed bi-modulation.
+
+# 3.1 Contrastive learning for diversity and disentanglement
+
+Figure 2 shows the framework of our method. Our model takes a masked image $I$ with context only and two latent codes as inputs: a known factor code $k$ drawn from a distribution $\phi_{k}$ and an unknown factor code $u$ from a distribution $\phi_{u}$ to output the synthesized image $S$ . If we define our model as $G$ , then we have $S_{k,u,I} = G(k,u,I)$ . Since the input context is independent of the following analysis, we will omit $I$ in $S_{k,u,I}$ for simplicity and talk about the context later.
+
+
+Fig.2. ContrasFill takes as input two sets of codes (squares on the left): known-factor code (e.g., identity) and unknown-factor code (non-identity factors) to synthesize images. Two encoders $(E_{k}$ and $E_{u})$ embed images into different features (bars on the right, color between code and feature refers to correspondence). A contrastive loss forces features with same/different colors closer/further in the feature spaces.
+
+One can refer to supp. for visual examples to help understand the following analysis.
+
+Suppose we sample $N$ codes from each latent space, we will have $N^2$ combinations between the code $k$ and $u$ in total. To enforce a contrastive loss in the known and unknown factor latent spaces, we first define an image pair as:
+
+$$
+p _ {(k, u), \left(k ^ {\prime}, u ^ {\prime}\right)} = \left(S _ {k, u}, S _ {k ^ {\prime}, u ^ {\prime}}\right), \tag {1}
+$$
+
+Note, we do not consider images sharing the same known and unknown codes as a valid pair. In order words, $k = k'$ and $u = u'$ cannot hold at the same time. We will next define the positive and negative pairs used in our contrastive learning scheme. To simplify the explanation, we first consider the case of the known space.
+
+Contrastive pairs in the known space. A positive image pair contains two images sharing the same known codes but different unknown codes (i.e., $k = k', u \neq u'$ in the Eq 1). We define $P_{\mathbf{k},u}$ as a set of all positive pairs associated with the code combination $(k, u)$ in the known space (bold indicates the space). For example, in Figure 2 where we set the known factor as human identity, $P_{\mathbf{k1},u1} = \{p_{(k1,u1),(k1,u2)}\}$ . To ease explanation, we denote $P_{\mathbf{K}}$ as all positive pairs in the known space. Here we have $P_{\mathbf{K}} = \{p_{(k1,u1),(k1,u2)}, p_{(k2,u1),(k2,u2)}\}$ .
+
+For the negative pair, we define two images not sharing the same known codes (i.e., $k \neq k'$ ). In this case, we construct two types of negative pairs. The first case is the hard negative pair where two images sharing different known codes but the same unknown codes (i.e., $k \neq k', u = u'$ , images in each column in Figure 2). The reason is that these images share the same features (e.g., smile) in the unknown space which forces the learned known latent code to control different aspects of the face due to the use of contrastive loss which we will introduce later. Pairs of images sharing different known and unknown codes (i.e., $k \neq k', u \neq u'$ ) are easy negative pairs (diagonal image pairs in
+
+Figure 2). Similarly, we define $N_{\mathbf{k},u}$ as all negative pairs associated with the code combination $(k,u)$ in the known factor space. For example, for image $S_{k1,u1}$ in Figure 2, $N_{\mathbf{k1},u1} = \{p_{(k1,u1),(k2,u1)}, p_{(k1,u1),(k2,u2)}\}$ .
+
+Contrastive loss in the known space. The job of the known space is to control an expected factor during the generation. To push the model to learn this correspondence, we use contrastive learning. The intuition is to push images closer/further if they are positive/negative pairs. In order to measure the distance between two images, we define the similarity score $f$ as:
+
+$$
+f _ {(k, u), \left(k ^ {\prime}, u ^ {\prime}\right)} = e ^ {\operatorname {s i m} \left(\boldsymbol {z} _ {k, u}, \boldsymbol {z} _ {k ^ {\prime}, u ^ {\prime}}\right) / \tau}, \tag {2}
+$$
+
+where $\mathbf{z}_{k,u}$ is the extracted feature of the image $S_{k,u}$ from an encoder, $\mathrm{sim}(\cdot ,\cdot)$ is the cosine similarity and $\tau$ denotes a temperature parameter. To force our known space to control the expected factor, we assume having access to a pretrained and fixed classifier. The encoder $E_{k}$ for the known space will output the penultimate feature of the classifier. For example, in faces, we use a pretrained ArcFace [6] to extract identity features.
+
+For an image $S_{k,u}$ , and its positive pair $S_{k,u'}$ in the known space, the contrastive loss becomes:
+
+$$
+\ell_ {(k, u), (k, u ^ {\prime})} = - \log \frac {f _ {(k , u) , (k , u ^ {\prime})}}{f _ {(k , u) , (k , u ^ {\prime})} + F N _ {\mathbf {k} , u}}, \tag {3}
+$$
+
+where $FN_{\mathbf{k},u}$ is the sum of similarity scores of all negative pairs with respect to the image $S_{k,u}$ . In other words, it is the summation of Eq. 2 over all elements in the $N_{\mathbf{k},u}$ . Finally, the total loss for the known space becomes:
+
+$$
+\mathcal {L} _ {\text {k n o w n}} = \frac {1}{| P _ {\boldsymbol {K}} |} \sum \ell_ {(k, u), (k, u ^ {\prime})}, \tag {4}
+$$
+
+where the summation is over all positive pairs $P_{\kappa}$ in the known space.
+
+Contrastive learning in the unknown space. The contrastive learning idea is similarly applied to the unknown latent space and we highlight the main difference below.
+
+In the unknown space, positive pairs share the same unknown code (each column in Figure 2) and negative pairs have different unknown codes. Similarly, we define $P_U$ as all positive pairs in the unknown space. For example, in Figure 2, $P_U = \{p_{(k1,u1),(k2,u1)}, p_{(k1,u2),(k2,u2)}\}$ . For an image $S_{k,u}$ , we define all negative pairs associated with it in the unknown space as $N_{k,\mathbf{u}}$ (bold indicates space). For example, $N_{k1,\mathbf{u1}} = \{P_{(k1,u1),(k1,u2)}, P_{(k1,u1),(k2,u2)}\}$ . In the unknown space, the image feature $z_{k,u}$ for calculating image pair similarity in the Eq 2 is extracted from an encoder $E_u$ which is trained from scratch. This is because it is hard to define what factors can be controlled in the unknown space beforehand. Also, this avoids pre-training an additional feature extractor and simplifies our approach.
+
+Then, for an image $S_{k,u}$ , and its positive pair $S_{k',u}$ , the counterpart of Eq 3 in the unknown space becomes
+
+$$
+\ell_ {(k, u), \left(k ^ {\prime}, u\right)} = - \log \frac {f _ {(k , u) , \left(k ^ {\prime} , u\right)}}{f _ {(k , u) , \left(k ^ {\prime} , u\right)} + F N _ {k , \mathbf {u}}}, \tag {5}
+$$
+
+where $FN_{k,\mathbf{u}}$ is the sum of similarity score of all negative pairs with respect to image $S_{k,u}$ in the unknown space. The total loss for the unknown space becomes:
+
+$$
+\mathcal {L} _ {\text {u n k n o w n}} = \frac {1}{| P _ {U} |} \sum \ell_ {(k, u), (k ^ {\prime}, u)}, \tag {6}
+$$
+
+where the summation is over all positive pairs in the $P_U$ in the unknown space.
+
+In this way the disentanglement can be learned because we use a pretrained encoder for the known-factor which only extracts expected features, thus the model will synthesize known-factors in images according to codes sampled from known space. For the unknown space, due to the existence of hard negative pair (sharing the same known factors), different unknown codes need to generate factors that are different from known factor to minimize the contrastive loss.
+
+Overall we have the final loss $\mathcal{L}$ as
+
+$$
+\mathcal {L} = \mathcal {L} _ {\text {g a n}} + \lambda_ {1} \mathcal {L} _ {\text {k n o w n}} + \lambda_ {2} \mathcal {L} _ {\text {u n k n o w n}}, \tag {7}
+$$
+
+where $\mathcal{L}_{\text{gan}}$ is the same as the one used in the StyleGAN2 [22]. $\mathcal{L}_{\text{known}}$ and $\mathcal{L}_{\text{unknown}}$ are two contrastive losses in known and unknown latent spaces. $\lambda_{1}$ and $\lambda_{2}$ are their weights. We sample different context (background) for different code combinations (e.g., $N^{2}$ in total) since we want to have the same context distribution for both the real and fake batches when training the discriminator. More details are presented in the supp.
+
+# 3.2 Codes injection with bi-modulated convolution
+
+Our model uses an encoder-decoder architecture (details in the supp). Inspired by StyleGAN2 that shows the effectiveness of modulation, we also use our latent codes to modulate convolution kernels. However, since we have two latent codes, we propose the bi-modulation, where the convolution kernel is modulated by two codes. We use this novel modulation scheme for all convolutions in our model.
+
+Figure 3 shows the bi-modulation process. The two codes $k$ and $u$ first go to two separate fully connected layers to become scaling vectors $s$ and $t$ . The length of scaling vectors is the same as the number of input channels of a convolution kernel. Then the scaling vectors bi-modulate the convolution weight by: $w_{ijk}^{\prime} = s_i\cdot t_i\cdot w_{ijk}$ , where $w$ and $w^{\prime}$ are the original and the bi-modulated weights. $s_i$ and $t_i$ are the scaling factors corresponding to the $i$ th input feature map. $j$ and $k$ enumerate the output feature maps and the spatial footprint of the convolution.
+
+# 4 Experiments
+
+We perform quantitative and qualitative evaluations via comparing our proposed foreground generation model ContrasFill with prior arts.
+
+
+Fig. 3. The proposed bi-modulation scheme, where convolution kernels are modulated by two disentangled latent codes.
+
+Datasets. We conduct the evaluation on three different datasets: 1) Face. We use CelebAMask-HD [25] that includes 30,000 face images with segmentation masks. We follow the official training/testing split. To acquire more training data, we use a publicly available face parsing model [1] on FFHQ [21] as extra training data. We use a pretrained face recognition model [6] as our known factor feature extractor. 2) Bird. We use the bird category from LSUN dataset [54]. We choose images greater than certain resolution and run the pretrained MaskR-CNN [14,47] to remove bad images. In total, we have 34,969 images and we randomly select $10\%$ (3,497) as test data. We train a fine-grained classification model [9] on the CUB dataset [44] as our known factor feature extractor. 3) Car. We use the car category from LSUN dataset [54] and same preprocessing steps to clean our data. In total, we have 77,840 images and we randomly select $10\%$ (7,784) as test data. We train a shape classifier [9] on the Stanford car dataset [24] as our known factor feature extractor. To measure the extent of our ability to synthesize diverse results, we use the object bounding box as the missing region in our main study.
+
+We train our model at $256 \times 256$ resolution on all datasets. Our unknown factor code is drawn from the normal distribution. Our known factor codes are drawn from one-hot distribution for the cars and birds; for faces, we choose to draw from a hypersphere which is the feature distribution of penultimate layer of ArcFace. We sample $N = 8$ different known and unknown codes in each training minibatch. Due to memory issue, we can not fit all 64 combinations, thus we subsample one hard negative pair for each code, resulting in a batch size of 16 during training. Please refer to supp for more dataset and implementation details.
+
+Baselines. We mainly compare with: 1) CollageGAN [26], which generates foreground object conditioned on the background; 2) CoModGAN [60], a state-of-the-art image inpainting model. These two methods, built on top of StyleGAN2 [22], are able to generate multiple results via sampling codes in the latent space; 3) BAT-fill [56], a recently proposed two-stage inpainting model using transformer. It first autoregressively predicts missing tokens in a $32 \times 32$ image with bidirectional attention, and then use a convolutional network to perform upsampling to $256 \times 256$ . It samples different plausible missing tokens in the $32 \times 32$ grid to achieve diversity. This work has demonstrated the benefits of adding autoregressive predication over other transformer-based inpainting work [45]. We train all baseline models with the same input mask setting as ours.
+
+
+Fig. 4. We can achieve diverse samples from the same masked image by sampling in both known and unknown code spaces.
+
+Evaluation. We use the following metrics: 1) FID [15] measures the quality and diversity by comparing distributions between the real and the generated images. 2) LPIPS [58] measures distance between two images in deep feature space. For each testing image, we compare pairs of inpainting results generated from the same input mask, we use this to measure diversity. 3) Known Factor Feature Angle (KFFA). To better understand how we can improve result diversity using the disentangled known factor, we sample 10 inpainting results for each input image. Then we compute deep features of these 10 results from a known factor classifier. We report average angle between all normalized feature pairs. For a fair comparison, we use feature extractors different from the one used in the training. For face, we use CurricularFace [16], and for bird and car, we train a new classifier using the VGG architecture [38]. Note that L1, SSIM and PSNR are also commonly used metrics for inpainting tasks. However, they all favor deterministic methods which aim to reproduce the single ground truth. As pointed out by [45], these metrics are more suitable for small mask cases where the synthesized contents are more likely to be similar to the ground truth. With large holes covering an entire semantic region or object, synthesized diverse contents might look plausible but different from the ground truth.
+
+# 4.1 Qualitative results
+
+Figure 4 shows random samples from our model given the same masked input. Our method can generate diverse identities, facial attributes for faces and synthesize diverse shapes, poses and object appearances for birds and cars. Figure 5
+
+
+Fig. 5. Compared with the baselines, our method generates more diverse results. For faces, we have more variations in identity. For birds and cars, we have different object shapes and textures.
+
+shows side-by-side comparisons between our method and other baselines. Our results on faces are more diverse compared to CoModGAN [60] and CollageGAN [26]. For unaligned dataset (cars and birds), these two methods tend to generate results with the same shape. BAT-fill [56] results have better diversity, but lower image quality. It sometimes generates artifacts on faces or distorted geometries for cars.
+
+We also evaluate how disentangled our results are in Figure 6. Each column shares the same known factor and each row shares the same unknown factor. For faces, the known code controls identity and the unknown code controls facial attributes such as smile, glass and lighting condition. For cars, the known code controls car shape (e.g., sedan-like and wagon-like in the second and third column), and the unknown code changes color and orientation. For birds, the known factor changes species (color is associated with species) and the unknown factor changes pose and orientation. When one latent code changes, the image changes only along the direction it is supposed to, e.g., as the identities change, the same facial expression remains within each row in the face results.
+
+
+Fig. 6. Known factor code is same for each column, unknown factor code is same for each row.
+
+ | Face | Bird | Car |
| FID | LPIPS | KFFA | FID | LPIPS | KFFA | FID | LPIPS | KFFA |
| CoModGAN | 8.88 | 0.045 | 52.41 | 11.35 | 0.090 | 52.45 | 6.59 | 0.183 | 44.34 |
| CollageGAN | 8.77 | 0.069 | 66.00 | 12.11 | 0.100 | 61.08 | 6.57 | 0.191 | 48.67 |
| BAT-Fill | 15.08 | 0.102 | 75.98 | 37.15 | 0.117 | 55.41 | 22.20 | 0.270 | 51.98 |
| ContrasFill-1 | 8.40 | 0.072 | 74.71 | 11.29 | 0.151 | 66.06 | 6.24 | 0.310 | 63.09 |
| ContrasFill (Ours) | 8.36 | 0.075 | 83.66 | 11.97 | 0.160 | 74.58 | 6.46 | 0.327 | 82.96 |
+
+Table 1. Our method has comparable image quality with the state-of-the-art, but with more diversity.
+
+# 4.2 Image quality and diversity
+
+Besides our model ContrasFill, we also evaluate one variant of our approach, where we only have one latent space using contrastive learning without explicit latent disentanglement (denoted as "ContrasFill-1", see supp for details about this variant). This entangled latent space models all factors together for generation. It is used to show the effectiveness of the contrastive loss on diversity.
+
+Table 1 shows comparison in terms of image quality (FID) and diversity (LPIPS for overall, KFFA for known factor). Overall, our model has comparable image quality with the state-of-the-art methods, and it performs favorably against all baselines in terms of known factor diversity, especially compared with CoModGAN [60] and CollageGAN [26]. We also have the highest overall diversity on bird and car datasets. Although, BAT-fill [56] has better LPIPS distance in face dataset, but their image quality is worse (Figure 5) and they sometimes generate artifacts, which can often results in larger LPIPS difference. Our model also has better diversity, especially on the known factors, compared with our single code variant (ContrasFill-1).
+
+We also compared with UCTGAN [59] which is designed for diverse hole filling. Due to code unavailability, we only compare with it in CelebA-HQ dataset and use the same setting as theirs. Here we measure diversity LPIPS for full output and only mask region. We grab their numbers and notations (ours first): $I_{out}$ : 0.036 vs 0.030; $I_{out(m)}$ : 0.101 vs 0.092.
+
+
+Fig. 7. Moving along the discovered identity direction causes changes in non-identity factors such as facial expressions and lighting for baselines. Our results only vary in identity.
+
+# 4.3 Disentanglement study
+
+We compare with baselines to show that having two explicit latent spaces improves the disentanglement. Recent works [43, 17, 36] show that postprocessing can be applied to find disentangled latent directions in a pretrained GAN space. Thus we use a supervised method [35] to find known factor directions for CoModGAN, CollageGAN and ContrasFill-1. We use pretrained known factor classifiers to get labels for sampled latent codes and then train a linear regressor to find latent directions [35]. We do not compare with BAT-fill since they lack controllability.
+
+Next, we generate images with different known factors. For baselines, given a masked image, we first randomly sample a latent code, and then move along the discovered known direction to generate 10 different results. For our approach, since we have a disentangled space, thus we directly sample 10 different codes in known factor space by fixing unknown code. We calculate KFFA for 1,000 different contexts and report the average number in the Table 2. Our model has the best KFFA scores. This demonstrates the benefit of having an explicitly disentangled latent space.
+
+Since we has two spaces, we also conduct an experiment where we fix our known code and randomly sample 10 unknown codes. The last row of Table 2 shows the average KFFA numbers over 1,000 context images which indicates when unknown factor varies, our known factor is less influenced. Please refer to Figure 6 for qualitative results.
+
+We also visually examine the baselines in Figure 7. By moving along the discovered known (identity) direction, those baselines not only change identity to some extent, but also alter other attributes, such as smile, skin tone, and gaze, whereas our sampled results maintain the attributes controlled by the unknown factor while the known factor changes. This means that certain factors such as human identity can not be easily disentangled during the latent direction discovery stage even with explicit supervision. We also show that this is true for vanilla unconditional StyleGAN [21, 22] in the supp. Note, we move large steps in two directions on purpose (leftmost and rightmost) to show the full effect of the discovered directions. Details about this study can be found in the supp.
+
+ | face | bird | car |
| CoModGAN | 56.00 | 47.55 | 44.25 |
| CollageGAN | 57.78 | 58.15 | 47.49 |
| ContrasFill-1 | 67.40 | 61.14 | 52.01 |
| ContrasFill | 82.03 | 75.20 | 83.71 |
| ContrasFill (known fixed) | 26.15 | 21.69 | 35.47 |
+
+Table 2. High KFFA shows our latent space is more diverse compared with discovered latent directions in baselines. The last row is a different setting, please refer the text.
+
+
+Fig. 8. Our model can generate diverse disentangled results in semantic mask case.
+
+
+
+# 4.4 Ablation
+
+Other type of masks. We also analyze our model's performance on the inpainting task where the input mask is of the shape of an object instead of a box. In this case, our model can no longer change the object shape and pose but can still generate diverse appearance in the mask. Figure 8 (left) shows that our results are more diverse than CoModGAN and CollageGAN, especially on human identity. BAT-fill has worse image quality. We can also achieve disentanglement (Figure 8 right). We compare image quality and diversity (LPIPS for overall, KFFA for known factor), and report numbers in Table 3 (left) for the face dataset. We also study the case of arbitrarily-shaped masks that cover part of the object in random places (e.g., half of face is hidden); see supp for details.
+
+Latent codes injection method. To study the effectiveness of our bi-modulated convolutions (Figure 3), we try the following alternative approaches: (1) We concatenate $s$ with $t$ and pass the result to fully-connected layers to output a single scale vector to modulate the convolutions (denoted as "concat"); (2) We use each code to modulate a different set of convolution kernels. And the two sets of modulated convolutions are sequentially applied to image features. Depending on the order, we denote them as "k-u" and "u-k" (k and u stand for known and unknown codes). The first three columns of Table 3 (right) indicate that, these
+
+ | CoMod | Collage | BAT | Ours | | concat | u-k | k-u | reprdict | Ours |
| FID | 5.73 | 6.07 | 11.97 | 5.95 | FID | 8.64 | 8.41 | 8.42 | 14.41 | 8.41 |
| LPIPS | 0.029 | 0.029 | 0.050 | 0.048 | LPIPS | 0.048 | 0.052 | 0.056 | 0.120 | 0.075 |
| KFFA | 51.19 | 58.73 | 72.48 | 83.39 | KFFA | 48.99 | 78.19 | 77.58 | 86.87 | 83.06 |
+
+Table 3. (Left) Comparison in mask case. Our method has comparable image quality but with more diversity on faces when using face masks as inpainting regions. (Right) Ablation. results indicate the effectiveness of bi-modulation (the first three columns) and contrastive loss (4th column).
+
+alternative designs achieve similar image quality, but lower level of diversity. Our bi-modulation is a more direct way to inject information to the generator which makes the learning process easier compared with the "concat" alternative. The approach of applying two separate sets of convolutions results in poor diversity. We hypothesize that the later convolution set may undo what is learnt by the previous set as their objective functions are different (factors in two spaces should learn different things).
+
+The loss choice. We use the contrastive loss to encourage diversity by forcing images with the same latent codes to have similar factors. Another way to learn this correspondence is to repredict the input code from the resulting image. For example, by sampling a code in the identity space, one can use ArcFace to repredict this code from the generated image. Table 3 (right 4th column) shows that replacing the contrastive loss with reprediction loss encourages more diversity, but at the cost of image quality. This is because a foreground generation model needs to consider the compatibility between the sampled latent code and the input context. For example, if the context contains light skin pixels on the neck, then latent codes that generate dark-skinned faces are not compatible. However, the reprediction loss forces the model to synthesize a dark-skinned face, which may not look real according to the discriminator. However if a contrastive loss is applied, which considers the relative distance in the feature space, then the model can adjust the input identity code based on the context information to synthesize a face that looks more plausible in the context.
+
+# 5 Conclusion and Limitations
+
+We propose ContrasFill, a novel approach for diverse and controllable foreground generation by contrastive learning. We demonstrate superior diversity and controllability over previous work. Our method has some limitations. We found that our model is sometimes sensitive to the pretrained classifier which may be biased due to the training data. For example, certain types of car are more common in certain color (e.g., van are usually white). Thus our model may also be biased. Acknowledgement This work was supported in part by Sony Focused Research Award, NSF CAREER IIS-2150012, Wisconsin Alumni Research Foundation, and NASA 80NSSC21K0295.
+
+# References
+
+1. https://github.com/zllrunning/faceParsing.pytorch
+2. Ballester, C., Bertalmio, M., Caselles, V., Sapiro, G., Verdera, J.: Filling-in by joint interpolation of vector fields and gray levels. IEEE Transactions on Image Processing 10(8), 1200-1211 (2001). https://doi.org/10.1109/83.935036
+3. Barnes, C., Shechtman, E., Finkelstein, A., Goldman, D.B.: Patchmatch: a randomized correspondence algorithm for structural image editing. In: SIGGRAPH 2009 (2009)
+4. Bertalmio, M., Sapiro, G., Caselles, V., Ballester, C.: Image inpainting. pp. 417-424 (01 2000)
+5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.E.: A simple framework for contrastive learning of visual representations. ArXiv abs/2002.05709 (2020)
+6. Deng, J., Guo, J., Zafeiriou, S.: Arcface: Additive angular margin loss for deep face recognition. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 4685-4694 (2019)
+7. Denton, E.L., Birodkar, V.: Unsupervised learning of disentangled representations from video. ArXiv abs/1705.10915 (2017)
+8. Ding, D., Ram, S., Rodríguez, J.J.: Image inpainting using nonlocal texture matching and nonlinear filtering. IEEE Transactions on Image Processing 28, 1705-1719 (2019)
+9. Du, R., Chang, D., Bhunia, A.K., Xie, J., Song, Y.Z., Ma, Z., Guo, J.: Fine-grained visual classification via progressive multi-granularity training of jigsaw patches. In: European Conference on Computer Vision (2020)
+10. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: NeurIPS (2014)
+1. Guo, X., Yang, H., Huang, D.: Image inpainting via conditional texture and structure dual generation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 14134-14143 (October 2021)
+2. Hays, J., Efros, A.A.: Scene completion using millions of photographs. In: SIGGRAPH 2007 (2007)
+3. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.B.: Momentum contrast for unsupervised visual representation learning. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 9726-9735 (2020)
+4. He, K., Gkioxari, G., Dollar, P., Girshick, R.B.: Mask r-cnn. IEEE Transactions on Pattern Analysis and Machine Intelligence 42, 386-397 (2020)
+5. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. In: NIPS (2017)
+6. Huang, Y., Wang, Y., Tai, Y., Liu, X., Shen, P., Li, S., Jilin Li, F.H.: Curricularface: Adaptive curriculum learning loss for deep face recognition pp. 1-8 (2020)
+7. Härkönen, E., Hertzmann, A., Lehtinen, J., Paris, S.: Ganspace: Discovering interpretable gan controls. In: Proc. NeurIPS (2020)
+8. Iizuka, S., Simo-Serra, E., Ishikawa, H.: Globally and locally consistent image completion. ACM Transactions on Graphics (TOG) 36, 1-14 (2017)
+9. Jahanian, A., Chai, L., Isola, P.: On the "steerability" of generative adversarial networks. In: International Conference on Learning Representations (2020)
+20. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: CVPR (2018)
+
+21. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: CVPR (2019)
+22. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of StyleGAN. In: Proc. CVPR (2020)
+23. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. CoRR abs/1312.6114 (2014)
+24. Krause, J., Stark, M., Deng, J., Fei-Fei, L.: 3d object representations for fine-grained categorization. In: 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13). Sydney, Australia (2013)
+25. Lee, C.H., Liu, Z., Wu, L., Luo, P.: Maskgan: Towards diverse and interactive facial image manipulation. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2020)
+26. Li, Y., Li, Y., Lu, J., Shechtman, E., Lee, Y.J., Singh, K.K.: Collaging class-specific gans for semantic image synthesis. ICCV (2021)
+27. Li, Y., Singh, K.K., Ojha, U., Lee, Y.J.: Mixmatch: Multifactor disentanglement and encoding for conditional image generation. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 8036-8045 (2020)
+28. Liu, G., Reda, F.A., Shih, K.J., Wang, T.C., Tao, A., Catanzaro, B.: Image inpainting for irregular holes using partial convolutions. ECCV abs/1804.07723 (2018)
+29. Ma, X., Zhou, X., Huang, H., Chai, Z., Wei, X., He, R.: Free-form image inpainting via contrastive attention network. 2020 25th International Conference on Pattern Recognition (ICPR) pp. 9242-9249 (2021)
+30. Misra, I., van der Maaten, L.: Self-supervised learning of pretext-invariant representations. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 6706-6716 (2020)
+31. Park, T., Efros, A.A., Zhang, R., Zhu, J.Y.: Contrastive learning for unpaired image-to-image translation. In: ECCV (2020)
+32. Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., Efros, A.A.: Context encoders: Feature learning by inpainting. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) pp. 2536-2544 (2016)
+33. Ren, Y., Yu, X., Zhang, R., Li, T.H., Liu, S., Li, G.: Structureflow: Image inpainting via structure-aware appearance flow. 2019 IEEE/CVF International Conference on Computer Vision (ICCV) pp. 181-190 (2019)
+34. Sagong, M.C., Shin, Y.G., Kim, S.W., Park, S., Ko, S.: Pepsi: Fast image inpainting with parallel decoding network. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 11352-11360 (2019)
+35. Shen, Y., Gu, J., Tang, X., Zhou, B.: Interpreting the latent space of gans for semantic face editing. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 9240-9249 (2020)
+36. Shen, Y., Zhou, B.: Closed-form factorization of latent semantics in gans. ArXiv abs/2007.06600 (2020)
+37. Shu, Z., Sahasrabudhe, M., Güler, R.A., Samaras, D., Paragios, N., Kokkinos, I.: Deforming autoencoders: Unsupervised disentangling of shape and appearance. In: ECCV (2018)
+38. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. CoRR abs/1409.1556 (2015)
+39. Singh, K.K., Ojha, U., Lee, Y.J.: Finegan: Unsupervised hierarchical disentangle-ment for fine-grained object generation and discovery. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 6483-6492 (2019)
+
+40. Suin, M., Purohit, K., Rajagopalan, A.N.: Distillation-guided image inpainting. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 2481-2490 (October 2021)
+41. Telea, A.: An image inpainting technique based on the fast marching method. Journal of Graphics Tools 9 (01) (2004). https://doi.org/10.1080/10867651.2004.10487596
+42. Tian, Y., Krishnan, D., Isola, P.: Contrastive multiview coding. In: ECCV (2020)
+43. Voynov, A., Babenko, A.: Unsupervised discovery of interpretable directions in the gan latent space. ArXiv abs/2002.03754 (2020)
+44. Wah, C., Branson, S., Welinder, P., Perona, P., Belongie, S.: The Caltech-UCSD Birds-200-2011 Dataset. Tech. Rep. CNS-TR-2011-001 (2011)
+45. Wan, Z., Zhang, J., Chen, D., Liao, J.: High-fidelity pluralistic image completion with transformers. ICCV (2021)
+46. Wang, Y., Tao, X., Qi, X., Shen, X., Jia, J.: Image inpainting via generative multicolor convolutional neural networks. In: NeurIPS (2018)
+47. Wu, Y., Kirillov, A., Massa, F., Lo, W.Y., Girshick, R.: Detector2. https://github.com/facebookresearch/detectron2 (2019)
+48. Xie, C., Liu, S., Li, C., Cheng, M.M., Zuo, W., Liu, X., Wen, S., Ding, E.: Image inpainting with learnable bidirectional attention maps. 2019 IEEE/CVF International Conference on Computer Vision (ICCV) pp. 8857-8866 (2019)
+49. Xing, X., Gao, R., Han, T., Zhu, S.C., Wu, Y.N.: Deformable generator network: Unsupervised disentanglement of appearance and geometry. IEEE transactions on pattern analysis and machine intelligence PP (2020)
+50. Xiong, W., Yu, J., Lin, Z.L., Yang, J., Lu, X., Barnes, C., Luo, J.: Foreground-aware image inpainting. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 5833-5841 (2019)
+51. Yan, Z., Li, X., Li, M., Zuo, W., Shan, S.: Shift-net: Image inpainting via deep feature rearrangement. ArXiv abs/1801.09392 (2018)
+52. Yang, C., Shen, Y., Zhou, B.: Semantic hierarchy emerges in deep generative representations for scene synthesis. Int. J. Comput. Vis. 129, 1451-1466 (2021)
+53. Yang, C., Lu, X., Lin, Z.L., Shechtman, E., Wang, O., Li, H.: High-resolution image inpainting using multi-scale neural patch synthesis. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) pp. 4076-4084 (2017)
+54. Yu, F., Zhang, Y., Song, S., Seff, A., Xiao, J.: Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. ArXiv abs/1506.03365 (2015)
+55. Yu, J., Lin, Z.L., Yang, J., Shen, X., Lu, X., Huang, T.S.: Free-form image inpainting with gated convolution. 2019 IEEE/CVF International Conference on Computer Vision (ICCV) pp. 4470-4479 (2019)
+56. Yu, Y., Zhan, F., Wu, R., Pan, J., Cui, K., Lu, S., Ma, F., Xie, X., Miao, C.: Diverse image inpainting with bidirectional and autoregressive transformers. Proceedings of the 29th ACM International Conference on Multimedia (2021)
+57. Zeng, Y., Fu, J., Chao, H., Guo, B.: Learning pyramid-context encoder network for high-quality image inpainting. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 1486-1494 (2019)
+58. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR (2018)
+59. Zhao, L., Mo, Q., Lin, S., Wang, Z., Zuo, Z., Chen, H., Xing, W., Lu, D.: Uctgan: Diverse image inpainting based on unsupervised cross-space translation. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 5740-5749 (2020)
+
+60. Zhao, S., Cui, J., Sheng, Y., Dong, Y., Liang, X., Chang, E.I.C., Xu, Y.: Large scale image completion via co-modulated generative adversarial networks. ArXiv abs/2103.10428 (2021)
+61. Zheng, C., Cham, T., Cai, J.: Pluralistic image completion. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) pp. 1438-1447 (2019)
+62. Zhou, X., Li, J., Wang, Z., He, R., Tan, T.: Image inpainting with contrastive relation network. 2020 25th International Conference on Pattern Recognition (ICPR) pp. 4420-4427 (2021)
+63. Zhuang, C., Zhai, A., Yamins, D.: Local aggregation for unsupervised learning of visual embeddings. 2019 IEEE/CVF International Conference on Computer Vision (ICCV) pp. 6001-6011 (2019)
\ No newline at end of file
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/images.zip b/contrastivelearningfordiversedisentangledforegroundgeneration/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9b6dff5ffc477344ca4dfd450009bbbe1410c6f6
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:299320371a26dadffce79c93a51292ccd8978623442dd41d758e54d16bc1e09d
+size 619250
diff --git a/contrastivelearningfordiversedisentangledforegroundgeneration/layout.json b/contrastivelearningfordiversedisentangledforegroundgeneration/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..bd3ab42cb06233baea1c3aebcb0ff5291997847a
--- /dev/null
+++ b/contrastivelearningfordiversedisentangledforegroundgeneration/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7aa006109e833e514de0be7a142663fbe0219bbf6b58e2ecdcb70b53bac39e63
+size 385538
diff --git a/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_content_list.json b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9fe4f192e428f5d92fe698181551d267037d12a5
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:775e5a9b0906a0efdb7518507c4d7bac78cd9537dc36692bcb95bc7f366d5795
+size 90551
diff --git a/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_model.json b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4b31f790c4df713c9a34a7ac40bc1acda78ebda6
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb22c21bbff42ab59529b15451709ebdd6cf41b054050e8c909fce5164f3f136
+size 117467
diff --git a/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_origin.pdf b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..46a20d1ec091aac99f2f5dc7e0a0865e6467edd5
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/911e6941-a324-45cf-8796-cef27130b663_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e40e7066fa1a9013d8a17f64aa8c840ba8d22338684c7a5ef04cf63a61ea905f
+size 8407403
diff --git a/contrastivemonotonicpixellevelmodulation/full.md b/contrastivemonotonicpixellevelmodulation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b7b33c6f3d42c03af8a47d10aa9028da9e55cdfd
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/full.md
@@ -0,0 +1,377 @@
+# Contrastive Monotonic Pixel-Level Modulation
+
+Kun Lu, Rongpeng Li, and Honggang Zhang
+
+Zhejiang University, Hangzhou, China {lukun199, lirongpeng, honggangzhang}@zju.edu.cn
+
+Abstract. Continuous one-to-many mapping is a less investigated yet important task in both low-level visions and neural image translation. In this paper, we present a new formulation called MonoPix, an unsupervised and contrastive continuous modulation model, and take a step further to enable a pixel-level spatial control which is critical but can not be properly handled previously. The key feature of this work is to model the monotonicity between controlling signals and the domain discriminator with a novel contrastive modulation framework and corresponding monotonicity constraints. We have also introduced a selective inference strategy with logarithmic approximation complexity and support fast domain adaptations. The state-of-the-art performance is validated on a variety of continuous mapping tasks, including AFHQ cat-dog and Yosemite summer-winter translation. The introduced approach also helps to provide a new solution for many low-level tasks like low-light enhancement and natural noise generation, which is beyond the long-established practice of one-to-one training and inference. Code is available at https://github.com/lukun199/MonoPix.
+
+Keywords: Pixel-level modulation, Continuous monotonic translation, contrastive training
+
+# 1 Introduction
+
+Deep learning has significantly revolutionized the way we process and represent images. Though in most high-level tasks, we may safely assume that the input-ground truth pairs are deterministic and perfectly aligned [23,17,45] (e.g., class labels, bounding boxes, and key points), it does not hold true in many low-level scenarios. In low-light image enhancement [46,6] and natural noise generation [9,32] for instance, the ever-changing environment makes it even impossible to provide firm ground truth pairs. Directly adopting a one-to-one (O2O) mapping on these pseudo labels can result in several problems: in the training stage, it ignores the one-to-many (O2M) mapping property, and inherently invites certain divergence and instability; for evaluation and deployment purposes, it incurs large variance in different environments [38] and lacks certain scalability.
+
+To enable O2M mappings, a direct solution is to introduce conditional generative models [29,7], or carry out a multi-branch ensemble on several sub-modules [47,53]. The major obstacle comes from the lack of dense and varied discrete image pairs to support the subsequent training. Some other methods approach
+
+continuous generation by interpolating between two models, or tuning an extra adaptation module [21,62,68,22,37]. Nevertheless, methods in this category involve two correlated networks which are usually obtained from a fine-tuning or re-training. As a result, they not only prevent an end-to-end training, but also increase the storage burden and inference complexity. Moreover, all these methods can suffer from a training-inference gap that, a discrete training is not sufficient to provide a continuous modulation at inference stage.
+
+On the other hand, through the content and style disentanglement [36,31,12], it is shown that a single generative network is capable of handling varied styles and attributes in an end-to-end manner, and provides a smooth generation by style interpolation [31,13]. To better secure the intermediate generation quality, works on continuous cross-domain translation further propose to constrain the in-between samples by coordinating two domain discriminators [18,51], or introducing some extra constraints [71]. However, to obtain a desired output, a user either has to change the random style noise at an unpredictable time complexity, or is required to provide a proper reference style which may not always be plausible. In addition, these methods are primarily focused on an image-level holistic style translation, but not typically designed for many tasks where a pixel-level modulation is preferred.
+
+These limitations pique our interest; and we therefore devote to providing a new solution that simultaneously enables an unsupervised, end-to-end, continuous, and monotonic pixel-level image control. By injecting a spatial controlling signal into the feature space, and benefiting from the inductive bias of convolutions, we render it possible to directly manipulate from a fine-grained image-like interface. The monotonicity control is inspired by the recent progress on contrastive learning [72,10] and image-to-image translation [18,51], where we further devise a contrastive modulation scheme that connects the control monotonicity
+
+
+Fig. 1: Overview of MonoPix framework. Blue blocks are learnable parts. CIG denotes contrastive intensity generator (a procedure) that randomly produces two spatial control signals $c_1$ and $c_2$ for contrastive training. $\Delta_{X\mapsto Y}$ is the confidence difference. (a) During training, we model the monotonicity between control signal and domain confidence. (b) We enable multiple inference strategies or perform fast adaptation through another expert network
+
+with the confidence level of a domain discriminator. In this way, one image more "resembles" the target domain will get rewarded with a higher discriminator score; and the training could proceed without any other style level supervisions. A similar previous work CUT [54] introduces patchwise contrastive loss (on different patches) for image translation, while it does not support image editing and O2M mapping. A schematic illustration of our approach can be found in Figure 1. Simple though these ideas are, they construct a competitive new solution for continuous domain translation, typically those in conjunction with conventional low-level tasks.
+
+We summarize the contributions of this work:
+
+- We investigate a new research area of continuous pixel-level image modulation which has not been particularly investigated before, and provide the corresponding solution. The surveyed topic enables an interesting unsupervised continuous translation and provides a fine-grained image editing tool.
+- We propose a new contrastive learning-based solution for continuous image translation, which can be seamlessly integrated into existing GAN-based one-to-one mapping schemes, and is both training and inference-efficient. The proposed approach does not need any domain-specific labels and has no training and inference gap.
+- We provide several basic evaluation metrics for continuous generation, and validate the state-of-the-art performance of the proposed model on both the translation continuity and quality. Extensive results on low-level tasks also demonstrate the effectiveness of our proposed approach.
+- We are one of the first that revisit the long-established O2O mapping protocol in many low-level tasks. Our work suggests it is plausible and probably more flexible to formulate them in an O2M or M2M manner instead.
+
+# 2 Related Work
+
+One-to-Many Mappings in Low-Level Task. O2M mapping commonly occurs in low-level image processing. It is evidenced in recent literature that many tasks, such as deraining [53], noise modeling [7,21,22], and low-light image enhancement [34,64,29] can be categorized into this scope. Data-guided approaches model the diversity with synthesized one-to-many pairs (usually with physical models) and generate them with the corresponding control signals [29,7,22,5,57]. As an alternative to the dense training pairs, image modulation methods address this task in a two-stage training manner. Upchurch et al. [66] propose to train two networks and implement feature interpolations. In CFSNet [67] the extra network is further simplified into only a tuning branch. Inspired by the normalization operations, He et al. [21] propose to insert a per-layer modulation module and adjust them when trained on another enhancing level. Similarly, DynamicNet [62] performs adaptation with several extra tuning blocks. Besides feature interpolation, it is also shown that modulations can take place via interpolation on the network parameters [68] or image residuals [22]. There are also
+
+some efforts that attempt to perform consecutive enhancement [75,58], but the increased complexity and lack of control range also limit their applications.
+
+In contrast, we present a continuous modulation in a totally unsupervised1, end-to-end, and inference-efficient manner by training a single network that executes all these tasks. There is no training and inference gap in the proposed approach, which by design allows a continuous and realistic generation.
+
+Image-to-Image Translation. CNN-based image translation mainly takes the style representation as an auxiliary loss [16,39,30,63]. Different from designing explicit style descriptors, it is observed by Dumoulin et al. [15] that incorporating an affine transformation after the instance normalization (IN) [65] layer can lead to a conditional style generation, which further inspires data-driven style manipulation methods like AdaIN [25] and WCT [41]. StyleBank [8], on the other hand models the style translation with a trainable bank that disentangles the style representation. It is also shown in [76] and [40] that by injecting the style information as part of the input, the model can generate varied samples with the same set of parameters.
+
+As another line of work, GAN [19] provides an important tool for image translation. Pioneering works like Pix2Pix [27] and CycleGAN [80] introduce adversarial and unsupervised conditional generation, but are O2O mapping models. To enable a diverse translation, non-one-to-one mappings are thereafter investigated [12,48,26,3]. As one of the most popular and successful schemes, disentangling the content and style representation exhibits a great success on a wealth of attribute and style translation tasks [36,26,13,73,31], and enables a continuous translation by interpolating between two latent vectors [31,13]. Recently, works on continuous cross-domain translation further refine the quality of intermediate images by introducing an interpolation discriminator [71,43], constraining the intermediate results with discriminators from both sides [18,51], or by exploiting the path of interpolation and translation manifold [11,56,44].
+
+Different from these existing works, the proposed approach eschews the need for either any extra discriminator or a weighted bi-lateral supervision that can hardly scale to model many-to-one mappings. Instead, we teach one discriminator by contrastively feeding two samples and modeling the consistency between control signals and translation monotonicity.
+
+Image Editing. Our work is also related to image editing. This task can be achieved generally by learning a conditional image-level mapping [27,80,35,49] or by exploring the latent semantic trajectories [2,79,14,60,82]. Modern image editing methods prove to be effective in modeling multiple image-level features such as semantic contents, geometric shapes, and styles [61,42]; but there are a few that provide a spatial control [33,81,55], and typically in an unsupervised manner. The proposed method, further, provides a fine-grained, unsupervised, and spatial-level editing, whilst exhibiting both fidelity to inputs and a strong scalability for style and content manipulation.
+
+# 3 Continuous Cross-Domain Pixel-Level Control
+
+First we formalize a brief description of the newly examined task. Consider two domains $X$ and $Y$ each with corresponding image samples i.e. $\{\pmb{x}_i\}_{i=1}^M$ and $\{\pmb{y}_i\}_{i=1}^N$ , together with a control signal $\pmb{c}$ of the shape $W \times H$ representing the translation intensity of each pixel. We learn a mapping function $G_{X \mapsto Y}: X \times C \mapsto Y$ that translates from $X$ to $Y$ , and from $Y$ to $X$ if necessary. Moreover, the translation is required to be monotonic. Thus, for each image or patch $\pmb{x}_i$ and two control signals $\pmb{c}_1$ and $\pmb{c}_2$ , we require the translated result $G_{X \mapsto Y}(\pmb{x}_i, \pmb{c}_2)$ better belongs to the target domain $Y$ than its counterpart if $c_2^{i,j} > c_1^{i,j}$ for each pixel position. In the following, we will elaborate on the detailed framework and corresponding loss functions that lead to accomplishing this goal.
+
+# 3.1 Pixel-Level Contrastive Generation
+
+In existing works on unsupervised domain translation, the conditional style vector is usually constructed as a flat one [31,12] or with coarse spatial shapes [33]. These approaches are moderately satisfactory when controlling the local attributes, but can not enable a fine-grained control.
+
+To tackle this problem, we first visit the pixel-level control signal. This idea is plain and easy to implement, where we can directly formulate the control signal as an extra input channel. Without loss of generality, we always assume that the pixel-level control signal is bounded in $[0,1]$ . Then, the translated result $\hat{\pmb{y}}$ of an input $\pmb{x}$ could be represented as (and vice versa from $Y$ to $X$ )
+
+$$
+\hat {\boldsymbol {y}} = G _ {X \mapsto Y} (\operatorname {c o n c a t} (\boldsymbol {x}, \boldsymbol {c})) \quad \text {f o r e a c h} \quad c ^ {i, j} \in [ 0, 1 ] \tag {1}
+$$
+
+However, to enable such a pixel-level training is non-trivial. First, modern training schemes and datasets are only focused on holistic attributes, but there are no pixel-level labels. Second, we do not have a gallery of domain-specific intermediate labels that guide the modulation process, except for the coarse binary tags - 0 or 1, which can not model the domain distribution and precludes conventional absolute intensity-based training. To overcome these problems, we propose to formulate a contrastive learning-based approach instead, that trains the domain generator $G$ by relative intensity. In the training stage, we first randomly generate two pixel-level control signals $c_{1}$ and $c_{2}$ for each input patch, then we encourage the discriminator to yield a higher domain-specific confidence level for that with a higher translation strength. Since the discriminator $D$ is trained to examine both the quality and domain-specific features of generated images, a higher confidence level for $D$ means a better likelihood that the output belongs to the target domain. This is different from DLOW [18], who needs to train two discriminators and overlooks the underlying data distributions in the source domain. Note that in the training stage, we empirically set a control signal $c$ as one filled with the same value (i.e., $c^{1,1} = c^{1,2} = \ldots = c^{W,H}$ ), considering the randomness of control signal and the inductive bias of convolutional operation. On the contrary, assigning each $c^{i,j}$ with randomly generated numbers during training is tedious, and also violates the smoothness of neighboring pixels.
+
+# 3.2 Normalization-Compatible Translator
+
+Although concatenating the pixel-level control signal $\pmb{c}$ can be direct and simple, it is incompatible with commonly used instance normalization modules [65]. Denoted by $\{\mathcal{K}^i\}_{i=1}^C$ a convolution kernel where $i$ represents the $i$ -th channel, $\mathrm{Idx}$ the channel index function and $\otimes$ the convolution operation, the convoluted result for $\mathrm{concat}(\pmb{x}, \pmb{c})$ can be calculated as $\pmb{x} \otimes \mathcal{K}^{i \neq \mathrm{Idx}(c)} + c \otimes \mathcal{K}^{i = \mathrm{Idx}(c)}$ . As a result, the numerical difference between two contrastive samples is expected to be $(\pmb{c}_2 - \pmb{c}_1) \otimes \mathcal{K}^{i = \mathrm{Idt}(c)}$ , which becomes a constant when $\pmb{c}$ is element-wise the same (in convolutions, a kernel is shared across the spatial dimension). It could also be concluded that any linear operation before instance normalization would cause the same problem (for example adding the broadcast control signal to the input) as the constant difference on two channels would be eliminated by IN. To prevent this, we introduce a simple non-linear transformation like leaky ReLU [50] when adopting instance normalization. Visualizations on the activated domain-specific features (by identifying the positions where a non-linear transformation takes place) can be found in the supplement. Batch normalization, on the other hand, introduces certain contrastivity inside the training samples but does not impede the overall monotonicity.
+
+# 3.3 Objective Functions
+
+Based on the proposed contrastive pixel-level modulation framework, we provide the corresponding constraints steering towards a monotonic and cross-domain control. Since the translation can be bi-directional, we will always take that from $X$ to $Y$ as an example.
+
+Monotonicity Loss. We employ the output value of target discriminator to model the likelihood of belonging to this domain. Given an input image $\pmb{x}$ and two pixel-level control signal $c_{1}$ and $c_{2}$ where we assume $c_{2}^{i,j} > c_{1}^{i,j}$ , the confidence difference $\Delta_{X\mapsto Y}^{tar}$ between translated results can be calculated as:
+
+$$
+\boldsymbol {\Delta} _ {X \mapsto Y} ^ {t a r} = D _ {Y} \left(G _ {X \mapsto Y} (\boldsymbol {x}, \boldsymbol {c} _ {2})\right) - D _ {Y} \left(G _ {X \mapsto Y} (\boldsymbol {x}, \boldsymbol {c} _ {1})\right) \tag {2}
+$$
+
+Under the monotonicity constraint $c_2^{i,j} > c_1^{i,j}$ , we encourage the confidence difference $\Delta_{X\mapsto Y}^{tar}$ to be positive for any $c_{\mathbf{1}}$ and $c_{\mathbf{2}}$ :
+
+$$
+\mathcal {L} _ {m o n o - X 2 Y} = \mathbb {E} _ {\boldsymbol {x} \sim X, \boldsymbol {c _ {1}}, \boldsymbol {c _ {2}} \sim C} \| \max \left(\epsilon - \Delta_ {X \mapsto Y} ^ {t a r}, 0\right) \| _ {2} ^ {2} \qquad (3)
+$$
+
+where $\epsilon > 0$ is a hyperparameter controlling the strength of monotonicity, which we call a margin here. As illustrated in Figure 2, the above loss exerts a quadratic punishment when $\Delta_{X \mapsto Y}^{tar} < \epsilon$ , and thus introduces not only a positive $\Delta_{X \mapsto Y}^{tar}$ but also a positive margin. Omitting $\epsilon$ can cause a trivial solution where the confidence difference is only a little greater than zero and finally a weak control. Domain Fidelity Loss. Although monotonicity loss enables a continuous cross-domain control, there exists an asymmetry issue. As we know that a well-trained discriminator can only produce a high confidence level for a real image, constraining the confidence level to be low, as in the case of $c_1$ , may not be promising.
+
+The discrepancy can lead to a biased control that lacks in the diversity and control quality. Though this can be mitigated by applying a weak paired loss (e.g., $L1$ or $MSE$ ) between the input image and the translated one, a rigid identity mapping also introduces certain instability for $c_{2}$ and involves much parameter tuning. As a surrogate, we not only require a higher confidence level for $c_{2}$ from the target domain discriminator, but also a higher confidence level for $c_{1}$ from the source discriminator. We formulate the domain fidelity loss as:
+
+$$
+\mathcal {L} _ {d f - X 2 Y} = \mathbb {E} _ {\boldsymbol {x} \sim X, \boldsymbol {c} _ {1}, \boldsymbol {c} _ {2} \sim C} \| \max \left(\epsilon - \boldsymbol {\Delta} _ {\boldsymbol {X} \mapsto \boldsymbol {Y}} ^ {s r c}, 0\right) \| _ {2} ^ {2} \tag {4}
+$$
+
+where $\pmb{\Delta}_{X\mapsto Y}^{src}$ is defined as:
+
+$$
+\boldsymbol {\Delta} _ {X \mapsto Y} ^ {\boldsymbol {s r c}} = D _ {X} \left(G _ {X \mapsto Y} (\boldsymbol {x}, \boldsymbol {c} _ {\mathbf {1}})\right) - D _ {X} \left(G _ {X \mapsto Y} (\boldsymbol {x}, \boldsymbol {c} _ {\mathbf {2}})\right) \tag {5}
+$$
+
+GAN Loss. MonoPix also utilizes the adversarial loss [19] and cycle consistency loss [80] to provide a proper gradient when training the bi-directional translation network. GAN loss is specialized in constraining the overall quality:
+
+$$
+\min \max \mathcal {L} _ {a d v - X 2 Y} = \mathbb {E} _ {\boldsymbol {y} \sim Y} [ D _ {Y} (\boldsymbol {y}) ] + \mathbb {E} _ {\boldsymbol {x} \sim X, \boldsymbol {c} \sim C} [ 1 - D _ {Y} (\hat {\boldsymbol {y}}) ] \tag {6}
+$$
+
+We adopt cycle consistency loss since in many low-level tasks we are more concentrated on the intensity and stability of enhancement instead of the diversity of appearance. To this end, we expect that the input image could be recovered from a reverse translation with the same intensity $\pmb{c}$ :
+
+$$
+\mathcal {L} _ {c y c - X 2 Y} = \mathbb {E} _ {\boldsymbol {x} \sim X} \left[ \| G _ {Y \mapsto X} \left(G _ {X \mapsto Y} (\boldsymbol {x}, \boldsymbol {c}), \boldsymbol {c}\right) - \boldsymbol {x} \| _ {1} \right] \tag {7}
+$$
+
+Overall Objective. To keep the presentation succinct, we take the translation from $X$ to $Y$ as an example when constructing these loss functions. Similarly losses in the reverse direction could also be formulated. For the generator $G = \{G_{X\mapsto Y},G_{Y\mapsto X}\}$ and discriminator $D = \{D_X,D_Y\}$ , the overall training objective is expressed as:
+
+$$
+\min G \mathcal {L} _ {G} = \mathcal {L} _ {a d v} + \lambda_ {c y c} \mathcal {L} _ {c y c} + \lambda_ {m n} \mathcal {L} _ {m o n o} + \lambda_ {d f} \mathcal {L} _ {d f}
+$$
+
+$$
+\min D \quad \mathcal {L} _ {D} = \mathcal {L} _ {a d v} + \lambda_ {m n} \mathcal {L} _ {m o n o} + \lambda_ {d f} \mathcal {L} _ {d f}
+$$
+
+where $\lambda_{cyc}$ , $\lambda_{mn}$ and $\lambda_{df}$ are hyperparameters balancing different losses.
+
+
+Fig.2: Example curves of the monotonicity loss. A positive $\epsilon$ encourages a margin on confidence difference
+
+
+Fig.3: Illustration of the aesthetic gap. $\pmb{p}$ denotes the best balance point
+
+# 3.4 Selective Inference
+
+MonoPix naturally generates a gallery of candidate results for a given input by constraining the monotonicity. However, a high translation intensity, and hence a high domain discriminator's confidence level does not necessarily yield a satisfactory result. As shown in Figure 3, an image can much "resemble" the target domain but is inconsistent with human perception (aesthetic score).
+
+We assume there lies a perfect balance point $\pmb{p}$ that yields the best aesthetic score, where this score can be any reasonable metric, such as human perception, and quantitative metrics like PSNR and SSIM [69] when a reference image is available. To approximate $\pmb{p}$ , MonoPix enables a variety of inference strategies with different execution complexity:
+
+Exhaustive Inference. Benefiting from the monotonicity, we can always sample $N$ control signals and choose the best result. The complexity is $O(N)$ .
+
+Ternary Search. Since the translation intensity - aesthetic score curve can be a monotonically increasing one or consists of two continuous monotonic parts, it is unimodal-like. Finding the local maxima can thus be efficiently solved by using ternary search. The details of this method are described in the supplementary material. It has the $O(\log N)$ complexity.
+
+Guidance from Learned Expert. We can further decrease the complexity to $O(1)$ by introducing an expert network $P$ that mimics target distribution. It can be trained in a few-shot manner and even on unseen datasets for fast adaptation.
+
+# 4 Experiments and Results
+
+We carry out experiments on both the commonly used domain translation datasets AFHQ cat-dog [13] and Yosemite summer-winter [80], and low-level tasks including prevalent LOL low-light enhancement [70] and SIDD noise generation [1]. For a fair comparison, we will always report the results when $\pmb{c}$ is set to be element-wise the same when not specified.
+
+# 4.1 Metrics
+
+For continuous cross-domain image generation, we evaluate both the dynamic translation process and the quality of translated images:
+
+AL/Rg: As we expect that an image should change monotonically from the input one, the foremost concern comes from the absolute linearity (AL) and control range (Rg). For an input image, we first modulate it by varying the intensity level $c$ from 0 to 1 with an interval of 0.1. Then, AL score can be evaluated by the Pearson correlation coefficient between these intensity levels and the LPIPS distances [77] against the input image. Rg score is calculated by the range of these values, which reflects both the fidelity and difference.
+
+$\mathbf{RL} / \mathbf{Sm}$ : Besides absolute linearity, we follow [71] to measure the smoothness of adjacent intermediate pairs. To both overcome the drawback of standard deviation as used in [71] (which is sensitive to the absolute input value), and keep
+
+in comparison with AL, we calculate relative linearity (RL) from the linearity of cumulative adjacent LPIPS distances, where a high RL score indicates the translation is even between adjacent samples. The smoothness (Sm) can be evaluated by measuring the maximum value of these adjacent LPIPS distances.
+
+ACC/FID: Following [51,71], we adopt a pre-trained ResNet [23] binary classifier to measure the success of translation. For each image, we report the highest confidence level of the classifier among the consecutive modulation process. The quality of translation can be evaluated by Fréchet inception distance (FID) [24] between the whole trajectory (with interval of 0.1) and real images, as in [44].
+
+We use the corresponding paired evaluation metrics in low-level tasks. For low-light image enhancement, we adopt PSNR, SSIM, and LPIPS. For blind noise generation, we leverage average KL divergence (AKLD) [74].
+
+# 4.2 Implementation Details
+
+Following [28], we use the U-net [59] structure as the generator and discriminator, and Adam as the optimizer with $\beta_{1}$ and $\beta_{2}$ set to be 0.5 and 0.9 respectively. LSGAN [52] is adopted to provide the basic GAN loss. As to the hyperparameter settings, we always set $\lambda_{cyc}$ as 10, as in CycleGAN, and $\lambda_{mn}$ as 1, which is the same as the weight of $\mathcal{L}_{adv}$ . $\lambda_{df}$ and $\epsilon$ , along with training epochs vary in different datasets, which can be found in detail from the supplementary material. The learning rate is set to be $10^{-4}$ initially and linearly drops to zero.
+
+
+Fig. 4: Visual comparisons on continuous domain translation
+
+# 4.3 Results on Continuous Cross-Domain Translation
+
+We compare MonoPix with deep network interpolation method CycleGAN-DNI [68], style interpolation method StarGANv2 [13], and recently proposed continuous cross-domain translation model Liu et al. [44] and SAVI2I [51]. For style-guided methods, we randomly select their reference images from the target domain to provide the style information and report the average scores in 5 experiments (we call this variant "-Rdm"), and calculate the average target style information (style centroid) so that they can generate deterministic interpolations with $O(1)$ complexity (we call this variant "-Cent").
+
+The visual and quantitative results can be found in Figure 4 and Table 1 respectively. We first notice that two-stage interpolation method CycleGAN-DNI and our contrastive modulation approach MonoPix show a better fidelity on the input images, while style-guided solutions bear an obvious distortion on the original textures and attributes. Though CycleGAN-DNI exhibits the highest control range in Table 1, the intermediate smoothness is significantly worse than the rest candidates. We also find that MonoPix provides a competitive absolute linearity, but the modifications between adjacent translation intensities are not strongly guaranteed to be evenly distributed, as in Yosemite scenario. This is partially related to the non-linearity of domain discriminator, but is not a key practical problem since we can execute a finer exploration in "intensity of interests", which we illustrate more in the supplementary material. As to the realness and quality, MonoPix also performs favorably against other state of the arts, and strongly demonstrates the benefits of introducing a contrastive modulation scheme that helps to explore domain-specific features. Nevertheless, we note that evaluating FID on the whole trajectory, or on a specific intensity may produce different results for MonoPix, as we do not assume all input images share the same optimal translation intensity. More discussions on the qualitative
+
+Table 1: Quantitative results on cross-domain continuous translation
+
+| Methods | Summer → Winter | Winter → Summer |
| AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ | AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ |
| CycleGAN-DNI [68] | 0.969/0.286 | 0.937/0.067 | 0.766/35.0 | 0.979/0.279 | 0.911/0.079 | 0.834/42.8 |
| StarGANv2-Rdm [13] | 0.805/0.134 | 0.992/0.021 | 0.616/46.1 | 0.741/0.107 | 0.996/0.018 | 0.771/50.1 |
| StarGANv2-Cent [13] | 0.719/0.100 | 0.985/0.016 | 0.650/49.3 | 0.417/0.055 | 0.996/0.010 | 0.720/52.8 |
| SAVI2I-Rdm [51] | 0.959/0.185 | 0.994/0.013 | 0.680/44.5 | 0.939/0.168 | 0.995/0.013 | 0.706/47.6 |
| SAVI2I-Cent [51] | 0.934/0.145 | 0.988/0.010 | 0.718/47.5 | 0.873/0.111 | 0.993/0.009 | 0.721/49.2 |
| MonoPix (Ours) | 0.939/0.154 | 0.940/0.015 | 0.950/38.1 | 0.960/0.145 | 0.964/0.019 | 0.949/47.3 |
| Methods | Cat → Dog | Dog → Cat |
| AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ | AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ |
| StarGANv2-Rdm [13] | 0.872/0.279 | 0.979/0.299 | 0.924/33.9 | 0.840/0.293 | 0.974/0.295 | 0.980/25.7 |
| StarGANv2-Cent [13] | 0.738/0.242 | 0.980/0.284 | 0.906/50.2 | 0.742/0.263 | 0.974/0.282 | 0.991/38.0 |
| Liu et al. -Rdm [44] | 0.930/0.281 | 0.967/0.174 | 0.956/37.1 | 0.933/0.313 | 0.956/0.216 | 0.997/27.5 |
| SAVI2I-Rdm [51] | 0.973/0.294 | 0.990/0.142 | 0.942/28.6 | 0.968/0.292 | 0.992/0.138 | 0.982/24.2 |
| SAVI2I-Cent [51] | 0.955/0.235 | 0.988/0.141 | 0.976/53.6 | 0.957/0.251 | 0.995/0.132 | 0.997/31.4 |
| MonoPix (Ours) | 0.986/0.398 | 0.990/0.050 | 0.970/41.1 | 0.983/0.407 | 0.984/0.076 | 0.997/14.4 |
+
+evaluations can be found in the supplementary material. It is also noteworthy to mention that interpolating towards the style centroid leads to a smoother and deterministic translation (variant "-Cent"), yet taking such a trajectory can cause duplicated or unrealistic patterns for style-guided approaches.
+
+# 4.4 Applications in Low-Level Image Processing
+
+In addition to cross-domain continuous translation, we show how MonoPix, along with the inference strategies can be used to facilitate low-level tasks.
+
+Low-Light Image Enhancement. We integrate the proposed contrastive modulation approach with EnlightenGAN [28], a previous unsupervised one-to-one mapping (US-O2O) method in this area, and compare the performance on LOL test set with several state-of-the-art methods, including supervised one-to-one mapping (SL-O2O) method TBEFN [47], and reference-guided supervised (SL-Ref) approach $\mathrm{KinD}++$ [78]. For fairness, we retrain EnlightenGAN on LOL training set, which yields an improved performance. We choose PSNR to guide the ternary search for this task unless specified.
+
+To figure out the potential of our controllable generation scheme, we first implement exhaustive inference (EI), whose results can be viewed as the upper bound. As can be found in Table 2, MonoPix yields an average PSNR of 21.65, which is considerably higher than the one-to-one mapping baselines. This is because a rigid O2O mapping is not sufficient to model the diversity of data distribution. Interestingly, this result is even comparable to state-of-the-art reference-guided supervised approach $\mathrm{KinD}++$ , but note that MonoPix can produce competitive results without any expert knowledge or paired supervision, and streamlines the enhancement pipeline notably. The superiority of MonoPix is also supported from SSIM and LPIPS scores. When using a 7-times ternary search, we observe a tiny and acceptable performance drop. This evidence not only validates the monotonicity and continuity of the shaped generation manifold, but also demonstrates the effectiveness of our inference strategy. Next, we formulate a non-reference-guided variant by training an expert network with $10\%$ of paired supervision (during training the backbone conditional generator is frozen). Shown in the experiment named "LP", the model then degrades to an O2O mapping-based translator where the previous unsupervised contrastive training stage now serves as a pre-text task. Though not competitive as the
+
+Table 2: Quantitative results on LOL test- Table 3: Quantitative results on set. ELGAN stands for EnlightenGAN SIDD natural noise generation
+
+| Method | Type | PSNR↑ | SSIM↑ | LPIPS↓ |
| TBEFN [47] | SL-O2O | 17.35 | 0.777 | 0.210 |
| KinD++ [78] | SL-Ref | 21.80 | 0.829 | 0.158 |
| KinD++ [78] | SL-O2O | 17.75 | 0.758 | 0.198 |
| ELGAN [28] | US-O2O | 19.01 | 0.709 | 0.274 |
| Ours-EI | US-Ref | 21.65 | 0.731 | 0.273 |
| Ours-TS | US-Ref | 21.55 | 0.731 | 0.273 |
| Ours-LP | Few Shot | 19.75 | 0.725 | 0.272 |
+
+| Method | Type | AKLD↓ |
| CBDNet [20] | SL | 0.728 |
| ULRD [4] | 0.545 |
| GRDN [32] | 0.443 |
| DANet [74] | 0.212 |
| Ours-EI | US | 0.137 |
| Ours-TS | 0.139 |
+
+Low light $\mapsto$ Normal light
+
+
+Input
+
+
+TBEFN
+
+
+$\mathrm{KinD} + +$ Ref
+
+
+EnlightenGAN
+
+
+MonoPix TS
+
+
+Reference
+
+
+Input
+
+
+CBDNet
+
+
+Clean $\mapsto$ Noisy
+ULRD
+
+
+DANet
+
+
+MonoPix TS
+
+
+Reference
+
+
+Fig. 5: Visual comparisons on the LOL low-light enhancement task and SIDD natural noise generation
+
+
+
+
+
+
+Fig. 6: Examples on fine-grained pixel-level control. From left to right, we provide the input image, spatial control signal, and the modulation result respectively
+
+
+
+
+
+
+
+
+
+
+
+
+
+ternary search variant, it still produces competitive results, yet with a complexity of only $O(1)$ . Visual comparisons on this task can be found in Figure 5.
+
+Blind Image Noise Generation. Different from the commonly discussed task of image denoising, noise generation takes the reverse consideration, and typically is an O2M mapping task. We show in this part the potential and benefits of introducing the proposed continuous modulation approach into this field, and compare with state-of-the-art methods CBDNet [20], ULRD [4], GRDN [32], and DANet [74]. Quantitative and visual results can be found in Table 3 and Figure 5 respectively, where our model ("TS" variant is guided by AKLD) again exhibits its superiority and generalization ability. To the best of our knowledge, MonoPix is the first work that proposes to continuously model natural noise in an unsupervised and spatially-controlled manner. More visual comparisons can be found in the supplementary material.
+
+Pixel-level Monotonic Control. In all the previous experiments, we change the overall translation strength by assigning each pixel with the same intensity. Recall that a fine-grained pixel-level control can be naturally obtained by customizing $c^{i,j}$ , we here provide a few examples in Figure 6. Note that the linearity of manifold further enables a slightly out-of-the-bound inference, especially for uni-directional tasks like illumination and noise control.
+
+# 5 Discussion
+
+# 5.1 Ablation Studies
+
+To further examine the impact of the introduced method, we conduct ablation studies on Yosemite summer-winter translation with two key components that construct our approach: the monotonicity loss (carried along with the contrastive training scheme) and domain fidelity loss. Shown in Table 4 (a) and Figure 7, the variant with none of these losses degrades to an O2O mapping, as we have expected. Note that the AL score is near zero since Pearson correlation coefficient can be negative. When we further add the monotonicity loss, the model succeeds in catching confidence differences and produces a coarse yet continuous translation. Our full model, as shown in variant (c), yields a better fidelity and wider control range. We find the translation quality is also improved under this setting, which is because fidelity loss also strengthens the translation monotonicity and encourages to explore more domain-specific features.
+
+# 5.2 Sensitivity Analysis
+
+We provide the sensitivity analysis on the hyperparameter $\epsilon$ in $\mathcal{L}_{mono}$ and $\mathcal{L}_{df}$ , robustness of guiding criterion in ternary search, and the impact of inference complexity in this part. For better comparisons, we label the variants with varied $\epsilon$ consecutively following Table 4(c). The results in experiment (d) illustrate that merely asking the discriminator to produce a higher confidence level is insufficient and easily collapses to a trivial solution. In contrast, if we set $\epsilon$ to 1.0, as in experiment (e), the whole loss function is then largely dominated by $\mathcal{L}_{mono}$ and $\mathcal{L}_{df}$ , which ultimately leads to an unpleasant translation. Here we note that variant (e) achieves a better FID score than (d), as the latter suffers from a severe mode collapse issue; however considering the unrealistic translation results, setting a high $\epsilon$ inevitably introduces a quality degradation for our full model (c). Concluded from these experiments, hyperparameter $\epsilon$ provides a balance for control intensity and visual quality, and is suggested to increase from a small value. Typically, setting $\epsilon = 0.5$ can yield acceptable translations for most of the examined tasks. Figure 8 shows that MonoPix can always produce pleasant results and correspondingly achieves the best score when
+
+Table 4: Ablation studies on Yosemite dataset
+
+| Variant | \( {\mathcal{L}}_{mono} \) | \( {\mathcal{L}}_{df} \) | \( \epsilon \) | Summer \( \rightarrow \) Winter | Winter \( \rightarrow \) Summer |
| AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ | AL↑/Rg↑ | RL↑/Sm↓ | ACC↑/FID↓ |
| (a) | | | 0.5 | 0.143/0.000 | 0.999/0.000 | 0.733/49.9 | 0.105/0.000 | 1.000/0.000 | 0.702/60.0 |
| (b) | ✓ | | 0.927/0.091 | 0.914/0.008 | 0.866/41.3 | 0.963/0.097 | 0.964/0.010 | 0.847/50.3 |
| (c) | ✓ | ✓ | 0.939/0.154 | 0.940/0.015 | 0.950/38.1 | 0.960/0.145 | 0.964/0.019 | 0.949/47.3 |
| (d) | ✓ | ✓ | 0.0 | 0.415/0.000 | 1.000/0.000 | 0.735/50.0 | 0.250/0.000 | 1.000/0.000 | 0.712/59.5 |
| (e) | ✓ | ✓ | 1.0 | 0.771/0.569 | 0.861/0.210 | 0.996/39.7 | 0.774/0.571 | 0.873/0.204 | 0.994/48.7 |
+
+
+Fig. 7: Visual comparisons on the ablation study and sensitivity analysis. We label for each translated image the LPIPS score against the original input to provide a better comparison
+Fig.8: Sensitivity analysis on the choice of ternary search criterion (top) and impact of ternary search complexity (bottom)
+
+
+
+guided with a specific criterion. Though not surprising, these results also provide a strong evidence on the feasibility and robustness of our proposals. We have also tested the impact of $N$ which directly controls the inference complexity, where a 5 to 7 times of ternary search is found sufficient to provide competitive results.
+
+# 6 Conclusions
+
+We investigate in this paper an interesting yet important task - unsupervised continuous pixel-level modulation, and present MonoPix, the first successful solution by devising a novel contrastive modulation framework and the corresponding constraints. MonoPix can be deployed with selective inference complexity, and achieves a state-of-the-art performance on both the translation continuity and quality. The proposed contrastive modulation approach also provides a new alternative to paired or one-to-one mapping pipelines in low-level visions.
+
+We also note that there are still several challenges under the current MonoPix framework, such as pixel-level multi-modal and multi-attribute control, absoluterelative linearity balance, better constraints and evaluation metrics etc. We hope the proposed method could attract more research interest in continuous pixellevel modulation, and help to shape our view on non-O2O mappings.
+
+Acknowledgment. This work was supported in part by the National Natural Science Foundation of China under Grants 61731002 and 62071425, in part by the Zhejiang Key Research and Development Plan under Grants 2019C01002 and 2019C03131, in part by Huawei Cooperation Project, and in part by the Zhejiang Provincial Natural Science Foundation of China under Grant LY20F010016.
+
+# References
+
+1. Abdelhamed, A., Lin, S., Brown, M.S.: A high-quality denoising dataset for smartphone cameras. In: CVPR. pp. 1692-1700 (2018)
+2. Ali, J., Lucy, C., Phillip, I.: On the "steerability" of generative adversarial networks. In: ICLR (2020)
+3. Almahairi, A., Rajeshwar, S., Sordoni, A., Bachman, P., Courville, A.: Augmented CycleGAN: Learning many-to-many mappings from unpaired data. In: ICML. pp. 195-204 (2018)
+4. Brooks, T., Mildenhall, B., Xue, T., Chen, J., Sharlet, D., Barron, J.T.: Unprocessing images for learned raw denoising. In: CVPR. pp. 11036-11045 (2019)
+5. Cai, H., He, J., Qiao, Y., Dong, C.: Toward interactive modulation for photorealistic image restoration. In: CVPR. pp. 294-303 (2021)
+6. Chen, C., Chen, Q., Xu, J., Koltun, V.: Learning to see in the dark. In: CVPR. pp. 3291-3300 (2018)
+7. Chen, D., Fan, Q., Liao, J., Aviles-Rivero, A., Yuan, L., Yu, N., Hua, G.: Controllable image processing via adaptive filterbank pyramid. TIP 29, 8043-8054 (2020)
+8. Chen, D., Yuan, L., Liao, J., Yu, N., Hua, G.: StyleBank: An explicit representation for neural image style transfer. In: CVPR. pp. 1897-1906 (2017)
+9. Chen, J., Chen, J., Chao, H., Yang, M.: Image blind denoising with generative adversarial network based noise modeling. In: CVPR. pp. 3155-3164 (2018)
+0. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: ICML. pp. 1597-1607 (2020)
+1. Chen, Y.C., Xu, X., Tian, Z., Jia, J.: Homomorphic latent space interpolation for unpaired image-to-image translation. In: CVPR. pp. 2408-2416 (2019)
+2. Choi, Y., Choi, M., Kim, M., Ha, J.W., Kim, S., Choo, J.: StarGAN: Unified generative adversarial networks for multi-domain image-to-image translation. In: CVPR. pp. 8789-8797 (2018)
+3. Choi, Y., Uh, Y., Yoo, J., Ha, J.W.: StarGAN v2: Diverse image synthesis for multiple domains. In: CVPR. pp. 8188-8197 (2020)
+4. Collins, E., Bala, R., Price, B., Susstrunk, S.: Editing in style: Uncovering the local semantics of GANs. In: CVPR. pp. 5771-5780 (2020)
+5. Dumoulin, V., Shlens, J., Kudlur, M.: A learned representation for artistic style. In: ICLR (2017)
+6. Gatys, L., Ecker, A.S., Bethge, M.: Texture synthesis using convolutional neural networks. In: NeurIPS. vol. 28 (2015)
+7. Girshick, R.: Fast R-CNN. In: ICCV (2015)
+8. Gong, R., Li, W., Chen, Y., Gool, L.V.: DLOW: Domain flow for adaptation and generalization. In: CVPR. pp. 2477-2486 (2019)
+9. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: NeurIPS. vol. 27 (2014)
+20. Guo, S., Yan, Z., Zhang, K., Zuo, W., Zhang, L.: Toward convolutional blind denoising of real photographs. In: CVPR. pp. 1712-1722 (2019)
+21. He, J., Dong, C., Qiao, Y.: Modulating image restoration with continual levels via adaptive feature modification layers. In: CVPR. pp. 11056-11064 (2019)
+22. He, J., Dong, C., Qiao, Y.: Interactive multi-dimension modulation with dynamic controllable residual learning for image restoration. In: ECCV. pp. 53-68 (2020)
+23. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016)
+
+24. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: GANs trained by a two time-scale update rule converge to a local nash equilibrium. In: NeurIPS. vol. 30 (2017)
+25. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: ICCV. pp. 1501-1510 (2017)
+26. Huang, X., Liu, M.Y., Belongie, S., Kautz, J.: Multimodal unsupervised image-to-image translation. In: ECCV. pp. 172-189 (2018)
+27. Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: CVPR. pp. 1125-1134 (2017)
+28. Jiang, Y., Gong, X., Liu, D., Cheng, Y., Fang, C., Shen, X., Yang, J., Zhou, P., Wang, Z.: EnlightenGAN: Deep light enhancement without paired supervision. TIP 30, 2340-2349 (2021)
+29. Jo, S.Y., Lee, S., Ahn, N., Kang, S.J.: Deep arbitrary HDRI: Inverse tone mapping with controllable exposure changes. TMM (2021)
+30. Johnson, J., Alahi, A., Fei-Fei, L.: Perceptual losses for real-time style transfer and super-resolution. In: ECCV. pp. 694-711 (2016)
+31. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: CVPR. pp. 4401-4410 (2019)
+32. Kim, D.W., Ryun Chung, J., Jung, S.W.: GRDN: Grouped residual dense network for real image denoising and GAN-based real-world noise modeling. In: CVPRW (2019)
+33. Kim, H., Choi, Y., Kim, J., Yoo, S., Uh, Y.: Exploiting spatial dimensions of latent in GAN for real-time image editing. In: CVPR. pp. 852-861 (2021)
+34. Klyuchka, M., Neiterman, E.H., Ben-Artzi, G.: CEL-Net: Continuous exposure for extreme low-light imaging. arXiv:2012.04112 (2020)
+35. Lee, C.H., Liu, Z., Wu, L., Luo, P.: MaskGAN: Towards diverse and interactive facial image manipulation. In: CVPR. pp. 5549-5558 (2020)
+36. Lee, H.Y., Tseng, H.Y., Huang, J.B., Singh, M., Yang, M.H.: Diverse image-to-image translation via disentangled representations. In: ECCV. pp. 35-51 (2018)
+37. Lee, H., Kim, T., Son, H., Baek, S., Cheon, M., Lee, S.: Smoother network tuning and interpolation for continuous-level image processing. arXiv:2010.02270 (2020)
+38. Li, C., Guo, C., Han, L.H., Jiang, J., Cheng, M.M., Gu, J., Loy, C.C.: Low-light image and video enhancement using deep learning: a survey. TPAMI (2021)
+39. Li, C., Wand, M.: Combining Markov random fields and convolutional neural networks for image synthesis. In: CVPR. pp. 2479-2486 (2016)
+40. Li, Y., Fang, C., Yang, J., Wang, Z., Lu, X., Yang, M.H.: Diversified texture synthesis with feed-forward networks. In: CVPR. pp. 3920-3928 (2017)
+41. Li, Y., Fang, C., Yang, J., Wang, Z., Lu, X., Yang, M.H.: Universal style transfer via feature transforms. In: NeurIPS. vol. 30 (2017)
+42. Ling, H., Kreis, K., Li, D., Kim, S.W., Torralba, A., Fidler, S.: EditGAN: High-precision semantic image editing. In: NeurIPS. vol. 34 (2021)
+43. Lira, W., Merz, J., Ritchie, D., Cohen-Or, D., Zhang, H.: GANHopper: Multi-hop GAN for unsupervised image-to-image translation. In: ECCV. pp. 363-379 (2020)
+44. Liu, Y., Sangineto, E., Chen, Y., Bao, L., Zhang, H., Sebe, N., Lepri, B., Wang, W., De Nadai, M.: Smoothing the disentangled latent style space for unsupervised image-to-image translation. In: CVPR. pp. 10785-10794 (2021)
+45. Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. In: CVPR. pp. 3431-3440 (2015)
+46. Lore, K.G., Akintayo, A., Sarkar, S.: LLNet: A deep autoencoder approach to natural low-light image enhancement. PR 61, 650-662 (2017)
+
+47. Lu, K., Zhang, L.: TBEFN: A two-branch exposure-fusion network for low-light image enhancement. TMM 23, 4093-4105 (2020)
+48. Lu, Y., Tai, Y.W., Tang, C.K.: Attribute-guided face generation using conditional CycleGAN. In: ECCV. pp. 282-297 (2018)
+49. Lv, Z., Li, X., Li, X., Li, F., Lin, T., He, D., Zuo, W.: Learning semantic person image generation by region-adaptive normalization. In: CVPR. pp. 10806-10815 (2021)
+50. Maas, A.L., Hannun, A.Y., Ng, A.Y., et al.: Rectifier nonlinearities improve neural network acoustic models. In: ICML. vol. 30, p. 3 (2013)
+51. Mao, Q., Tseng, H.Y., Lee, H.Y., Huang, J.B., Ma, S., Yang, M.H.: Continuous and diverse image-to-image translation via signed attribute vectors. IJCV 130, 517-549 (2022)
+52. Mao, X., Li, Q., Xie, H., Lau, R.Y., Wang, Z., Paul Smolley, S.: Least squares generative adversarial networks. In: ICCV. pp. 2794-2802 (2017)
+53. Ni, S., Cao, X., Yue, T., Hu, X.: Controlling the rain: From removal to rendering. In: CVPR. pp. 6328-6337 (2021)
+54. Park, T., Efros, A.A., Zhang, R., Zhu, J.Y.: Contrastive learning for unpaired image-to-image translation. In: ECCV. pp. 319-345 (2020)
+55. Park, T., Liu, M.Y., Wang, T.C., Zhu, J.Y.: Semantic image synthesis with spatially-adaptive normalization. In: CVPR. pp. 2337-2346 (2019)
+56. Pizzati, F., Cerri, P., de Charette, R.: CoMoGAN: continuous model-guided image-to-image translation. In: CVPR. pp. 14288-14298 (2021)
+57. Pumarola, A., Agudo, A., Martinez, A.M., Sanfeliu, A., Moreno-Noguer, F.: GANimation: Anatomically-aware facial animation from a single image. In: ECCV. pp. 818-833 (2018)
+58. Ren, D., Zuo, W., Hu, Q., Zhu, P., Meng, D.: Progressive image deraining networks: A better and simpler baseline. In: CVPR. pp. 3937-3946 (2019)
+59. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: MICCAI. pp. 234-241 (2015)
+60. Shen, Y., Zhou, B.: Closed-form factorization of latent semantics in GANs. In: CVPR. pp. 1532-1540 (2021)
+61. Shi, J., Xu, N., Xu, Y., Bui, T., Dernoncourt, F., Xu, C.: Learning by planning: Language-guided global image editing. In: CVPR. pp. 13590-13599 (2021)
+62. Shoshan, A., Mechrez, R., Zelnik-Manor, L.: Dynamic-Net: Tuning the objective without re-training for synthesis tasks. In: ICCV. pp. 3215-3223 (2019)
+63. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556 (2014)
+64. Sun, X., Li, M., He, T., Fan, L.: Enhance images as you like with unpaired learning. arXiv:2110.01161 (2021)
+65. Ulyanov, D., Vedaldi, A., Lempitsky, V.: Instance normalization: The missing ingredient for fast stylization. arXiv:1607.08022 (2016)
+66. Upchurch, P., Gardner, J., Pleiss, G., Pless, R., Snavely, N., Bala, K., Weinberger, K.: Deep feature interpolation for image content changes. In: CVPR. pp. 7064-7073 (2017)
+67. Wang, W., Guo, R., Tian, Y., Yang, W.: CFSNet: Toward a controllable feature space for image restoration. In: ICCV. pp. 4140-4149 (2019)
+68. Wang, X., Yu, K., Dong, C., Tang, X., Loy, C.C.: Deep network interpolation for continuous imagery effect transition. In: CVPR. pp. 1692-1701 (2019)
+69. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. TIP 13(4), 600-612 (2004)
+
+70. Wei, C., Wang, W., Yang, W., Liu, J.: Deep Retinex decomposition for low-light enhancement. In: BMVC (2018)
+71. Wu, P.W., Lin, Y.J., Chang, C.H., Chang, E.Y., Liao, S.W.: RelGAN: Multidomain image-to-image translation via relative attributes. In: ICCV. pp. 5914-5922 (2019)
+72. Ye, M., Zhang, X., Yuen, P.C., Chang, S.F.: Unsupervised embedding learning via invariant and spreading instance feature. In: CVPR. pp. 6210-6219 (2019)
+73. Yu, X., Chen, Y., Liu, S., Li, T., Li, G.: Multi-mapping image-to-image translation via learning disentanglement. In: NeurIPS. vol. 32 (2019)
+74. Yue, Z., Zhao, Q., Zhang, L., Meng, D.: Dual adversarial network: Toward real-world noise removal and noise generation. In: ECCV. pp. 41-58 (2020)
+75. Zamir, S.W., Arora, A., Khan, S., Hayat, M., Khan, F.S., Yang, M.H., Shao, L.: Multi-stage progressive image restoration. In: CVPR. pp. 14821-14831 (2021)
+76. Zhang, H., Dana, K.: Multi-style generative network for real-time transfer. In: ECCVW (2018)
+77. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR. pp. 586-595 (2018)
+78. Zhang, Y., Guo, X., Ma, J., Liu, W., Zhang, J.: Beyond brightening low-light images. IJCV 129(4), 1013-1037 (2021)
+79. Zhu, J., Shen, Y., Zhao, D., Zhou, B.: In-domain GAN inversion for real image editing. In: ECCV. pp. 592-608 (2020)
+80. Zhu, J.Y., Park, T., Isola, P., Efros, A.A.: Unpaired image-to-image translation using cycle-consistent adversarial networks. In: ICCV. pp. 2223-2232 (2017)
+81. Zhu, P., Abdel, R., Qin, Y., Wonka, P.: SEAN: Image synthesis with semantic region-adaptive normalization. In: CVPR. pp. 5104-5113 (2020)
+82. Zhuang, P., Koyejo, O., Schwing, A.G.: Enjoy your editing: Controllable GANs for image editing via latent space navigation. In: ICLR (2021)
\ No newline at end of file
diff --git a/contrastivemonotonicpixellevelmodulation/images.zip b/contrastivemonotonicpixellevelmodulation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ae24b7f0fac7e81c507a5b9cc3650c5d981d0ce2
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:070a25a1bc58d8b839c5b46140fcb428be9be6f4002c65f1cfb9b6e568c4a5ca
+size 619163
diff --git a/contrastivemonotonicpixellevelmodulation/layout.json b/contrastivemonotonicpixellevelmodulation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5ce9f538988b264b4829595ef3590e0eab6c6ae8
--- /dev/null
+++ b/contrastivemonotonicpixellevelmodulation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:287bda081afc4a20273c125294fbac26246f2f571c42834e00ecf9f05fbb2c49
+size 512962
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_content_list.json b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..aee424f6faa152d13e01e7bae413fc6cd80f1e18
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:88f0a9d4b1e57275bdee2647b35a21e6c3f850326040734ebf0f9b01f7cba735
+size 66523
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_model.json b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..061ef578ae30295965178d61ed7d33e1ebdf5714
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:24c15eb9f9b68cb532f61a279ae6755a43972f4fc39771763bab818d1886f671
+size 83583
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_origin.pdf b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a0a5e0ee8ac957cbd7c473370492a7a1ac051b4b
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/525c924e-b374-4e61-ae3c-7d750d36387a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69483d3a07686f31c7f695538f4d06f51d4e2fcd1da7803f1ef4460dc0a3201a
+size 7656938
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/full.md b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f9c0ebff1a43a4b61a0c89ad6411692a0ba8dc1a
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/full.md
@@ -0,0 +1,267 @@
+# Contrastive Positive Mining for Unsupervised 3D Action Representation Learning
+
+Haoyuan Zhang (Corresponding author)1, Yonghong Hou1, Wenjing Zhang1, and Wanqing Li2
+
+$^{1}$ Tianjin University, School of Electrical and Information Engineering, Tianjin, China
+
+{zhy0860,houroy,zwj759}@tju.edu.cn
+
+$^{2}$ Advanced Multimedia Research Lab, University of Wollongong, Wollongong, Australia.
+
+wanqing@uow.edu.au
+
+Abstract. Recent contrastive based 3D action representation learning has made great progress. However, the strict positive/negative constraint is yet to be relaxed and the use of non-self positive is yet to be explored. In this paper, a Contrastive Positive Mining (CPM) framework is proposed for unsupervised skeleton 3D action representation learning. The CPM identifies non-self positives in a contextual queue to boost learning. Specifically, the siamese encoders are adopted and trained to match the similarity distributions of the augmented instances in reference to all instances in the contextual queue. By identifying the non-self positive instances in the queue, a positive-enhanced learning strategy is proposed to leverage the knowledge of mined positives to boost the robustness of the learned latent space against intra-class and inter-class diversity. Experimental results have shown that the proposed CPM is effective and outperforms the existing state-of-the-art unsupervised methods on the challenging NTU and PKU-MMD datasets.
+
+Keywords: Unsupervised learning, 3D action representation, Skeleton, Positive mining.
+
+# 1 Introduction
+
+Human action recognition is an active research in recent years. Due to being lightweight, privacy-preserving and robust against complex conditions [26,27,2,28], 3D skeleton is becoming a popular modality for capturing human action dynamics [10,39,31,43]. Majority of previous skeleton-based action recognition approaches [18,35,38,42] are developed with a fully-supervised manner. However, in order to learn a good action representation, supervised methods require a huge number of labeled skeleton samples which is expensive and difficult to obtain. It impels the exploration of learning skeleton-based action representation in an unsupervised manner [15,24,30,14]. Often unsupervised methods use pretext tasks to generate the supervision signals, such as reconstruction [7,44], auto-regression [12,30] and jigsaw puzzles [22,36]. Consequently, the learning highly
+
+relies on the quality of the designed pretext tasks, and those tasks are hard to be generalized for different downstream tasks. Recent unsupervised methods employ advanced contrastive learning [15,24,14] for instance discrimination in a latent space and have achieved promising results.
+
+
+
+
+Fig. 1. Illustrations about the proposed CPM and previous contrastive methods. (a) contrastive learning methods with negative [15,24]. (b) contrastive learning methods without negative [4,6]. (c) the proposed Contrastive Positive Mining (CPM) method.
+
+
+
+Although contrastive methods can improve the learning of skeleton representation, there are several issues, as illustrated in Fig. 1, in the current methods. Fig. 1(a) shows that the conventional contrastive learning methods require negatives [15,24]. They only regard different augmentations of the same instance as positives to be drawn close during the learning, while other instances in the queue, usually formed by training samples in the previous round of epochs or batches, are all regarded as negatives and pushed apart from the current instance. Although these methods consider the correlation of current instance with others, there are inevitably instances in queue that belong to the same category as the current instance (marked with red rectangular box) and these instances are mistaken as negatives, which could degrade the learned representation. To address this issue, as shown in Fig. 1(c), this paper proposes to search for the instances in queue that are likely to be the same class of the current instance, then to consider those instances as non-self positives (marked with green rectangular box) and draw them close to current instance so as to improve the learning.
+
+Fig. 1(b) shows the conventional contrastive learning methods without negatives [4,6]. The positive setting is similar to the previous methods illustrated in Fig. 1(a). Only different augmentations of individual instance are used as positive, consistency among current instance and the non-self instances with the same class are ignored during learning, limiting the representation ability for intra-class diversity. Besides, although non-negative manner avoids the in-
+
+stances of same class being pushed apart, the correlation of different instances are not considered.
+
+Notice that contrastive objective of both methods (i.e. with or without negatives) is on individual instances, which challenges learning a feature space for all instances. To overcome the above shortcomings, as illustrated in Fig. 1(c), the proposed method extends the contrastive objective from individual instances by keeping a queue of instances and mining the non-self positives in the queue to boost learning. Specifically, a novel Contrastive Positive Mining (CPM) framework is proposed for unsupervised skeleton 3D action recognition. The proposed CPM is a siamese structure with a student and a target branch, which follows the SimSiam [4]. The student network is trained to match the target network in terms of the similarity distribution of the augmented instance in reference to all instances in a contextual queue, so that the non-self positive instances with high similarity can be identified in the queue. Then a positive-enhanced learning strategy is proposed to leverage the mined non-self positives to guide the learning of the student network. This strategy boosts the robustness of the learned latent space against intra-class and inter-class diversity. Experimental results on NTU-60 [25], NTU-120 [17] and PKU-MMD [16] datasets have validated the effectiveness of the proposed strategy.
+
+To summarize, the key contributions include:
+
+- A novel Contrastive Positive Mining (CPM) framework for unsupervised learning of skeleton representation for 3D action recognition.
+- A simple but effective non-self positive mining scheme to identify the positives in a contextual queue.
+- A novel positive-enhanced leaning strategy to guide the learning of the student network via the target network.
+- Extensive evaluation of the CPM on the widely used datasets, NTU and PKU-MMD, with state-of-the-art results obtained.
+
+# 2 Related Works
+
+# 2.1 Unsupervised Contrastive Learning
+
+Contrastive learning is derived from noise-contrastive estimation [8], which contrasts different type of noises to estimate the latent distribution. It has been extended in different ways for unsupervised learning. Contrastive Prediction Coding (CPC) [23] develops the info-NCE to learn image representation, with an auto-regressive model used to predict future in latent space. Contrastive Multiview Coding (CMC) [34] leverages multi-view as positive samples, so that the information shared between multiple views can be captured by the learned representation. However, there often lacks of negative instances for the above methods. To solve this issue, a scheme called memory-bank [37] is developed in which the previous random representations are stored as negative instances, and each of them are regarded as an independent class. Recently, MoCo [9] utilizes a dynamic dictionary to improve the memory-bank, and introduces the momentum
+
+updated encoder to boost the representation learning. Another way to enrich the negative instances is to use large batch-size such as in SimCLR [3]. Particularly, SimCLR samples negatives from a large batch and shows that different augmentation, large batch size, and nonlinear projection head are all important for effective contrastive learning. However, these methods all regard different augmentations of the same instance as the only positives, while other instances in the queue including the ones with same category are all considered as negatives which cannot fully leverage capability of contrastive learning due to highly likely mixture of positives in the negatives.
+
+To deal with this issue, some negative-sample-free approaches are recently developed. SimSiam [4] shows that simple siamese twin networks with a stop-gradient operation to prevent collapsing can learn a meaningful representation. Barlow Twins [41] proposes an unsupervised objective function by measuring the cross-correlation matrix between the outputs of two identical networks. BYOL [6] learns a potentially enhanced representation from an online network by predicting the representation from a given representation learned from a target network with slow updating. However, these methods do not consider consistency learning among current instances and the non-self instances with the same class.
+
+# 2.2 Unsupervised 3D Action Recognition
+
+Unsupervised methods [29,20,13] for video based action recognition are well developed, while few works are specifically for skeletons. LongT GAN (Generative adversarial network) [44] is an auto-encoder-based GAN for skeleton sequence reconstruction. P&C [30] employs an encoder-decoder learning structure, the encoder is weakened compared with decoder to learn more representative features. ASCAL [24] is a momentum LSTM with a dynamic updated memory-bank, augmented instances of the input skeleton sequence are contrasted to learn representation. $\mathrm{MS}^2\mathrm{L}$ [15] is a multi-task learning framework, with both pretext tasks and contrastive learning. CrosSCLR [14] adopts a cross-view contrastive learning scheme and leverages multi-view complementary supervision signal. However, these methods either require pretext tasks or a large amount of negative samples, or rely on the reconstruction.
+
+# 3 Proposed Method
+
+# 3.1 Overview
+
+Fig. 2 shows the basic framework of CPM. CPM adopts siamese twin networks as inspired by SimSiam [4]. 3D skeleton sequences are randomly augmented. Assume that a skeleton sequence $s$ has $T$ frames, $V$ joints, and $C$ coordinate channels, which can be represented as $s \in \mathbb{R}^{C \times T \times V}$ . To augment $s$ into different versions $x$ and $x'$ , a skeleton-specific augmentation strategy is needed. Different from the augmentations implemented for images, augmentation of skeleton sequences needs to be effective for learning spatial-temporal dynamics. In this
+
+
+Fig. 2. Overview of the CPM framework. CPM includes two stages. In the first stage, the student branch is trained to predict the inter-skeleton similarity distribution inferred by the target network, so as to excavate non-self positive. Then in the second stage the information of mined positives is injected into the target branch through similarity distribution regularization to guide the learning of student, which achieves positive-enhanced learning (different colors in distribution and contextual queue represent the embeddings of different instances, $+ +$ means mined positive).
+
+paper, shear and crop in the spatial and temporal domain are to augment samples. Specifically, shear is applied as a spatial augmentation and is implemented as a linear transformation that displaces the skeleton joint in a fixed direction. Skeleton sequences are multiplied by a transformation matrix on the channel dimension, so as to slant the shape of 3D coordinates from body joints at a random angle. Crop is to pad a number of frames to a sequence symmetrically, then the sequence is randomly cropped into a fixed length [24,14].
+
+The siamese encoders with identical network structure are to encode the augmented skeleton sequences, as shown in Fig. 2, in a latent feature space. One branch is referred to as the student and the other serves as the target [32]. ST-GCN [39] is adopted as the encoder networks. The siamese encoders consist of several GCN layers and embed the two augmented skeleton sequences $x$ and $x'$ into a latent space. In each layer, human pose in spatial-dimension and joint's motion in temporal-dimension are alternatively encoded, i.e. a spatial graph convolution is followed by a temporal convolution.
+
+After the siamese encoders, a projection MLP $g$ is attached to project the vector $h$ and $h'$ in the encoding space: $z = g(h)$ , $z' = g(h')$ , where $z$ and $z'$ are assumed to be mean-centered along the batch dimension so that each unit has 0 mean output over the batch. The projection MLP consists of two layers, the first one is followed by a batch normalization layer and rectified linear units. After the projection MLP, a prediction MLP $p$ with same architecture of $g$ is attached to the student branch to produce the prediction $p(z)$ , while the stop-gradient operation is used in the target branch with the output $sg(z')$ . In addition, a "first-in first-out" [9] contextual queue $Q = [a_1, \dots, a_N]$ is used to measure how
+
+well the encoded augmented instance by student network matches that by the target network with respect to the instances in the queue.
+
+The key idea of the proposed method is to use the output of the student network to predict the output of the target network. More specifically, our objective is to train the siamese encoders such that the student network matches the target network in terms of the similarity distribution of the augmented instance in reference to all instances in the queue.
+
+# 3.2 Similarity Distribution and Positive Mining
+
+Similarity between the encoded feature of the augmentations and the instances in queue is first calculated and similarity distribution for the student network and the target network are calculated through softmax. The learning process is to train the network so that the similarity distribution of $x$ with respect to the instances in the queue can predict the distribution of $x'$ . Compared with the previous methods, this strategy has the following advantages. No strict definition of positives/negatives is required and the match on similarity distribution over the instances in the queue is more reliable than that over individual instances. Since the similarity between the augmented instances and instances of the same class in the queue is expected to be high, resulting in an implicit mining of non-self positive instances in the queue.
+
+Let $Q = [a_{1}, \dots, a_{N}]$ be the queue of $N$ instances, where $a_{i}$ is the embedding of the $i$ -th instance. The contextual queue comes from the preceding several batches of target network, which is updated in "first-in first-out" [9] strategy. Similarity distributions, $d_{i}$ and $d_{i}'$ , between $\bar{p}(z)$ and $a_{i}$ and between $\bar{z}'$ and $a_{i}$ are computed as follows, respectively,
+
+$$
+d _ {i} = \frac {e ^ {\bar {p} (z) \cdot a _ {i} / \tau}}{\sum_ {j = 1} ^ {N} e ^ {\bar {p} (z) \cdot a _ {j} / \tau}} \tag {1}
+$$
+
+$$
+d _ {i} ^ {\prime} = \frac {e ^ {\bar {z} ^ {\prime} \cdot a _ {i} / \tau^ {\prime}}}{\sum_ {j = 1} ^ {N} e ^ {\bar {z} ^ {\prime} \cdot a _ {j} / \tau^ {\prime}}} \tag {2}
+$$
+
+where $\bar{p}(z)$ and $\bar{z}'$ are $l_2$ normalization of $p(z)$ and $z'$ . The overall similarity distributions, $D$ and $D'$ of the two arguments in the latent space with respect to the instances in the queue are,
+
+$$
+D = \left\{d _ {i} \right\}, D ^ {\prime} = \left\{d _ {i} ^ {\prime} \right\}, i \in N \tag {3}
+$$
+
+The idea is to training siamese encoders to match $D$ with $D'$ . In this paper, we adopt to minimize the Kullback-Leibler divergence between $D$ and $D'$ , i.e.,
+
+$$
+L = D _ {K L} \left(D ^ {\prime} \| D\right) = H \left(D ^ {\prime}, D\right) - H \left(D ^ {\prime}\right) \tag {4}
+$$
+
+By minimizing $L$ , prediction $p(z)$ can be aligned with $z'$ . Meanwhile, instances that belong to the same class could be pushed close in the latent space, while those from different classes are pushed apart.
+
+The similarity measures provide information for mining the positive instance in the queue. Specifically, given one instance's embedding $z$ and the corresponding queue $Q$ , instances in queue with top-k high similarity are considered as positives, i.e.,
+
+$$
+\Gamma (Q) = \operatorname {T o p k} (Q) \tag {5}
+$$
+
+which generates the index set of positive instances,
+
+$$
+D _ {+} ^ {\prime} = \left\{d _ {i} ^ {\prime} \right\}, i \in N _ {+} \tag {6}
+$$
+
+where $N_{+}$ is the index set of non-self positive instances. These positives can be used to facilitate a positive-enhanced learning as described below.
+
+# 3.3 Positive-enhanced Learning
+
+The non-self positives can be used to boost the representation learning. Intuitively, it is reasonable to inject the information of mined positives into the target branch to guide the learning of the student encoder. To do this, it is proposed to regularize the similarity distribution of the target branch $D'$ in each batch, so as to make use of the non-self positives iteratively. Specifically, we set the similarities of the $K$ mined positive instances in target branch to 1, which means those instances are considered the same action category with current instance. This strategy is referred to as "positive-enhanced leaning". The positive-enhanced similarity distribution can be expressed as,
+
+$$
+d _ {i} ^ {e} = \left\{ \begin{array}{c} \frac {e ^ {1 / \tau^ {\prime}}}{\sum_ {j = 1} ^ {N} e ^ {\bar {z} ^ {\prime} \cdot a _ {j} / \tau^ {\prime}}} , i \in N _ {+} \\ d _ {i} ^ {\prime}, \text {o t h e r w i s e} \end{array} \right. \tag {7}
+$$
+
+Then we train distribution of student to continue predicting the regularized target distribution, so that the student is guided to learn more informative intraclass diversity brought by the non-self skeleton positives knowledge we inject,
+
+$$
+L ^ {\prime} = H \left(D _ {N P} ^ {\prime}, D\right) - H \left(D _ {N P} ^ {\prime}\right) \tag {8}
+$$
+
+where $D_{NP}^{\prime} = \{d_i^e\}$ is the non-self positive-enhanced target distribution. Compared to Eq.(4), Eq.(8) intends to pull positive instances closer.
+
+# 3.4 Learning of CPM
+
+In the early training stage, the model is likely not stable and capable enough of providing reasonable measures of the similarity distribution to identify the
+
+positives in the queue. Therefore, a two-stage training strategy is adopted for CPM: the student branch is first trained to predict the similarity distribution inferred by the target network without enhanced positives in Eq.(4). When it is stable, the model is trained using the positive-enhanced learning strategy in Eq.(8).
+
+# 4 Experiments
+
+# 4.1 Datasets
+
+NTU RGB+D 60 (NTU-60) Dataset [25]: NTU-60 is one of the widely used indoor-captured datasets for human action recognition. 56880 action clips in total are performed by 40 different actors in 60 action categories. The clips are captured by three cameras simultaneously at different horizontal angles and heights in a lab environment. Experiments are conducted on the Cross-Subject (X-Sub) and Cross-View (X-View) benchmarks.
+
+NTU RGB+D 120 (NTU-120) Dataset [17]: NTU-120 is an extended version of NTU-60. There are totally 114480 action clips in 120 action categories. Most settings of NTU-120 follow the NTU-60. Experiments are conducted on the Cross-Subject (X-Sub) and Cross-Setup (X-Set) benchmarks.
+
+PKU-MMD Dataset [16]: There are nearly 20,000 action clips in 51 action categories. Two subsets PKU-MMD I and PKU-MMD II are used in the experiments. PKU-MMD II is more challenging than PKU-MMD I as it has higher level of noise. Experiments are conducted on the Cross-Subject (X-Sub) benchmark for both subsets.
+
+# 4.2 Implementation
+
+Architecture: The 9-layer ST-GCN [39] network is chosen as the encoders. In each layer, the spatial graph convolution is followed by a temporal convolution, the temporal convolutional kernel size is 9. A projector of 2-layer MLP is attached to the output of both networks. The first layer is followed by a batch normalization layer and rectified linear units, with output size of 512, while the output dimension of the second layer is 128. A predictor with the same architecture is used in the student branch, while the stop-gradient operation is applied in target branch. The contextual queue size $N$ is set to 65536, 32768 and 16384 for NTU-60/120, PKU-MMD I and PKU-MMD II datasets, respectively.
+
+Unsupervised Pre-training: LARS [40] is utilized as optimizer and trained for 400 epochs with batch size 512, note that the positive-enhanced learning is conducted after 300 epochs. The learning rate starts at 0 and is linearly increased to 0.5 in the first 10 epochs of training and then decreased to 0.0005 by a cosine decay schedule [19]. All experiments are conducted on one Nvidia RTX3090 GPU using PyTorch.
+
+Linear Evaluation Protocol: The pre-trained models are verified by linear evaluation. Specifically, a linear classifier (a fully-connected layer followed by a softmax layer) is trained supervisedly for 100 epochs while the pre-trained model is fixed.
+
+# 4.3 Results and Comparison
+
+Unsupervised Results: The performance of the proposed CPM is compared with the state-of-the-art supervised and unsupervised methods on the NTU and PKU-MMD datasets and results are shown in Table 1. Following the standard practice in literature the recognition performance in terms of top-1 classification accuracy is reported. Note that, if not specified, the experiments including ablation study are conducted on the joint data. 3S means the ensemble results of joint, bone and motion data. The obvious performance improvement compared with the recent advanced unsupervised counterparts [14,33] has been obtained and demonstrates the effectiveness of CPM. In addition, CPM (3S) outperforms the supervised ST-GCN [39] on both NTU and PKU-MMD datasets.
+
+Table 1. Performance and comparison with the state-of-the-art methods on the NTU and PKU-MMD datasets.
+
+| Architectures | NTU-60 (%) | NTU-120 (%) | PKU-MMD (%) |
| X-Sub | X-View | X-Sub | X-Set | Part I | Part II |
| Supervised |
| C-CNN + MTLN [11] | 79.6 | 84.8 | - | - | - | - |
| TSRJI [1] | 73.3 | 80.3 | 67.9 | 62.8 | - | - |
| ST-GCN [39] | 81.5 | 88.3 | 70.7 | 73.2 | 84.1 | 48.2 |
| Unsupervised |
| LongT GAN [44] | 39.1 | 48.1 | - | - | 67.7 | 27.0 |
| ASCAL [24] | 58.5 | 64.8 | 48.6 | 49.2 | - | - |
| MS²L [15] | 52.6 | - | - | - | 64.9 | 27.6 |
| P&C [30] | 50.7 | 76.3 | - | - | - | - |
| ISC [33] | 76.3 | 85.2 | 67.9 | 67.1 | 80.9 | 36.0 |
| CrossSCLR (joint) [14] | 72.9 | 79.9 | - | - | - | - |
| CrossSCLR (3S) [14] | 77.8 | 83.4 | 67.9 | 66.7 | 84.9 | - |
| CPM (joint) | 78.7 | 84.9 | 68.7 | 69.6 | 88.8 | 48.3 |
| CPM (3S) | 83.2 | 87.0 | 73.0 | 74.0 | 90.7 | 51.5 |
+
+Semi-supervised Results: The CPM is first pre-trained on all training data in an unsupervised way, then the classifier is fine-tuned with $1\%$ and $10\%$ annotated data respectively. Table 2 shows the semi-supervised results on the NTU-60 dataset. The results have shown the proposed CPM performs significantly better than the compared methods. Compared with $\mathrm{MS}^2\mathrm{L}$ [15] and ISC [33], CPM improves the performance by a large margin and shows its robustness when fewer labels are available for fine-tuning.
+
+Fully Fine-tuned Results: The model is first unsupervisedly pre-trained, then a linear classifier is appended to the learnable encoder. Both the pre-trained model and the classifier undergo a supervised training using all training data [41], results are shown in Table 3. On both NTU-60 and NTU-120 datasets the fully
+
+Table 2. Semi-supervised performance and comparison with the state-of-the-art methods on the NTU-60 dataset.
+
+| Architectures | Label fraction (%) | X-Sub (%) | X-View (%) |
| LongT GAN [44] | 1 | 35.2 | - |
| MS²L [15] | 1 | 33.1 | - |
| ISC [33] | 1 | 35.7 | 38.1 |
| CPM | 1 | 56.7 | 57.5 |
| LongT GAN [44] | 10 | 62.0 | - |
| MS²L [15] | 10 | 65.2 | - |
| ISC [33] | 10 | 65.9 | 72.5 |
| CPM | 10 | 73.0 | 77.1 |
+
+fine-tuned CPM outperforms the supervised ST-GCN [39], demonstrating the effectiveness of the unsupervised pretraining.
+
+Table 3. Fully fine-tuned performance and comparison on the NTU-60 and NTU-120 datasets.
+
+| Architectures | NTU-60 (%) | NTU-120 (%) |
| X-Sub | X-View | X-Sub | X-Set |
| C-CNN + MTLN [11] | 79.6 | 84.8 | - | - |
| TSRJI [1] | 73.3 | 80.3 | 67.9 | 62.8 |
| ST-GCN [39] | 81.5 | 88.3 | 70.7 | 73.2 |
| CPM | 84.8 | 91.1 | 78.4 | 78.9 |
+
+# 4.4 Ablation Study
+
+On positive mining: To verify the effectiveness of positive-enhanced learning, we pre-train the CPM (w/o. PM) without identifying the positive instances and, hence, positive-enhanced learning, other settings are kept the same. Performance of CPM and CPM (w/o. PM) is shown in Table 4. On the NTU-60 X-Sub and X-View tasks, CPM improves the recognition accuracy by 3.1 percentage points and 3.2 percentage points, respectively. On the NTU-120 X-Sub and X-Set tasks, 3.9 percentage points and 4.9 percentage points improvements are obtained by CPM. This demonstrates that identification of positive instances and the positive-enhanced learning strategy do improve the representation learning.
+
+To further verify how well the non-self positives in the queue can be identified for the positive-enhanced learning, Fig. 3 shows the precision of the positives selected by CPM and CPM (w/o. PM) in one epoch in the top-100 identified positive instances. The results show that even CPM (w/o. PM) is capable of identifying many true positives. This is in significant contrast to the methods in [15,24] where all instances in the queue would be considered as negatives. When positive-enhanced learning is applied, the precision has been significantly
+
+Table 4. Benefit of positive mining.
+
+| Datasets | CPM (w/o. PM) (%) | CPM (%) |
| X-Sub (NTU-60) | 75.6 | 78.7 |
| X-View (NTU-60) | 81.7 | 84.9 |
| X-Sub (NTU-120) | 64.8 | 68.7 |
| X-Set (NTU-120) | 64.7 | 69.6 |
+
+
+Fig.3. Precision of positive instances identified by CPM and CPM (w/o. PM) on different datasets.
+
+increased and so that the learned representation is more robust against the intraclass diversity.
+
+On the value of $K$ : Hyper-parameter $K$ refers to the number of positives identified in the queue. This study shows how $K$ affects the performance. Experiments have shown that when $K$ is 100, best results are obtained on the NTU-60 and NTU-120 datasets. Results on NTU-60 X-View are shown in Fig. 4. It is found that too large or too small $K$ both decreases the performance. A large value of $K$ could include unexpected false positives with low similarity that misleads the learning. A small value of $K$ might ignore too many true positives that would potentially decrease representation ability to accommodate intra-class diversity. Good performance was observed when $K$ is 50 and 25 for PKU-MMD I and PKU-MMD II datasets, respectively. It is conjectured that choice of $K$ may depend on the scale of the dataset.
+
+On the value of $\tau'$ : Fig. 5 shows the performance of CPM (w/o. PM) using different $\tau'$ with $\tau$ fixed to 0.1 [5], the optimal performance is obtained when $\tau'$ is 0.05. A large value of $\tau'$ could lead to a flatter target distribution so that the learned representation becomes less discriminative. A small value of $\tau'$ would suppress the difference in similarities between the positive and the negative, leading to many false positives included in the positive-enhanced learning. If $\tau'$ is too small, less positive instances could be identified and this would again adversely affect the effectiveness of learning.
+
+
+Fig. 4. Effect of the number $K$ of top positives on the proposed CPM in the NTU-60 X-View task.
+
+
+Fig. 5. Effect of different temperature $\tau'$ on the performance in the NTU-60 X-View task.
+
+
+(a)
+
+
+(b)
+Fig. 6. t-SNE visualization of embedding for (a) CPM (w/o. PM) and (b) CPM on the NTU-60 X-View task (best view in color).
+
+**Embedding Visualization:** t-SNE [21] is used to visualize the embedding clustering produced by CPM (w/o. PM) and CPM as shown in Fig. 6. Note that embedding of 10 different action categories are sampled and visualized with different colors. The visual results show how well the embedding of the same type of actions form clusters while different types of actions are separated. By comparing the t-SNE of CPM and CPM (w/o. PM), CPM has clearly improved the clustering of actions, which indicates that the learned latent space is more discriminative than the space learned without using positive-enhanced learning strategy.
+
+# 5 Conclusion
+
+In this paper, a novel unsupervised learning framework called Contrastive Positive Mining (CPM) is developed for learning 3D skeleton action representation. The proposed CPM follows the SimSiam [4] structure, consisting of siamese encoders, student and target. By constructing a contextual queue and identifying non-self positive instances in the queue, the student encoder is able to learn a discriminative latent space by matching the similarity distributions of individual instance's two augments with respect to the instances in the queue. In addition, by identifying positive instances in the queue, a positive-enhanced learning strategy is developed to boost the robustness of the learned latent space against intra-class and inter-class diversity. Experiments on the NTU and PKU-MMD datasets have shown that the proposed CPM obtains the state-of-the-art results.
+
+# References
+
+1. Caetano, C., Brémond, F., Schwartz, W.R.: Skeleton image representation for 3d action recognition based on tree structure and reference joints. In: 2019 32nd SIBGRAPI conference on graphics, patterns and images (SIBGRAPI). pp. 16-23. IEEE (2019)
+2. Chen, J., Samuel, R.D.J., Poovendran, P.: LSTM with bio inspired algorithm for action recognition in sports videos. Image and Vision Computing 112, 104214 (2021)
+3. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+4. Chen, X., He, K.: Exploring simple siamese representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15750-15758 (2021)
+5. Fang, Z., Wang, J., Wang, L., Zhang, L., Yang, Y., Liu, Z.: Seed: Self-supervised distillation for visual representation. arXiv preprint arXiv:2101.04731 (2021)
+6. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P.H., Buchatskaya, E., Doersch, C., Pires, B.A., Guo, Z.D., Azar, M.G., et al.: Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733 (2020)
+7. Gui, L.Y., Wang, Y.X., Liang, X., Moura, J.M.: Adversarial geometry-aware human motion prediction. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 786-803 (2018)
+8. Gutmann, M.U., Hyvarinen, A.: Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. Journal of Machine Learning Research 13(2) (2012)
+9. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+0. Hou, Y., Li, Z., Wang, P., Li, W.: Skeleton optical spectra-based action recognition using convolutional neural networks. IEEE Transactions on Circuits and Systems for Video Technology 28(3), 807-811 (2018)
+1. Ke, Q., Bennamoun, M., An, S., Sohel, F., Boussaid, F.: A new representation of skeleton sequences for 3d action recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3288-3297 (2017)
+2. Kundu, J.N., Gor, M., Uppala, P.K., Radhakrishnan, V.B.: Unsupervised feature learning of human actions as trajectories in pose embedding manifold. In: 2019 IEEE winter conference on applications of computer vision (WACV). pp. 1459-1467. IEEE (2019)
+3. Li, J., Wong, Y., Zhao, Q., Kankanhalli, M.S.: Unsupervised learning of view-invariant action representations. arXiv preprint arXiv:1809.01844 (2018)
+4. Li, L., Wang, M., Ni, B., Wang, H., Yang, J., Zhang, W.: 3d human action representation learning via cross-view consistency pursuit. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4741-4750 (2021)
+5. Lin, L., Song, S., Yang, W., Liu, J.: Ms2l: Multi-task self-supervised learning for skeleton based action recognition. In: Proceedings of the 28th ACM International Conference on Multimedia. pp. 2490-2498 (2020)
+6. Liu, J., Song, S., Liu, C., Li, Y., Hu, Y.: A benchmark dataset and comparison study for multi-modal human action analytics. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM) 16(2), 1-24 (2020)
+
+17. Liu, J., Shahroudy, A., Perez, M., Wang, G., Duan, L.Y., Kot, A.C.: Ntu rgb+ d 120: A large-scale benchmark for 3d human activity understanding. IEEE transactions on pattern analysis and machine intelligence 42(10), 2684-2701 (2019)
+18. Liu, M., Liu, H., Chen, C.: 3d action recognition using multiscale energy-based global ternary image. IEEE Transactions on Circuits and Systems for Video Technology 28(8), 1824-1838 (2017)
+19. Loshchilov, I., Hutter, F.: Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983 (2016)
+20. Luo, Z., Peng, B., Huang, D.A., Alahi, A., Fei-Fei, L.: Unsupervised learning of long-term motion dynamics for videos. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2203-2212 (2017)
+21. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008)
+22. Noroozi, M., Favaro, P.: Unsupervised learning of visual representations by solving jigsaw puzzles. In: European conference on computer vision. pp. 69-84. Springer (2016)
+23. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748 (2018)
+24. Rao, H., Xu, S., Hu, X., Cheng, J., Hu, B.: Augmented skeleton based contrastive action learning with momentum lstm for unsupervised action recognition. Information Sciences 569, 90-109 (2021)
+25. Shahroudy, A., Liu, J., Ng, T.T., Wang, G.: Ntu rgb+ d: A large scale dataset for 3d human activity analysis. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1010-1019 (2016)
+26. Shi, Z., Kim, T.K.: Learning and refining of privileged information-based rnns for action recognition from depth sequences. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3461-3470 (2017)
+27. Si, C., Chen, W., Wang, W., Wang, L., Tan, T.: An attention enhanced graph convolutional LSTM network for skeleton-based action recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1227-1236 (2019)
+28. Song, S., Lan, C., Xing, J., Zeng, W., Liu, J.: Spatio-temporal attention-based LSTM networks for 3d action recognition and detection. IEEE Transactions on image processing 27(7), 3459-3471 (2018)
+29. Srivastava, N., Mansimov, E., Salakhudinov, R.: Unsupervised learning of video representations using lstms. In: International conference on machine learning. pp. 843-852. PMLR (2015)
+30. Su, K., Liu, X., Shlizerman, E.: Predict & cluster: Unsupervised skeleton based action recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9631-9640 (2020)
+31. Sun, N., Leng, L., Liu, J., Han, G.: Multi-stream slowfast graph convolutional networks for skeleton-based action recognition. Image and Vision Computing 109, 104141 (2021)
+32. Tarvainen, A., Valpola, H.: Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780 (2017)
+33. Thoker, F.M., Doughty, H., Snoek, C.G.: Skeleton-contrastive 3d action representation learning. In: Proceedings of the 29th ACM International Conference on Multimedia. pp. 1655–1663 (2021)
+
+34. Tian, Y., Krishnan, D., Isola, P.: Contrastive multiview coding. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16. pp. 776-794. Springer (2020)
+35. Wang, P., Li, W., Gao, Z., Zhang, Y., Tang, C., Ogunbona, P.: Scene flow to action map: A new representation for rgb-d based action recognition with convolutional neural networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 595-604 (2017)
+36. Wei, C., Xie, L., Ren, X., Xia, Y., Su, C., Liu, J., Tian, Q., Yuille, A.L.: Iterative reorganization with weak spatial constraints: Solving arbitrary jigsaw puzzles for unsupervised representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1910-1919 (2019)
+37. Wu, Z., Xiong, Y., Yu, S.X., Lin, D.: Unsupervised feature learning via nonparametric instance discrimination. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3733-3742 (2018)
+38. Xiao, Y., Chen, J., Wang, Y., Cao, Z., Zhou, J.T., Bai, X.: Action recognition for depth video using multi-view dynamic images. Information Sciences 480, 287-304 (2019)
+39. Yan, S., Xiong, Y., Lin, D.: Spatial temporal graph convolutional networks for skeleton-based action recognition. In: Thirty-Second AAAI Conference on Artificial Intelligence (2018)
+40. You, Y., Gitman, I., Ginsburg, B.: Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888 (2017)
+41. Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised learning via redundancy reduction. arXiv preprint arXiv:2103.03230 (2021)
+42. Zhang, H., Hou, Y., Wang, P., Guo, Z., Li, W.: SAR-nas: Skeleton-based action recognition via neural architecture searching. Journal of Visual Communication and Image Representation 73, 102942 (2020)
+43. Zhang, X., Xu, C., Tao, D.: Context aware graph convolution for skeleton-based action recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 14333-14342 (2020)
+44. Zheng, N., Wen, J., Liu, R., Long, L., Dai, J., Gong, Z.: Unsupervised representation learning with long-term dynamics for skeleton based action recognition. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 32 (2018)
\ No newline at end of file
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/images.zip b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e0cec88253060d388c9973565a6f235759363a44
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb4e6be92e6ecd5d7a3be8655c748a5069fda731bd416ed50f0093c6ab72cf42
+size 321713
diff --git a/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/layout.json b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ecfe8f0f267826f9db17816e077903001cbeec38
--- /dev/null
+++ b/contrastivepositiveminingforunsupervised3dactionrepresentationlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6726515f153b541fa2ea6088524b6071931cd38ce8ebcebb37136317b79cbf29
+size 347169
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_content_list.json b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..86ba069da298fb5284052bc79e890f87eea5cdaa
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0d7ab8288e74293c7c5e66c237b75e3bea15164856cf8fed8cd62d69d0cc7be
+size 84967
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_model.json b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3a0aa0fb1501bef84eaeb0b68bfe473e51e6e18b
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:798d6d21edbac54d57094dfca1c565be458ba07ad91a68da56a9b615aa5e4796
+size 106165
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_origin.pdf b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d786b73ab19ed16229bbcdfd8afb696a65bbd6b6
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/b4195323-617c-4ef4-ad7a-275902cdc694_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3ff3be6a810093bb4ace27931aa1022f94498d0568bf8199755a03fc368ede3e
+size 5572392
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/full.md b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a3c1de5c7cf6f280eaaa829a71b7c3fb36a656f1
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/full.md
@@ -0,0 +1,293 @@
+# Contrastive Prototypical Network with Wasserstein Confidence Penalty
+
+Haoqing Wang Zhi-Hong Deng\*
+
+School of Artificial Intelligence, Peking University
+
+wanghaoqing@pku.edu.cn zhdeng@pku.edu.cn
+
+Abstract. Unsupervised few-shot learning aims to learn the inductive bias from unlabeled dataset for solving the novel few-shot tasks. The existing unsupervised few-shot learning models and the contrastive learning models follow a unified paradigm. Therefore, we conduct empirical study under this paradigm and find that pairwise contrast, meta losses and large batch size are the important design factors. This results in our CPN (Contrastive Prototypical Network) model, which combines the prototypical loss with pairwise contrast and outperforms the existing models from this paradigm with modestly large batch size. Furthermore, the one-hot prediction target in CPN could lead to learning the sample-specific information. To this end, we propose Wasserstein Confidence Penalty which can impose appropriate penalty on overconfident predictions based on the semantic relationships among pseudo classes. Our full model, CPNWCP (Contrastive Prototypical Network with Wasserstein Confidence Penalty), achieves state-of-the-art performance on miniImageNet and tieredImageNet under unsupervised setting. Our code is available at https://github.com/Haoqing-Wang/CPNWCP.
+
+Keywords: Unsupervised few-shot learning $\cdot$ Contrastive learning $\cdot$ Confidence penalty $\cdot$ Wasserstein distance
+
+# 1 Introduction
+
+Humans have the ability to learn from limited labeled data, yet it is still a challenge for modern machine learning systems. Few-shot learning [15, 40, 27, 53, 44] is proposed to imitate this ability and has attracted significant attention from the machine learning community recently. Before solving novel few-shot tasks, most models typically learn task-shared inductive bias from sufficient labeled data (base dataset). However, obtaining sufficient labeled data for certain domains may be difficult or even impossible in practice, such as satellite imagery and skin diseases. When only the unlabeled data from the same domain as the novel tasks is available, we can learn the inductive bias in the unsupervised manner, which is formalized as the unsupervised few-shot learning.
+
+Existing unsupervised few-shot learning models focus on constructing pseudo training tasks from unlabeled dataset with clustering based methods [21, 23] or
+
+data augmentation based methods [25, 54, 26]. The latter ones usually achieve better performance, which randomly select a batch of samples from the unlabeled dataset and generate in-class samples for each one to form the support and query set via hand-craft or learnable data augmentations [25, 54, 26]. The synthetic pseudo tasks are used to train the meta-learning models [40, 27, 43].
+
+Concurrently, contrastive learning [9, 16, 51, 11] achieves outstanding success in the field of self-supervised representation learning and can be directly used in unsupervised few-shot learning. These models also randomly select a batch of samples from the unlabeled dataset and generate different views for each one via well-designed data augmentations. The key motivation is to push the views of the same sample (positive pair) close to each other and the views of different samples (negative pair) away from each other in embedding space. To this end, they propose different contrastive losses, such as a lower bound on the mutual information [9, 18], the asymmetric similarity loss [16] or the difference between the cross-correlation matrix and the identity matrix [51].
+
+If we consider the contrastive loss as a meta-learning objective where the augmented views form a training sub-task, the contrastive learning models are essentially the same as the data augmentation based unsupervised few-shot learning models. Therefore, we take a closer look at this paradigm and conduct empirical study to find the key design factors, as shown in Section 4.3. Concretely, the contrastive learning models typically can achieve better performance than unsupervised few-shot learning models, while we find their superiority actually comes from the larger batch size and pairwise contrast. Although the key motivation is appropriate, the specific contrastive losses (e.g., a lower bound on the mutual information) are not as suitable for few-shot learning as some meta losses, which limits its performance. Therefore, we combine the prototypical loss [40] with pairwise contrast and get CPN (Contrastive Prototypical Network). With the modestly large batch size, CPN outperforms both the unsupervised few-shot learning models and the contrastive learning models.
+
+Furthermore, some negative pairs could be semantically similar or even belong to the same semantic class in CPN. This problem is also referred to as "class collision" [3] or "sampling bias" [12, 48] in contrastive learning, as shown in Fig. 1(a). Using one-hot prediction target could overly push view $b_{2}$ close to view $b_{1}$ while away from view $a_{1}$ and make the representations ignoring the semantic information about birds and learning the sample-specific information, like background and color distribution. Therefore, we make the prediction distribution in CPN approximating a latent distribution (e.g., the uniform distribution) to prevent overconfident one-hot prediction during training. The most related methods, Label Smoothing [41, 33] and Confidence Penalty [34], use $f$ -divergence to measure the difference between the prediction distribution and the latent distribution. However, $f$ -divergence does not consider the semantic relationships among classes, since the difference in the prediction probability of each class is computed independently. Instead, we use the Wasserstein distance [7] which can impose appropriate penalty based on the semantic relationships among classes. We solve the optimal transport problem using Sinkhorn iteration [13, 1] which
+
+
+(a)
+Fig. 1. (a) Some negative pairs (e.g., $(a_{1}, b_{2})$ ) may be semantically similar or even belong to the same semantic class. (b) Overview of our CPNWCP model. We select a batch of samples and generate in-class samples for each one via data augmentations. We combine the prototypical loss with pairwise contrast. To alleviate the problem of learning sample-specific information, we propose Wasserstein Confidence Penalty which makes the prediction distribution approximating the uniform distribution.
+
+
+(b)
+
+works well with the automatic differentiation libraries for deep learning, without computing the second-order gradients. This method is denoted as Wasserstein Confidence Penalty, which effectively alleviates the problem of learning sample-specific information.
+
+The framework of our full model, CPNWCP (Contrastive Prototypical Network with Wasserstein Confidence Penalty), is shown in Fig. 1(b). The main contributions of this work are as follows:
+
+- Under a unified paradigm of contrastive learning and unsupervised few-shot learning, we conduct empirical study and find that pairwise contrast, metal losses and large batch size are the key factors to the satisfactory performance on novel few-shot tasks, which results in our CPN model.
+- To prevent CPN from learning sample-specific information, we propose Wasserstein Confidence Penalty which significantly improves the performance of CPN and outperforms the $f$ -divergence based confidence penalty methods.
+- Our CPNWCP model achieves state-of-the-art performance on standard unsupervised few-shot learning datasets, miniImageNet and tieredImageNet.
+
+# 2 Related work
+
+Unsupervised few-shot learning. Although various few-shot learning models [40, 15, 27, 53, 5] have achieved impressive performance, they rely on sufficient labeled data during training, which is difficult to acquire in some domains. Unsupervised few-shot learning [21, 23, 25, 54, 2, 50, 26] aims to learn the task-shared inductive bias from the unlabeled dataset. These models generate pseudo few-shot tasks to train the meta-learning models through various techniques. [21, 23] construct the partitions of unlabeled dataset through clustering in the embedding space and thus obtain the pseudo labels. [25, 54, 2, 50] randomly select a batch of samples with small batch size (e.g., 5) and each sample is assumed from the different
+
+class. They generate the in-class samples via data augmentations to construct the support set and query set. LASIUM [26] generate the in-class and out-of-class samples via interpolation in the latent space of a generative model. Besides, ProtoTransfer [30] also constructs few-shot tasks via data augmentations, but uses a large batch size and achieves significant improvement. It means that large batch size may be a key factor to the good performance on novel few-shot tasks.
+
+Contrastive learning. Contrastive learning [4, 18, 9, 51, 45] is a successful self-supervised representation learning [24, 46] framework that learns well-generalizing representations from large scale unlabeled dataset. In the training phase, they typically select a batch of samples from the unlabeled dataset and generate different views for each sample via data augmentations. Generally, they push the views from the same sample (positive pair) close to each other and the views from different samples (negative pair) away from each other in the embedding space. The training objectives are typically to maximize the lower bound on the mutual information [20, 4, 18, 9, 47] or make the cross-correlation matrix between positive pair as close to the identity matrix as possible [51], which indirectly learn semantic relevance among samples (linear separability or proximity in the embedding space) and not as suitable for few-shot learning as some meta-losses. Contrastive learning avoids representation collapse via large batch size and it also adapts pairwise contrast, i.e., each view is compared with all other views from the same sample, which is helpful for learning useful representations. Chuang et al. [12] and Wei et al. [48] point out the "sampling bias" problem, and propose a debiased objective and consistency regularization respectively.
+
+Confidence penalty. For a network, over-confident prediction is a symptom of overfitting. For this end, Label Smoothing [41, 33, 52] relaxes the one-hot label to a soft version which is equivalent to adding uniform label noise. Confidence Penalty [34] penalizes low entropy prediction following the maximum entropy principle [22]. They essentially make the prediction distribution approximating a latent distribution, such as the uniform distribution or a learnable distribution [52]. Both Label Smoothing and Confidence Penalty use $f$ -divergence to measure the difference between distributions, which ignores the semantic relationships among classes. We explore the Wasserstein distance and introduce the semantic relationships with cost matrix. With semantic relationships as prior information, our Wasserstein Confidence Penalty can impose appropriate penalty and outperforms both Label Smoothing and Confidence Penalty in CPN.
+
+# 3 Methodology
+
+# 3.1 Preliminaries
+
+Few-shot learning aims to obtain the model which can efficiently and effectively solve novel few-shot tasks. Each few-shot task contains a support set $\mathcal{S}$ and a query set $\mathcal{Q}$ . When the support set $\mathcal{S}$ contains $N$ classes with $K$ samples in each class, the few-shot task is called a $N$ -way $K$ -shot task, and $N = 5$ and
+
+$K = 1$ or $5$ is the standard setting. The query set $\mathcal{Q}$ contains the samples from the same classes with the support set $\mathcal{S}$ . We need to classify the samples in the query set correctly based on the few labeled data from the support set. Since $K$ is typically very small, this is challenging for modern deep learning models. To this end, one can learn the inductive bias from a large base training set $\mathcal{D}$ , which has completely disjoint classes with the novel tasks. Meta-learning models [40, 15, 27] adapt episode training [42], where few-shot training tasks are constructed from the base training set $\mathcal{D}$ . Some non-episodical transfer learning models [10, 14, 55] also achieve comparable performance.
+
+In most cases, the large base training set $\mathcal{D}$ is labeled, so we can easily construct few-shot training tasks based on labels. However, obtaining sufficient labeled dataset is difficult or even impossible for some domains, e.g., satellite imagery and skin diseases, so we assume the training set is unlabeled in this work and learn the inductive bias in the unsupervised manner.
+
+# 3.2 Contrastive Prototypical Network
+
+We first describe a unified paradigm, and then take the data augmentation based unsupervised few-shot learning models, contrastive learning models and our CPN model as its special cases.
+
+Given an unlabeled dataset $\mathcal{D}$ , samples $\{x_{i}\}_{i = 1}^{N}$ are randomly selected and each $x_{i}$ represents a pseudo class. For each $x_{i}$ , in-class samples $\{v_{i}^{j}\}_{j = 1}^{M}$ are generated via manually or learnable data augmentations. For a specific problem, the loss function $\mathcal{L}$ is designed and calculated on the sub-dataset $\{v_{i}^{j}\}_{i = 1,j = 1}^{N,M}$ and the sub-task training objective is
+
+$$
+\underset {\theta} {\min } \mathbb {E} _ {p \left(\left\{v _ {i} ^ {j} \right\} _ {i = 1, j = 1} ^ {N, M}\right)} [ \mathcal {L} \left(\left\{v _ {i} ^ {j} \right\} _ {i = 1, j = 1} ^ {N, M}, \theta\right) ] \tag {1}
+$$
+
+where $\theta$ represents the model parameters. We denote this paradigm as the Sampling-Augmentation paradigm.
+
+Data augmentation based unsupervised few-shot learning models [25, 54, 26] follow this paradigm and achieve outstanding performance. Let $M = S + Q$ , the augmented samples $\{v_i^j\}_{i=1,j=1}^{N,M}$ constitute a pseudo S-shot training task with $N \cdot S$ samples as the support set $\mathcal{S}$ and the $N \cdot Q$ samples as the query set $\mathcal{Q}$ . These pseudo few-shot tasks can be directly used to train the meta-learning models, which means $\mathcal{L}$ can be various meta losses and the training objective is
+
+$$
+\min _ {\theta} \mathbb {E} _ {p (\{v _ {i} ^ {j} \} _ {i = 1, j = 1} ^ {N, M})} [ \mathcal {L} ^ {m e t a} (\{v _ {i} ^ {j} \} _ {i = 1, j = S + 1} ^ {N, M}, \psi) ], \quad \psi = \mathcal {A} (\{v _ {i} ^ {j} \} _ {i = 1, j = 1} ^ {N, S}, \theta) \tag {2}
+$$
+
+where $\mathcal{A}$ is a base learner and $\psi$ is the task solution. Following the episode training, $N$ is typically set small while $M$ is set large, such as $N = 5$ and $M = 5 + 15$ . This setting is popular in the few-shot learning, since it makes the training setting aligning with the test scenario. However, we find that the small batch size is not suitable for unsupervised few-shot learning, as shown in Fig. 2.
+
+Most contrastive learning models [20, 4, 18, 9] also follow this paradigm and achieve outstanding success in the field of self-supervised representation learning.
+
+It is usually assumed that different views $\{v_i^j\}_{j = 1}^M$ share the semantic information from the input $x_{i}$ , so the view-invariant representations are expected. For example, many contrastive learning models [20,49,18,9] maximize the mutual information between the representations of positive pair, and the training loss is the InfoNCE lower bound estimate [35]. $M$ is typically set 2 for simplicity and the training objective is
+
+$$
+\min _ {\theta} \mathbb {E} _ {p \left(\left\{v _ {i} ^ {j} \right\} _ {i = 1, j = 1} ^ {N, 2}\right)} \left[ \right. - \frac {1}{2 N} \sum_ {i = 1} ^ {N} \sum_ {j, l = 1; j \neq l} ^ {2} \ln \frac {\exp \left(h _ {\theta} \left(g _ {\theta} \left(v _ {i} ^ {j}\right) , g _ {\theta} \left(v _ {i} ^ {l}\right)\right)\right)}{\sum_ {s = 1} ^ {N} \sum_ {t = 1 , (s , t) \neq (i , j)} ^ {2} \exp \left( \right.h _ {\theta} \left(g _ {\theta} \left(v _ {i} ^ {j}\right) , g _ {\theta} \left(v _ {s} ^ {l}\right)\right)} \left. \right] \tag {3}
+$$
+
+where $g_{\theta}$ is an encoder network and $h_{\theta}$ contains a multilayer perceptron used to calculate the InfoNCE lower bound. Each view $v_{i}^{j}$ is compared with all other views $\{v_{i}^{l}\}_{l = 1}^{M}, l \neq j$ from the same sample $x_{i}$ , i.e., pairwise contrast, which is useful in unsupervised few-shot learning, as shown in Table 3. The batch size $N$ is typically set large to avoid representation collapse, such as $N = 4096$ in SimCLR [9]. Although the contrastive learning models can be applied in unsupervised few-shot learning, their training losses indirectly learn the semantic relevance among samples, e.g., using mutual information or cross-correlation matrix [51], which are not as suitable as directly comparing the representations of different views, like prototypical loss, as shown in Fig. 2.
+
+Our CPN model combines the advantages of both the contrastive learning models and the data augmentation based unsupervised few-shot learning models. We adopt a big batch size and introduce pairwise contrast to a widely used meta loss, prototypical loss [40]. The training objective is
+
+$$
+\min _ {\theta} \mathbb {E} _ {p (\{v _ {i} ^ {j} \} _ {i = 1, j = 1} ^ {N, M})} \left[ - \frac {1}{N M ^ {2}} \sum_ {l = 1} ^ {M} \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {M} \ln \frac {\exp (- \| g _ {\theta} (v _ {i} ^ {j}) - g _ {\theta} (v _ {i} ^ {l}) \| ^ {2})}{\sum_ {k = 1} ^ {N} \exp (- \| g _ {\theta} (v _ {i} ^ {j}) - g _ {\theta} (v _ {k} ^ {l}) \| ^ {2})} \right] (4)
+$$
+
+The $l$ -th view $\{v_i^l\}_{i = 1}^N$ is used as the one-shot support set to classify all the views. We directly compare the representations of different views without using the multilayer perceptron to calculate mutual information estimation. With modestly large batch size, our CPN outperforms both the unsupervised few-shot learning models and some classical contrastive learning models.
+
+In addition to the empirical study, we also provide some theoretical or intuitive justification for the above key factors.
+
+1) Pairwise contrast. Each positive pair provides supervised information to each other under the unsupervised setting [45], and the model learns semantic knowledge from the shared information between views. Obviously, pairwise contrast brings more shared information between views which contains more useful knowledge. Concretely, assuming there are $M$ views, we have $I_{pc} = \sum_{l=1}^{M} \sum_{k \neq l} I(v_l, v_k) \geq I_{w/o pc} = \sum_{k \neq 1} I(v_1, v_k)$ , where 'pc' represents 'pairwise contrast' and we set view $v_1$ as the anchor view when without pairwise contrast.
+
+2) Meta losses. Compared with the contrastive losses which indirectly learn the semantic relevance among samples via mutual information or cross-correlation matrix, the meta losses typically directly compare the representations of different views (especially the metric-based meta losses), and are more suitable for few-shot scenarios, i.e., semantic matching between support and query samples.
+
+3) Large batch size. In the instance discrimination task, the number of classes is directly related to the batch size. Our CPN and some contrastive learning models adopt the cross-entropy loss and may encounter log- $K$ curse [8]. Concretely, the cross-entropy loss is $\mathbf{H} = -\log \frac{\exp(s_y)}{\sum_{i=1}^{N}\exp(s_i)} = \log (1 + \sum_{i \neq y}\exp(s_i - s_y))$ , where $(s_1, \dots, s_N)$ is the prediction logits. After several training epochs, $s_y$ is significantly larger than $s_i, i \neq y$ and $\exp(s_i - s_y), i \neq y$ are small, so $\mathbf{H} \approx \log (1 + (N - 1)\epsilon)$ with $\epsilon$ is a small constant. When we use a small batch size, $\mathbf{H} \approx (N - 1)\epsilon \approx 0$ and floating-point precision can lead to large gradient variance, hurting performance.
+
+# 3.3 Wasserstein Confidence Penalty
+
+As shown in Fig. 1(a), some negative pairs in CPN could be semantically similar or even belong to the same semantic class. Using the one-hot prediction target as in Eq. (4) could overly push the semantically similar negative pairs away from each other, which has the risk of learning sample-specific information rather than generalizing semantic information in the representations.
+
+Further, when we use a large batch size, this problem becomes serious since the probability that the samples from the same semantic class appear in the selected batch significantly increases. For this end, we make the prediction distribution approximating a latent distribution during training to prevent overconfident prediction, which we denote as confidence penalty. For CPN, when we use $\{v_i^l\}_{i = 1}^N$ as one-shot support set, the prediction distribution of a view $v$ is $p_{\theta}^{l}(i|v) = \frac{\exp(-\|g_{\theta}(v) - g_{\theta}(v_{i}^{l})\|^{2})}{\sum_{k = 1}^{N}\exp(-\|g_{\theta}(v) - g_{\theta}(v_{k}^{l})\|^{2})}$ . We introduce a plug-and-play confidence penalty term $D(p_{\theta}^{l}(i|v),q)$ , where $D(\cdot ,\cdot)$ is a distance metric between distributions and $q$ represents a latent distribution. Therefore, the Eq. (4) becomes
+
+$$
+\min _ {\theta} \mathbb {E} _ {p \left(\left\{v _ {i} ^ {j} \right\} _ {i = 1, j = 1} ^ {N, M}\right)} \left[ \frac {1}{N M ^ {2}} \sum_ {l = 1} ^ {M} \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {M} \left(- \ln p _ {\theta} ^ {l} \left(i \mid v _ {i} ^ {j}\right) + \lambda D \left(p _ {\theta} ^ {l} \left(i \mid v _ {i} ^ {j}\right), q\right)\right) \right] \tag {5}
+$$
+
+where $\lambda$ is a weight coefficient. The ideal choice for distribution $q$ is the ground-truth class distribution in the instance classification task, which has non-ignorable probability in the semantically similar pseudo classes and we can not obtain it without labels. Therefore, we simply set $q$ as the uniform distribution, i.e., $q_{k} = 1 / N,k = 1,\dots ,N$ . For distance metric $D$ , we consider different choices.
+
+For simplicity, let $e$ be a one-hot distribution and $p$ be the prediction distribution, a widely-used choice for distance metric $D(p,q)$ is the $f$ -divergence $D(p,q) = \sum_{k=1}^{N} f(p_k / q_k) \cdot q_k$ , where $f$ is a convex function with $f(1) = 0$ . When $f(z) = z \ln z$ , the $f$ -divergence becomes the Kullback-Leibler divergence $D(p,q) = KL(p \| q) = \sum_{k=1}^{N} p_k \ln p_k + \ln N$ . This is the regularization term from [34], named Confidence Penalty. It penalizes low entropy prediction distributions following the maximum entropy principle [22] and is also used in reinforcement learning [29, 32]. When $f(z) = -\ln z$ , the $f$ -divergence becomes the reverse Kullback-Leibler divergence $KL(q \| p)$ and this regularization term
+
+is equivalent to Label Smoothing [41, 33]. Concretely, $H(e,p) + \lambda KL(q\| p) = H(e + \lambda q,p) - \lambda \ln N$ , where $H(e,p) = -\sum_{k = 1}^{N}e_k\ln p_k$ is cross-entropy. $e + \lambda q$ is equivalent to $(1 - \alpha)e + \alpha q$ , which is just the target distribution in Label Smoothing and $\alpha$ is typically set 0.1. When $f(z) = [(z + 1)\ln (2 / (z + 1)) + z\ln z] / 2$ , we get a symmetric $f$ -divergence, Jensen-Shannon divergence.
+
+The difference in the probability of each class is computed independently in $f$ -divergence and the structural information, i.e., the semantic relationships among different classes, is ignored. For this end, we use the Wasserstein distance [7] $W(p,q)$ to introduce the semantic relationships as the prior knowledge. To calculate $W(p,q)$ , we need to solve the optimal transport problem
+
+$$
+\min _ {T} \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {N} T _ {i j} \cdot C _ {i j} \tag {6}
+$$
+
+$$
+s. t. \quad T _ {i j} \geq 0, i = 1, \dots , N, j = 1, \dots , N
+$$
+
+$$
+\sum_ {j = 1} ^ {N} T _ {i j} = p _ {i}, i = 1, \dots , N; \quad \sum_ {i = 1} ^ {N} T _ {i j} = q _ {j}, j = 1, \dots , N
+$$
+
+where $T \in \mathbb{R}^{N \times N}$ is a transportation matrix and $C \in \mathbb{R}^{N \times N}$ is the cost matrix. $C_{ij}$ represents the cost of transporting per unit probability from class $i$ to class $j$ . $T_{ij}$ represents the amount of the probability transported from class $i$ to class $j$ . Let the solution of the problem (6) be $T^*$ , which is the matching flows with the minimum cost between $p$ and $q$ , we have $W(p, q) = \sum_{i=1}^{N} \sum_{j=1}^{N} T_{ij}^* \cdot C_{ij}$ . The cost matrix $C$ is the key to introduce the structural information. $C_{ij}$ can be understood as the cost of misclassifying a sample from class $i$ to class $j$ . Intuitively, the higher the semantic similarity between class $i$ and class $j$ , the smaller the transportation cost $C_{ij}$ should be. Therefore, we define the transportation cost as a decreasing function of class similarity
+
+$$
+C _ {i j} = \gamma \cdot \left(1 - S _ {i j}\right) + \mathbb {I} _ {i = j} \tag {7}
+$$
+
+where $\gamma$ is a scaling factor, $\mathbb{I}_{i = j}$ is an indicator function in the condition $i = j$ and is used to avoid zero cost, and $S_{ij}$ represents the semantic similarity between class $i$ and class $j$ . Although this definition can not satisfy $W(p,p) = 0$ , we find avoiding zero cost can achieve better performance in practice. In the batch of samples $\{x_i\}_{i = 1}^N$ , we label each $x_{i}$ as a pseudo class $i$ . Considering that mean can weaken sample differences and highlight intra-class commonality, we use the mean of the representations of views $\{v_i^j\}_{j = 1}^M$ to represent each pseudo class $i$ and use their cosine similarity as the class similarity, i.e., $S_{ij} = \frac{r_i^T r_j}{\|r_i\| \|r_j\|}$ with $r_i = \frac{1}{M}\sum_{j = 1}^{M}g_{\theta}(v_i^j)$ . We thus can measure the difference between distributions in a way that is sensitive to semantic relationships among classes.
+
+To solve the problem (6), we use the Sinkhorn iteration [13, 1] which enforces a simple structure on the optimal transportation matrix and can quickly solve the optimal transport problem. The gradients can be back-propagated along the iteration process, so it works well with the automatic differentiation libraries for
+
+Table 1. Few-shot classification accuracy(%) with $95\%$ confidence interval on 10,000 5-way $K$ -shot tasks randomly sampled from miniImageNet.
+
+| Model | 1-shot | 5-shot | 20-shot | 50-shot |
| Train from scratch [21] | 27.59 ± 0.59 | 38.48 ± 0.66 | 51.53 ± 0.72 | 59.63 ± 0.74 |
| CACTUs-ProtoNet [21] | 39.18 ± 0.71 | 53.36 ± 0.70 | 61.54 ± 0.68 | 63.55 ± 0.64 |
| CACTUs-MAML [21] | 39.90 ± 0.74 | 53.97 ± 0.70 | 63.84 ± 0.70 | 69.64 ± 0.63 |
| UMTRA [25] | 39.93 | 50.73 | 61.11 | 67.15 |
| ULDA-ProtoNet [36] | 40.63 ± 0.61 | 56.18 ± 0.59 | 64.31 ± 0.51 | 66.43 ± 0.47 |
| ULDA-MetaOptNet [36] | 40.71 ± 0.62 | 54.49 ± 0.58 | 63.58 ± 0.51 | 67.65 ± 0.48 |
| LASIUM-ProtoNet [26] | 40.05 ± 0.60 | 52.53 ± 0.51 | 59.45 ± 0.48 | 61.43 ± 0.45 |
| LASIUM-MAML [26] | 40.19 ± 0.58 | 54.56 ± 0.55 | 65.17 ± 0.49 | 69.13 ± 0.49 |
| ArL-RelationNet [54] | 36.37 ± 0.92 | 46.97 ± 0.86 | - | - |
| ArL-ProtoNet [54] | 38.76 ± 0.84 | 51.08 ± 0.84 | - | - |
| ArL-SoSN [54] | 41.13 ± 0.84 | 55.39 ± 0.79 | - | - |
| SimCLR [9] | 40.91 ± 0.19 | 57.22 ± 0.17 | 65.74 ± 0.15 | 67.83 ± 0.15 |
| BYOL [16] | 39.81 ± 0.18 | 56.65 ± 0.17 | 64.58 ± 0.15 | 66.69 ± 0.15 |
| BarTwins [51] | 39.02 ± 0.18 | 57.20 ± 0.17 | 65.26 ± 0.15 | 67.42 ± 0.14 |
| ProtoCLR [30] | 44.89 ± 0.58 | 63.35 ± 0.54 | 72.27 ± 0.45 | 74.31 ± 0.45 |
| CPNWCP (ours) | 47.93 ± 0.19 | 66.44 ± 0.17 | 75.69 ± 0.14 | 78.20 ± 0.13 |
| ProtoNet-Sup [40] | 49.42 ± 0.78 | 68.20 ± 0.66 | - | - |
+
+deep learning. Besides, there is no gradient calculation in the forward iterations, so the optimization process does not need to calculate the second-order gradients. This regularization method is denoted as Wasserstein Confidence Penalty.
+
+We apply Wasserstein Confidence Penalty to CPN and get CPNWCP (Contrastive Prototypical Network with Wasserstein Confidence Penalty) model which has the training objective of Eq. (5).
+
+# 4 Experiments
+
+# 4.1 Experimental Settings
+
+Datasets. We evaluate the models on two standard few-shot learning benchmarks, miniImageNet [42] and tieredImageNet [38]. The miniImageNet dataset is a subset of ImageNet [39] and consists of 100 classes with 600 images per class. Following the commonly-used protocol from [37], we use 64 classes as the base training set, 16 and 20 classes as validation set and test set respectively. The tieredImageNet dataset is a larger subset of ImageNet, composed of 608 classes grouped into 34 high-level categories. These categories are divided into 20 categories for training, 6 categories for validation and 8 categories for test, which corresponds to 351, 97 and 160 classes respectively. In order to simulate the unsupervised setting, we do not use the labels in the training set during training, nor do we use the labeled validation set to select the best checkpoint.
+
+Table 2. Few-shot classification accuracy(%) with $95\%$ confidence interval on 10,000 5-way $K$ -shot tasks randomly sampled from tieredImageNet.
+
+| Model | 1-shot | 5-shot | 20-shot | 50-shot |
| Train from scratch [36] | 26.27 ± 1.02 | 34.91 ± 0.63 | 38.14 ± 0.58 | 38.67 ± 0.44 |
| ULDA-ProtoNet [36] | 41.60 ± 0.64 | 56.28 ± 0.62 | 64.07 ± 0.55 | 66.00 ± 0.54 |
| ULDA-MetaOptNet [36] | 41.77 ± 0.65 | 56.78 ± 0.63 | 67.21 ± 0.56 | 71.39 ± 0.53 |
| SimCLR [9] | 35.60 ± 0.17 | 52.88 ± 0.19 | 61.09 ± 0.17 | 63.47 ± 0.17 |
| BYOL [16] | 37.11 ± 0.18 | 52.71 ± 0.19 | 60.56 ± 0.17 | 62.68 ± 0.16 |
| BarTwins [51] | 35.39 ± 0.17 | 52.01 ± 0.18 | 60.19 ± 0.17 | 62.57 ± 0.16 |
| CPNWCP (ours) | 45.00 ± 0.19 | 62.96 ± 0.19 | 72.84 ± 0.17 | 76.03 ± 0.15 |
| ProtoNet-Sup [40] | 53.31 ± 0.89 | 72.69 ± 0.74 | - | - |
+
+Implementation details. For fair comparison with previous models [21, 25, 36, 26, 54, 30], we use Conv4 as the backbone which consists of four convolutional blocks with 64 filters for each convolutional layer. We also perform a series of experiments on ResNet12 [19] for comprehensive study. For all experiments, we use random cropping, flip and random color distortion as the data augmentations, like in [25, 30]. The models are trained for 600 epochs using Adam optimizer with the learning rate of 1e-3. We set the batch size $N = 64$ for miniImageNet and $N = 192$ for tieredImageNet. The number of augmented views for each sample is set $M = 4$ for Conv4 and $M = 8$ for ResNet12. For different datasets and backbones, we set the regularization coefficient $\lambda = 1$ and choose scaling factor $\gamma$ from $\{6, 8, 10, 12\}$ . We set the number of Sinkhorn iteration as 5. For Label Smoothing, we choose the label relaxation factor $\alpha$ from $\{0.1, 0.01, 0.001\}$ .
+
+Evaluation protocol. We evaluate the models in the standard 5-way 1-shot/5-shot tasks and the tasks with more support samples, i.e., 5-way 20-shot/50-shot tasks. We use 10,000 randomly sampled few-shot tasks with 15 query samples per class, and report the average accuracy (\%) as well as $95\%$ confidence interval. Unless otherwise specified, all non-meta-learning models, including our models and contrastive learning models, use a prototype-based nearest neighbor classifier [40] to solve the novel few-shot tasks based on the pre-trained backbone.
+
+# 4.2 Comparison with State-Of-The-Arts
+
+We compare our full model, CPNWCP, with existing unsupervised few-shot learning models [21, 25, 36, 30, 26, 54] and classical contrastive learning models [9, 16, 51]. Among them, Medina et al. [30] uses a large batch size prototypical loss but not pairwise contrast and Wasserstein Confidence Penalty. We report its results without further fine-tuning for fairness, i.e., the results of ProtoCLR. The results of training a classifier on the support set from scratch is used as the lower bound for performance. The results of supervised ProtoNet [40] are also provided as the supervised baseline. Table 1 and Table 2 provide the results on miniImageNet and tieredImageNet respectively, and the best unsupervised result in each
+
+
+(a) Backbone: Conv4
+
+
+(b) Backbone: ResNet12
+Fig. 2. Average few-shot classification accuracy across four different settings (5-way 1-shot/5-shot/20-shot/50-shot) on miniImageNet with varying batch size.
+
+Table 3. Few-shot classification accuracy(%) with $95\%$ confidence interval on 10,000 5-way $K$ -shot tasks sampled from miniImageNet. 'PC' represents 'pairwise contrast'.
+
+| Model | Backbone | 1-shot | 5-shot | 20-shot | 50-shot |
| CPN w/o PC | Conv4 | 46.08 ± 0.19 | 63.89 ± 0.17 | 72.59 ± 0.14 | 74.81 ± 0.14 |
| CPN | 46.96 ± 0.19 | 64.75 ± 0.17 | 73.31 ± 0.14 | 75.63 ± 0.14 |
| CPN w/o PC | ResNet12 | 48.80 ± 0.19 | 69.09 ± 0.16 | 78.54 ± 0.13 | 80.83 ± 0.12 |
| CPN | 50.01 ± 0.18 | 70.73 ± 0.16 | 80.33 ± 0.13 | 82.74 ± 0.11 |
+
+setting is in bold. All models use Conv4 as the backbone for fair comparison. As we can see, our CPNWCP outperforms all previous unsupervised few-shot learning models and classical contrastive learning models with a large margin, and achieves the performance much closer to the supervised baseline. Besides, many unsupervised methods (e.g., ULDA, SimCLR and our CPNWCP) have a larger gap to the supervised baseline on tieredImageNet than that on miniImageNet. The reason may be that, the classes in tieredImageNet are structural and there are many similar classes under the same category. These classes rely on label information to be well discriminated for learning relevant semantic knowledge, which is not friendly to unsupervised learning. Despite tieredImageNet is a more difficult dataset, our CPNWCP still significantly outperforms existing baselines.
+
+# 4.3 Empirical Study on Sampling-Augmentation Paradigm
+
+As shown in Table 1, contrastive learning models [9, 16, 51] outperform the models [21, 25, 36, 26, 54] which construct pseudo few-shot tasks with small batch size, but are inferior to the model [30] using large batch size and prototypical loss. This inspires us that when some meta losses are combined with large batch size, the contrastive losses have no advantage any more. Therefore, we empirically study three important factors in the Sampling-Augmentation paradigm: the loss function $\mathcal{L}$ , the batch size $N$ and the view number $M$ . We consider three classical contrastive losses [9, 16, 51] and a meta loss [40]. $N$ is chosen from $\{5, 32, 64, 128\}$ and $M$ is chosen from $\{2, 4, 6, 8\}$ . For fair comparison, we intro
+
+Table 4. Few-shot classification accuracy(%) with $95\%$ confidence interval on 10,000 5-way $K$ -shot tasks sampled from miniImageNet. We provide the results of Consistency Regularization ('+CR') [48], Label Smoothing ('+LS') [41], Confidence Penalty ('+CP') [34], Jensen-Shannon Confidence Penalty ('+JSCP') and our Wasserstein Confidence Penalty ('+WCP').
+
+| Model | Backbone | 1-shot | 5-shot | 20-shot | 50-shot |
| CPN | Conv4 | 46.96 ± 0.19 | 64.75 ± 0.17 | 73.31 ± 0.14 | 75.63 ± 0.14 |
| + CR [48] | 47.33 ± 0.19 | 65.15 ± 0.17 | 73.28 ± 0.14 | 75.50 ± 0.14 |
| + LS [41] | 47.19 ± 0.19 | 65.22 ± 0.17 | 74.21 ± 0.14 | 76.71 ± 0.13 |
| + CP [34] | 47.22 ± 0.19 | 65.46 ± 0.17 | 74.52 ± 0.14 | 77.05 ± 0.13 |
| + JSCP | 46.82 ± 0.19 | 64.89 ± 0.17 | 73.92 ± 0.14 | 76.37 ± 0.13 |
| + WCP (ours) | 47.93 ± 0.19 | 66.44 ± 0.17 | 75.69 ± 0.14 | 78.20 ± 0.13 |
| CPN | ResNet12 | 50.01 ± 0.18 | 70.73 ± 0.16 | 80.33 ± 0.13 | 82.74 ± 0.11 |
| + CR [48] | 51.85 ± 0.19 | 72.23 ± 0.16 | 81.35 ± 0.12 | 83.28 ± 0.11 |
| + LS [41] | 50.41 ± 0.19 | 71.10 ± 0.16 | 80.97 ± 0.12 | 83.61 ± 0.11 |
| + CP [34] | 50.71 ± 0.18 | 71.29 ± 0.16 | 81.11 ± 0.12 | 83.91 ± 0.11 |
| + JSCP | 49.87 ± 0.18 | 70.53 ± 0.16 | 81.01 ± 0.13 | 83.19 ± 0.11 |
| + WCP (ours) | 53.56 ± 0.19 | 73.21 ± 0.16 | 82.18 ± 0.12 | 84.35 ± 0.11 |
+
+duce pairwise contrast from contrastive learning to the prototypical loss, i.e., each view is used as the one-shot support set to classify other views.
+
+Considering that using the prototype-based nearest-neighbor classifier seems unfair for the comparison between the prototypical loss and contrastive losses, we provide the results with ridge regression classifier [6] in Fig. 2 which examines linear separability. 'CPN' represents prototypical loss with pairwise contrast, 'SimCLR', 'BYOL' and 'BarTwins' represent contrastive losses with pairwise contrast. Similar to Table 1, contrastive learning models with large batch size $N = 64$ outperform the prototypical loss with small batch size $N = 5$ . But when the batch size is the same, contrastive learning models consistently perform worse than the prototypical loss. Besides, more augmented views lead to better performance due to increased view diversity, especially for large backbone.
+
+To explore the effect of pairwise contrast, we evaluate the performance of CPN without pairwise contrast, i.e., only using one randomly selected view $\{v_{i}^{l}\}_{i = 1}^{N}$ as the one-shot support set to classify all views. The comparison results are shown in Table 3, where we still use a prototype-based nearest neighbor classifier [40]. We set $(N = 64$ , $M = 4)$ for Conv4 and $(N = 64$ , $M = 8)$ for ResNet12. As we can see, pairwise contrast achieves consistent performance improvement under different task settings and backbones, especially for large backbone. This shows its potential for larger backbones.
+
+# 4.4 Ablation Study on Confidence Penalty
+
+As we analyze in Section 3.3, since some negative pairs could be semantically similar or even from the same semantic class, using one-hot prediction target has
+
+
+(a) Backbone: Conv4
+
+
+(b) Backbone: ResNet12
+Fig. 3. Few-shot classification accuracy (\%) on 10,000 5-way 1-shot/5-shot/20-shot/50-shot tasks sampled from miniImageNet. We provide the results of Wasserstein Confidence Penalty with different scaling factor $\gamma = \{6,8,10,12\}$ . The results of CPN are also provided for clear comparison.
+
+the risk of learning sample-specific information instead of generalizing semantic information. This problem is also referred as 'sampling bias' [12] in contrastive learning, and Wei et al. [48] proposes Consistency Regularization to alleviate this problem, which can be directly used in CPN. In this work, we propose to make the prediction distribution approximating a latent distribution to prevent overconfident one-hot prediction. We consider different distance metrics between distributions and compare their effect in CPN, including classical $f$ -divergences and Wasserstein distance. We conduct experiments on miniImageNet and use both Conv4 and ResNet12 as backbone for comprehensive study.
+
+The few-shot classification results are shown in Table 4 and the best result in each setting is in bold. Most regularization methods consistently improve the performance of CPN. Using Jensen-Shannon divergence ('+JSCP') is inferior to using Kullback-Leibler divergence ('+CP' and '+LS'), which means symmetry is not required for the distance metric between the prediction distribution and the latent distribution. Using the Wasserstein distance ('+WCP') outperforms all $f$ -divergence based confidence penalty methods ('+LS', '+CP' and '+JSCP'), which means imposing appropriate penalty based on the semantic relationships among classes helps to learn more general semantic information. Our Wasserstein Confidence Penalty also significantly outperforms the Consistency Regularization ('+CP') [48] in unsupervised few-shot learning.
+
+We also explore the performance of Wasserstein Confidence Penalty with different scaling factor $\gamma$ , which controls the probability transportation cost between classes. We conduct experiments under the same settings as above and the results are shown in Fig. 3. We provide the results of CPN for clear comparison. As we can see, Wasserstein Confidence Penalty is robust to different $\gamma$ and can achieve consistent improvement with most candidate scaling factors.
+
+Furthermore, Guo et al. [17] points that although many modern neural networks have better performance, they are poorly calibrated and over-confident. In other words, the confidence of their predictions cannot accurately represent their accuracy, which is potentially harmful in many real-world decision making systems. To measure calibration, the authors propose the estimated Expected
+
+
+(a) Backbone: Conv4
+
+
+(b) Backbone: ResNet12
+Fig. 4. Expected Calibration Error on different backbones (Conv4 and ResNet12) and settings (5-way 1-shot/5-shot/20-shot/50-shot). We provide the results of CPN model and various confidence penalty methods: Label Smoothing $(^{+}\mathrm{LS}^{\prime})$ [41], Confidence Penalty $(^{+}\mathrm{CP}^{\prime})$ [34] and our Wasserstein Confidence Penalty $(^{+}\mathrm{WCP}^{\prime})$ .
+
+Calibration Error (ECE), and it is widely used nowadays. Some works [33, 28, 52] shows that Label Smoothing and Confidence Penalty can improve the calibration of the models in supervised learning. Here we explore whether various confidence penalty methods can improve the calibration of CPN under unsupervised setting. For fair comparison, we calculate the estimated Expected Calibration Error without temperature scaling which not only improves calibration, but also hides the trends in calibration among models [31]. The results calculated on 10,000 sampled tasks are shown in Fig. 4 and the corresponding accuracy is provided in Table 4. As we can see, the models have better calibration property as the support shot increases, which means we can use more support data to simultaneously increase accuracy and improve calibration. Various confidence penalty methods not only improve the few-shot classification accuracy, but also improve the calibration of CPN. Although Label Smoothing has the best calibration property, our Wasserstein Confidence Penalty achieves comparable calibration results and better accuracy on novel few-shot tasks.
+
+# 5 Conclusions
+
+In this work, we investigate existing unsupervised few-shot learning models and contrastive learning models and find a unified paradigm above them. To find the key design factors for unsupervised few-shot learning, we conduct empirical study and propose CPN model which combines the prototypical loss with pairwise contrast from contrastive learning. Besides, we also provide theoretical or intuitive justification for these key factors. Furthermore, when using a large batch size, CPN has the risk of learning sample-specific information. To this end, we propose Wasserstein Confidence Penalty to prevent overconfident one-hot prediction. Our full model, CPNWCP (Contrastive Prototypical Network with Wasserstein Confidence Penalty), achieves state-of-the-art performance in unsupervised few-shot learning. Besides, Wasserstein Confidence Penalty can also be used in contrastive learning to alleviate the 'sampling bias' problem and we will explore its effect in the future work.
+
+# References
+
+1. Altschuler, J., Weed, J., Rigollet, P.: Near-linear time approximation algorithms for optimal transport via sinkhorn iteration. Advances in Neural Information Processing Systems 2017, 1965-1975 (2017)
+2. Antoniou, A., Storkey, A.J.: Assume, augment and learn: Unsupervised few-shot meta-learning via random labels and data augmentation. CoRR (2019)
+3. Arora, S., Khandeparkar, H., Khodak, M., Plevrakis, O., Saunshi, N.: A theoretical analysis of contrastive unsupervised representation learning. In: 36th International Conference on Machine Learning, ICML 2019. pp. 9904-9923. International Machine Learning Society (IMLS) (2019)
+4. Bachman, P., Hjelm, R.D., Buchwalter, W.: Learning representations by maximizing mutual information across views. Advances in Neural Information Processing Systems 32, 15535-15545 (2019)
+5. Baik, S., Choi, J., Kim, H., Cho, D., Min, J., Lee, K.M.: Meta-learning with task-adaptive loss function for few-shot learning. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9465-9474 (2021)
+6. Bertinetto, L., Henriques, J.F., Torr, P.H.S., Vedaldi, A.: Meta-learning with differentiable closed-form solvers. In: 7th International Conference on Learning Representations (2019)
+7. Bogachev, V.I., Kolesnikov, A.V.: The monge-kantorovich problem: achievements, connections, and perspectives. Russian Mathematical Surveys 67(5), 785-890 (2012)
+8. Chen, J., Gan, Z., Li, X., Guo, Q., Chen, L., Gao, S., Chung, T., Xu, Y., Zeng, B., Lu, W., Li, F., Carin, L., Tao, C.: Simpler, faster, stronger: Breaking the log-k curse on contrastive learners with flatnce. CoRR abs/2107.01152 (2021)
+9. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+0. Chen, W., Liu, Y., Kira, Z., Wang, Y.F., Huang, J.: A closer look at few-shot classification. In: 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net (2019), https://openreview.net/forum?id=HkxLXnAcFQ
+1. Chen, X., He, K.: Exploring simple siamese representation learning. In: IEEE Conference on Computer Vision and Pattern Recognition, 2021. Computer Vision Foundation / IEEE (2021)
+2. Chuang, C.Y., Robinson, J., Lin, Y.C., Torralba, A., Jegelka, S.: Debiased contrastive learning. Advances in neural information processing systems 33, 8765-8775 (2020)
+3. Cuturi, M.: Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems 26, 2292-2300 (2013)
+4. Dhillon, G.S., Chaudhari, P., Ravichandran, A., Soatto, S.: A baseline for few-shot image classification. In: 8th International Conference on Learning Representations, 2020 (2020)
+5. Finn, C., Abbeel, P., Levine, S.: Model-agnostic meta-learning for fast adaptation of deep networks. In: Proceedings of the 34th International Conference on Machine Learning-Volume 70. pp. 1126-1135. JMLR.org (2017)
+6. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Pires, B., Guo, Z., Azar, M., et al.: Bootstrap your own latent: A new approach to self-supervised learning. In: Neural Information Processing Systems (2020)
+
+17. Guo, C., Pleiss, G., Sun, Y., Weinberger, K.Q.: On calibration of modern neural networks. In: International Conference on Machine Learning. pp. 1321-1330. PMLR (2017)
+18. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+19. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+20. Hjelm, R.D., Fedorov, A., Lavoie-Marchildon, S., Grewal, K., Bachman, P., Trischler, A., Bengio, Y.: Learning deep representations by mutual information estimation and maximization. In: International Conference on Learning Representations (2018)
+21. Hsu, K., Levine, S., Finn, C.: Unsupervised learning via meta-learning. In: 7th International Conference on Learning Representations (2019)
+22. Jaynes, E.T.: Information theory and statistical mechanics. Physical review 106(4), 620 (1957)
+23. Ji, Z., Zou, X., Huang, T., Wu, S.: Unsupervised few-shot feature learning via self-supervised training. Frontiers Comput. Neurosci. (2020)
+24. Jing, L., Tian, Y.: Self-supervised visual feature learning with deep neural networks: A survey. IEEE transactions on pattern analysis and machine intelligence (2020)
+25. Khodadadeh, S., Bölön, L., Shah, M.: Unsupervised meta-learning for few-shot image classification. In: Wallach, H.M., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E.B., Garnett, R. (eds.) Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems. pp. 10132-10142 (2019)
+26. Khodadadeh, S., Zehtabian, S., Vahidian, S., Wang, W., Lin, B., Boloni, L.: Unsupervised meta-learning through latent-space interpolation in generative models. In: 9th International Conference on Learning Representations (2021)
+27. Lee, K., Maji, S., Ravichandran, A., Soatto, S.: Meta-learning with differentiable convex optimization. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 10657-10665 (2019)
+28. Lienen, J., Hüllermeier, E.: From label smoothing to label relaxation. In: Proceedings of the 35th AAAI Conference on Artificial Intelligence, AAAI, Online (2021)
+29. Luo, Y., Chiu, C.C., Jaitly, N., Sutskever, I.: Learning online alignments with continuous rewards policy gradient. In: 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). pp. 2801-2805. IEEE (2017)
+30. Medina, C., Devos, A., Grossglauer, M.: Self-supervised prototypical transfer learning for few-shot classification. arXiv preprint arXiv:2006.11325 (2020)
+31. Minderer, M., Djolonga, J., Romijnders, R., Hubis, F., Zhai, X., Houlsby, N., Tran, D., Lucic, M.: Revisiting the calibration of modern neural networks. Advances in Neural Information Processing Systems 34 (2021)
+32. Mnih, V., Badia, A.P., Mirza, M., Graves, A., Lillicrap, T., Harley, T., Silver, D., Kavukcuoglu, K.: Asynchronous methods for deep reinforcement learning. In: International conference on machine learning. pp. 1928-1937. PMLR (2016)
+33. Müller, R., Kornblith, S., Hinton, G.E.: When does label smoothing help? Advances in Neural Information Processing Systems 32, 4694-4703 (2019)
+34. Pereyra, G., Tucker, G., Chorowski, J., Kaiser, L., Hinton, G.E.: Regularizing neural networks by penalizing confident output distributions. In: 5th International
+
+Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Workshop Track Proceedings (2017)
+35. Poole, B., Ozair, S., Van Den Oord, A., Alemi, A., Tucker, G.: On variational bounds of mutual information. In: International Conference on Machine Learning. pp. 5171-5180. PMLR (2019)
+36. Qin, T., Li, W., Shi, Y., Gao, Y.: Unsupervised few-shot learning via distribution shift-based augmentation. arXiv preprint arXiv:2004.05805 2 (2020)
+37. Ravi, S., Larochelle, H.: Optimization as a model for few-shot learning. In: 5th International Conference on Learning Representations (2017)
+38. Ren, M., Triantafillou, E., Ravi, S., Snell, J., Swersky, K., Tenenbaum, J.B., Larochelle, H., Zemel, R.S.: Meta-learning for semi-supervised few-shot classification. In: 6th International Conference on Learning Representations (2018)
+39. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al.: Imagenet large scale visual recognition challenge. International journal of computer vision 115(3), 211-252 (2015)
+40. Snell, J., Swersky, K., Zemel, R.: Prototypical networks for few-shot learning. In: Advances in neural information processing systems. pp. 4077-4087 (2017)
+41. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z.: Rethinking the inception architecture for computer vision. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2818-2826 (2016)
+42. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. Advances in neural information processing systems 29, 3630-3638 (2016)
+43. Wang, H., Deng, Z.H.: Few-shot learning with lssvm base learner and transductive modules. arXiv preprint arXiv:2009.05786 (2020)
+44. Wang, H., Deng, Z.H.: Cross-domain few-shot classification via adversarial task augmentation. In: Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence (2021)
+45. Wang, H., Guo, X., Deng, Z.H., Lu, Y.: Rethinking minimal sufficient representation in contrastive learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16041-16050 (2022)
+46. Wang, H., Mai, H., Deng, Z.h., Yang, C., Zhang, L., Wang, H.y.: Distributed representations of diseases based on co-occurrence relationship. Expert Systems with Applications 183, 115418 (2021)
+47. Wang, X., Zhang, R., Shen, C., Kong, T., Li, L.: Dense contrastive learning for self-supervised visual pre-training. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3024-3033 (2021)
+48. Wei, C., Wang, H., Shen, W., Yuille, A.L.: CO2: consistent contrast for unsupervised visual representation learning. In: 9th International Conference on Learning Representations (2021)
+49. Wu, Z., Xiong, Y., Yu, S.X., Lin, D.: Unsupervised feature learning via nonparametric instance discrimination. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3733-3742 (2018)
+50. Ye, H., Han, L., Zhan, D.: Revisiting unsupervised meta-learning: Amplifying or compensating for the characteristics of few-shot tasks. CoRR (2020)
+51. Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised learning via redundancy reduction. In: Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event. PMLR (2021)
+
+52. Zhang, C.B., Jiang, P.T., Hou, Q., Wei, Y., Han, Q., Li, Z., Cheng, M.M.: Delving deep into label smoothing. IEEE Transactions on Image Processing 30, 5984-5996 (2021)
+53. Zhang, C., Cai, Y., Lin, G., Shen, C.: Deepemd: Few-shot image classification with differentiable earth mover's distance and structured classifiers. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 12203-12213 (2020)
+54. Zhang, H., Koniusz, P., Jian, S., Li, H., Torr, P.H.S.: Rethinking class relations: Absolute-relative supervised and unsupervised few-shot learning. In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021 (2021)
+55. Ziko, I.M., Dolz, J., Granger, E., Ayed, I.B.: Laplacian regularized few-shot learning. In: Proceedings of the 37th International Conference on Machine Learning, 2020 (2020)
\ No newline at end of file
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/images.zip b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f63681e7d455609860630ba111c9ecb0cc642980
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dac08e5435c7758870c6e133b8bccd5dc9dac2f3c8e99a3d1ca03d00d2adb7fa
+size 508813
diff --git a/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/layout.json b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1c27e52dc5e03e527944f6858312553541ad51c8
--- /dev/null
+++ b/contrastiveprototypicalnetworkwithwassersteinconfidencepenalty/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6ba4ac9b6ccbcf0cfbc01d313bac46ab452297b268daacd3c1c5271baa4b6365
+size 484206
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_content_list.json b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e0fc86ddeb0dff7cca2bbaaaf79fe03a65b7f947
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f7fe89e839b4b7c6b8a557149d8fc04d7abc1a74242587c3fcb3d9ea506d9bd
+size 88645
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_model.json b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..331263f419d52705cc934bcbe579a5253b9cf19a
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dbba272bff61b6c4e327a62d4c8113830b84f73116fc5e04c1c91d72fa3bc7c9
+size 109730
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_origin.pdf b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..085d46094bc5d139d83d63594bc72fa3e070dc2c
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/0e2c73c9-5d65-4d7f-a6a5-07a2046e69f6_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af2cfa1e0f150cbec4003c57830d08301c7151b47b1c0c66df61bfef30f356cb
+size 3629415
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/full.md b/contrastivevicinalspaceforunsuperviseddomainadaptation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c1f0ebca4cefef3b550f06f8763196b1908c473f
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/full.md
@@ -0,0 +1,334 @@
+# Contrastive Vicinal Space for Unsupervised Domain Adaptation
+
+Jaemin Na $^{1}$ , Dongyoon Han $^{2}$ , Hyung Jin Chang $^{3}$ , and Wonjun Hwang $^{1}$
+
+$^{1}$ Ajou University, Korea $^{2}$ NAVER AI Lab $^{3}$ University of Birmingham, UK osial46@ajou.ac.kr, dongyoon.han@navercorp.com, h.j.chang@bham.ac.uk, wjhwang@ajou.ac.kr
+
+Abstract. Recent unsupervised domain adaptation methods have utilized vicinal space between the source and target domains. However, the equilibrium collapse of labels, a problem where the source labels are dominant over the target labels in the predictions of vicinal instances, has never been addressed. In this paper, we propose an instance-wise minimax strategy that minimizes the entropy of high uncertainty instances in the vicinal space to tackle the stated problem. We divide the vicinal space into two subspaces through the solution of the minimax problem: contrastive space and consensus space. In the contrastive space, inter-domain discrepancy is mitigated by constraining instances to have contrastive views and labels, and the consensus space reduces the confusion between intra-domain categories. The effectiveness of our method is demonstrated on public benchmarks, including Office-31, Office-Home, and VisDA-C, achieving state-of-the-art performances. We further show that our method outperforms the current state-of-the-art methods on PACS, which indicates that our instance-wise approach works well for multi-source domain adaptation as well. Code is available at https://github.com/NajaeMin92/CoVi.
+
+Keywords: Unsupervised Domain Adaptation, Equilibrium Collapse, Contrastive Vicinal Space
+
+# 1 Introduction
+
+Unsupervised domain adaptation (UDA) aims to adapt a model trained on a labeled source domain to an unlabeled target domain. One of the most important problems to solve in UDA is the domain shift [42] (i.e., distribution shift) problem. The domain shift arises from the change in the data distribution between the training domain (i.e., source domain) of an algorithm and the test domain encountered in a practical application (i.e., target domain). Although recent UDA studies [33,54,49] have shown encouraging results, a large domain shift is still a significant obstacle.
+
+One recent paradigm to address the large domain shift problem is to leverage intermediate domains between the source and target domains instead of direct
+
+
+Fig.1: Overview. Vicinal space between the source and target domains is divided into contrastive space and consensus space. Our methodology alleviates inter-domain discrepancy in the contrastive space and simultaneously resolves intra-domain categorical confusion in the consensus space.
+
+domain adaptation. Recent studies [15,5] inspired by generative adversarial networks [16] (GANs) generate instances of intermediate domains to bridge the source and target domains. Moreover, [10,3] learn domain-invariant representations by borrowing only the concept of adversarial training. Meanwhile, with the development of data augmentation techniques, many approaches have emerged built on data augmentation to construct the intermediate spaces. Recent studies [33,51,48] have shown promising results by grafting Mixup augmentation [55] to the domain adaptation task. These studies use inter-domain mixup to efficiently overcome the domain shift problem by utilizing vicinal instances between the source and target domains. However, none of them consider leveraging the predictions of the vicinal instances in the perspective of self-training [24].
+
+Self-training is the straightforward approach that uses self-predictions of a model to train itself. Semi-supervised learning methods [24,36] leverage a model's predictions on unlabeled data to obtain additional information used during training as their supervision. In particular, unsupervised domain adaptation methods [17,43,38] have shown that pseudo-label for the target domain can play an important role in alleviating the domain shift problem.
+
+In this work, we introduce a new Contrastive Vicinal space-based (CoVi) algorithm that leverages vicinal instances from the perspective of self-training [24]. In vicinal space, we observe that the source label is generally dominant over the target label before applying domain adaptation. In other words, even if vicinal instances consist of a higher proportion of target instances than source instances (i.e., target-dominant instances), their one-hot predictions are more likely to be source labels (i.e., source-dominant labels). We define this phenomenon as an equilibrium collapse of labels between vicinal instances. We also discover that the entropy of the predictions is maximum at the points where the equilibrium collapse of labels occurs. Hence, we aim to find and address the points where the entropy is maximized between the vicinal instances. Inspired by the minimax strategy [12], we present EMP-Mixup, which minimizes the entropy for the entropy maximization point (EMP). Our EMP-Mixup adaptively
+
+adjusts the Mixup ratio according to the combinations of source and target instances through training.
+
+As depicted in Figure 1, we further leverage the EMP as a boundary (i.e., EMP-boundary) to divide the vicinal space into source-dominant and target-dominant spaces. Here, the vicinal instances of the source-dominant space have source labels as their predicted top-1 label. Similarly, the vicinal instances of target-dominant space have target labels as their top-1 label. Taking advantage of these properties, we configure two specialized subspaces to reduce inter-domain and intra-domain discrepancy simultaneously.
+
+First, we construct a contrastive space around the EMP-boundary to ensure that the vicinal instances have contrastive views: source-dominant and target-dominant views. Since the contrastive views share the same combination of source and target instances, they should have the same top-2 labels containing the source and target labels. In addition, under our constraints, the two contrastive views have opposite order of the first and second labels in the top-2 labels. Inspired by consistency training [44,1], we propose to impose consistency on predictions of the two contrastive views. Specifically, we mitigate inter-domain discrepancy by solving a "swapped" prediction problem where we predict the top-2 labels of a contrastive view from the other contrastive view.
+
+Second, we constrain a consensus space outside of the contrastive space to alleviate the categorical confusion within the intra-domain. In this space, we generate target-dominant vicinal instances utilizing multiple source instances as a perturbation to a single target instance. Here, the role of the source instances is not to learn classification information of the source domain but to confuse the predictions of the target instances. We can ensure consistent and robust predictions for target instances by enforcing label consensus among the multiple target-dominant vicinal instances to a single target label.
+
+We perform extensive ablation studies for a detailed analysis of the proposed methods. In particular, we achieve comparable performance to the recent state-of-the-art methods in standard unsupervised domain adaptation benchmarks such as Office-31 [37], Office-Home [46], and VisDA-C [35]. Furthermore, we validate the superiority of our instance-wise approach on the PACS [26] dataset for multi-source domain adaptation. Overall, we make the following contributions:
+
+- This is the first study in UDA to leverage the vicinal space from the perspective of self-training. We shed light on the problem of the equilibrium collapse of labels in the vicinal space and propose a minimax strategy to handle it.
+- We alleviate inter-domain and intra-domain confusions simultaneously by dividing the vicinal space into contrastive and consensus spaces.
+- Our method achieves state-of-the-art performance and is further validated through extensive ablation studies.
+
+# 2 Related Work
+
+Unsupervised domain adaptation. One of the representative domain adaptation approaches [13,50] is learning a domain-invariant representation by aligning
+
+the global distribution between the source and target domains. Of particular interest, Xie et al. [50] presented a moving semantic transfer network that aligns labeled source centroids and pseudo-labeled target centroids to learn semantic representations for unlabeled target data. Following [33,6,17], we adopt this simple but efficient method as our baseline.
+
+Our work is also related to the domain adaptation approaches that consider the inter-domain and intra-domain gap together. Kang et al. [23] proposed to minimize the intra-class discrepancy and maximize the inter-class discrepancy to perform class-aware domain alignment. Pan et al. [34] presented a semantic segmentation method that minimizes both inter-domain and intra-domain gaps. Unlike these methods, we introduce a practical approach that uses two specialized spaces to reduce inter-domain and intra-domain discrepancy for each.
+
+Mixup augmentation. Mixup [55] is a data-agnostic and straightforward augmentation using a linear interpolation between two data instances. The Mixup has been applied to various tasks and shown to improve the robustness of neural networks. The recent semi-supervised learning methods [2,44,1] efficiently utilized Mixup to leverage unlabeled data. Meanwhile, several domain adaptation methods [48,51,33] with Mixup were proposed to alleviate the domain-shift problem successfully. Xu et al. [51] and Wu et al. [48] showed promising results using inter-domain Mixup between source and target domains. Recently, Na et al. [33] achieved a significant performance gain by using two networks trained with two fixed Mixup ratios. Moreover, the latest studies [18,56,31] suggested adaptive Mixup techniques instead of using manually designed interpolation policies. For example, Zhu et al. [56] introduced a more advanced interpolation technique that seeks the Wasserstein barycenter between two instances and proposed an adaptive Mixup. Mai et al. [31] introduced a meta-learning-based optimization strategy for dynamically learning the interpolation policy in semi-supervised learning. However, unsupervised domain adaptation methods still count on hand-tuned or random interpolation policies. In this work, we derive the Mixup ratio according to the convex combinations of source and target instances.
+
+Consistency training. Consistency training is one of the promising components for leveraging unlabeled data, which enforces a model to produce similar predictions of original and perturbed instances. The recent semi-supervised learning methods [44,1,2] utilize unlabeled data by assuming that the model should output similar predictions when fed perturbed versions of the same instance. Berthelot et al. [2] applied augmentations several times for each unlabeled instance and averaged them to produce guessed labels. In ReMixMatch [1], Berthelot et al. used the model's prediction for a weakly-augmented instance as the guessed label for multiple strongly-augmented variants of the same instance. Recently, Sohn et al. [44] encouraged predictions from strongly-augmented instances to match pseudo-labels generated from weakly-augmented instances. Although effective, these methods rely on augmentation techniques such as random augmentation, AutoAugment [8], RandAugment [9], and CTAugment [1]. By contrast, our method is free from these augmentation techniques and does not require carefully selected combinations of augmentations. We solely leverage
+
+
+Fig. 2: Schematic illustration of CoVi. The EMP-Mixup finds the most confusing point (i.e., EMP) among vicinal instances. CoVi then learns through top- $k$ contrastive predictions from contrastive views in the contrastive space determined by the EMP. In the consensus space, we achieve a target-label consensus with perturbations of the source instances.
+
+mixup augmentation [55] to generate the vicinal spaces and achieve the effect of consistency training.
+
+# 3 Methodology
+
+CoVi introduces three techniques to leverage the vicinal space between the source and target domains: i) EMP-Mixup, ii) contrastive views and labels, and iii) a label-consensus. An overall depiction of CoVi is in Figure 2.
+
+# 3.1 Preliminaries
+
+Notation. We denote a mini-batch of $m$ -images as $\mathcal{X}$ , corresponding labels as $\mathcal{Y}$ , and extracted features from $\mathcal{X}$ as $\mathcal{Z}$ . Specifically, $\mathcal{X}_S \subset \mathbb{R}^{m \times i}$ and $\mathcal{Y}_S \subset \{0,1\}^{m \times n}$ denote the mini-batches of source instances and their corresponding one-hot labels, respectively. Here, $n$ denotes the number of classes and $i = c \cdot h \cdot w$ , where $c$ denotes the channel size, and $h$ and $w$ denote the height and width of the image instances, respectively. Similarly, the mini-batch of unlabeled target instances is $\mathcal{X}_T \subset \mathbb{R}^{m \times i}$ . Our model consists of the following subcomponents: an encoder $f_\theta$ , a classifier $h_\theta$ , and an EMP-learner $g_\phi$ .
+
+Mixup. The Mixup augmentation [55] based on the Vicinal Risk Minimization (VRM) [7] principle exploits virtual instances constructed with the linear interpolation of two instances. These vicinal instances can benefit unsupervised domain adaptation, which has no target domain labels. We define the inter-domain Mixup applied between the source and target domains as follows:
+
+$$
+\begin{array}{l} \tilde {\mathcal {X}} _ {\lambda} = \lambda \cdot \mathcal {X} _ {S} + (1 - \lambda) \cdot \mathcal {X} _ {T} \\ \tilde {\hat {\mathcal {X}}} _ {\lambda} = \hat {\mathcal {X}} _ {S} + (1 - \hat {\mathcal {X}} _ {T}) \cdot \hat {\mathcal {X}} \end{array} \tag {1}
+$$
+
+$$
+\tilde {\mathcal {Y}} _ {\lambda} = \lambda \cdot \mathcal {Y} _ {\mathcal {S}} + (1 - \lambda) \cdot \hat {\mathcal {Y}} _ {\mathcal {T}},
+$$
+
+where $\hat{\mathcal{V}}_{\mathcal{T}}$ denotes the pseudo labels of the target instances and $\lambda \in [0,1]$ is the Mixup ratio. Then, the empirical risk for vicinal instances in the inter-domain Mixup is defined as follows:
+
+$$
+\mathcal {R} _ {\lambda} = \frac {1}{m} \sum_ {i = 1} ^ {m} \mathcal {H} [ h (f (\tilde {\mathcal {X}} _ {\lambda} ^ {(i)})), \tilde {\mathcal {Y}} _ {\lambda} ^ {(i)} ], \tag {2}
+$$
+
+where $\mathcal{H}$ is a standard cross-entropy loss.
+
+# 3.2 EMP-Mixup
+
+In the vicinal space between the source and target domains, we make interesting observations on unsupervised domain adaptation.
+
+Observation 1. "The labels of the target domain are relatively recessive to the source domain labels."
+
+We investigate the dominance of the predicted top-1 labels between the source and target instances in vicinal instances. We find that the label dominance is balanced when the labels of both the source and target domains are provided (i.e., supervised learning). In this case, the top-1 label of the vicinal instance is determined by the instance occupying a relatively larger proportion. However, in the UDA, where the label of the target domain is not given, the balance of label dominance is broken (i.e., equilibrium collapse of labels). Indeed, we discover that source labels frequently represent vicinal instances even with a higher proportion of target instances than source instances.
+
+Observation 2. "Depending on the convex combinations of source and target instances, the label dominance is changed."
+
+Next, we observe that the label dominance is altered according to the convex combinations of instances. It implies that an instance-wise approach can be a key to solving the label equilibrium collapse problem. In addition, we discover that the entropy of the prediction is maximum at the point where the label dominance changes because the source and target instances become most confusing at this point (see Figures 4 and 5).
+
+Based on these observations, we aim to capture and mitigate the most confusing points, which vary with the combination of instances. Inspired by [12,32,16], we introduce a minimax strategy to break through the worst-case risk [12] among the vicinal instances between the source and target domains. We minimize the worst risk by finding the entropy maximization point (EMP) among the vicinal instances. In order to estimate the EMPs, we introduce a small network, $EMP$ -learner. This network aims to generate Mixup ratios that maximize the entropy of the encoder $f_{\theta}$ (e.g., ResNet) followed by a classifier $h_{\theta}$ .
+
+Given $\mathcal{X}_S$ and $\mathcal{X}_{\mathcal{T}}$ , we obtain the instance features $\mathcal{Z}_S = f_\theta (\mathcal{X}_S)$ and $\mathcal{Z}_{\mathcal{T}} = f_{\theta}(\mathcal{X}_{\mathcal{T}})$ from the encoder $f_{\theta}$ . Then, we pass the concatenated features $\mathcal{Z}_S\oplus \mathcal{Z}_{\mathcal{T}}$ to the EMP-learner $g_{\phi}$ . Then, the EMP-learner produces the entropy maximization ratio $\lambda^{*}$ that maximizes the entropy of the encoder $f_{\theta}$ . Formally, the Mixup ratios for our EMP-Mixup are defined as follows:
+
+$$
+\lambda^ {*} = \underset {\lambda \in [ 0, 1 ]} {\arg \max } \mathcal {H} \left[ h _ {\theta} \left(f _ {\theta} \left(\tilde {\mathcal {X}} _ {\lambda}\right)\right) \right], \tag {3}
+$$
+
+where $\lambda = g_{\phi}(\mathcal{Z}_{\mathcal{S}}\oplus \mathcal{Z}_{\mathcal{T}})$ and $\mathcal{H}$ is the entropy loss.
+
+Finally, we design the objective function for EMP-learner to maximize the entropy as follows:
+
+$$
+\mathcal {R} _ {\lambda} (\phi) = \frac {1}{m} \sum_ {i = 1} ^ {m} \mathcal {H} [ h (f (\tilde {\mathcal {X}} _ {\lambda} ^ {(i)})) ], \tag {4}
+$$
+
+where $\mathcal{H}$ is the entropy loss. Note that we only update the parameter $\phi$ of the EMP-learner, not the parameter $\theta$ of the encoder and the classifier. With the worst-case ratio $\lambda^{*}$ , EMP-Mixup minimizes the worst-case risk on vicinal instances as follows:
+
+$$
+\mathcal {R} _ {\lambda^ {*}} (\theta) = \frac {1}{m} \sum_ {i = 1} ^ {m} \mathcal {H} \left[ h \left(f \left(\tilde {\mathcal {X}} _ {\lambda^ {*}} ^ {(i)}\right)\right), \tilde {\mathcal {Y}} _ {\lambda^ {*}} ^ {(i)} \right], \tag {5}
+$$
+
+where $\mathcal{H}$ is the standard cross-entropy loss.
+
+It is noteworthy that our $\lambda^{*} = [\lambda_{1},\dots,\lambda_{m}]$ has different optimized ratios according to the combinations of the source and target instances within a minibatch. Finally, EMP-Mixup minimizes the risk of vicinal instances from the viewpoint of the worst-case risk. The overall objective functions are defined as follows:
+
+$$
+\mathcal {R} _ {\text {e m p}} = \mathcal {R} _ {\lambda^ {*}} (\theta) - \mathcal {R} _ {\lambda} (\phi). \tag {6}
+$$
+
+# 3.3 Contrastive Views and Labels
+
+Observation 3. "The dominant/recessive labels of the vicinal instances are switched at the EMP."
+
+Looking back to the previous observations, the label dominance depends on the convex combination of instances, and the point of change is the EMP. In other words, with the EMP as a boundary (i.e., EMP-boundary), the dominant/recessive label is switched between the source and target domains. It means that vicinal instances around the EMP-boundary should have source and target labels as their top-2 labels.
+
+These observations and analyses lead us to design the concepts of contrastive views and contrastive labels. Owing to the EMP-boundary, we can divide the vicinal space into source-dominant and target-dominant space, as described in Figure 3. Specifically, we constrain the source-dominant and target-dominant spaces of the contrastive space to $\lambda^{*} - \omega < \lambda_{sd} < \lambda^{*}$ and $\lambda^{*} < \lambda_{td} < \lambda^{*} + \omega$ , respectively. Here, $\omega$ is the margin of the ratio from the EMP-boundary, which is manually designed. Consequently, the source-dominant instances $\tilde{\mathcal{X}}_{sd}$ and target-dominant instances $\tilde{\mathcal{X}}_{td}$ have contrastive views of each other.
+
+From the contrastive views, we focus on the top-2 labels for each prediction because we are only interested in the classes that correspond to the source and target instances, not the other classes. Here, we define a set of top-2 one-hot labels within a mini-batch as $\hat{y}_{[k=1]}$ and $\hat{y}_{[k=2]}$ . Unlike a general Mixup that uses pure source and target labels (see Eq.1), we directly exploit the predicted
+
+
+Fig. 3: Contrastive views and labels. (i) The contrastive views consist of a source-dominant view $\tilde{\mathcal{X}}_{sd}$ and a target-dominant view $\tilde{\mathcal{X}}_{td}$ . (ii) The contrastive labels comprise the source-dominant label and target-recessive label from the top-2 predictions in the contrastive view $\tilde{\mathcal{X}}_{sd}$ (and vice versa).
+
+labels from vicinal instances. In this case, for example, the labels for the instances of the target-dominant space are constructed as follows:
+
+$$
+\hat {\mathcal {Y}} _ {t d} = \lambda_ {t d} \cdot \hat {\mathcal {Y}} _ {t d [ k = 1 ]} + (1 - \lambda_ {t d}) \cdot \hat {\mathcal {Y}} _ {t d [ k = 2 ]}. \tag {7}
+$$
+
+Furthermore, we expand on this and propose a new concept of contrastive labels. We constrain the top-2 labels from the contrastive views as follows:
+
+- $\hat{\mathcal{Y}}_{sd[k=1]}$ from $\tilde{\mathcal{X}}_{sd}$ and $\hat{\mathcal{Y}}_{td[k=2]}$ from $\tilde{\mathcal{X}}_{td}$ must be equal, as the predictions of the source instances.
+- Similarly, $\hat{\mathcal{Y}}_{sd[k=2]}$ must be equal to $\hat{\mathcal{Y}}_{td[k=1]}$ , as for the predictions of the target instances.
+
+In other words, the dominant label $\hat{\mathcal{Y}}_{sd[k = 1]}$ of $\tilde{\mathcal{X}}_{sd}$ and the recessive label $\hat{\mathcal{Y}}_{td[k = 2]}$ of $\tilde{\mathcal{X}}_{td}$ must be the same as the source labels and vice versa. Note that our contrastive constraints are instance-level constraints that must be satisfied between any instances, regardless of the class category.
+
+Consequently, we swap the top-2 contrastive labels between two contrastive views to learn from the predictions of the other view. By solving a "swapped" prediction problem, we enforce consistency to the top-2 contrastive labels obtained from contrastive views of the same source and target instance combinations.
+
+According to the constraints, Eq.7 still holds when we swap the contrastive labels. Finally, the objective for our contrastive loss in target-dominant space is defined as follows:
+
+$$
+\mathcal {R} _ {t d} (\theta) = \frac {1}{m} \sum_ {i = 1} ^ {m} \mathcal {H} \left[ h \left(f \left(\tilde {\mathcal {X}} _ {t d} ^ {(i)}\right)\right), \hat {\mathcal {Y}} _ {t d} ^ {(i)} \right], \tag {8}
+$$
+
+where $\hat{\mathcal{V}}_{td} = \lambda_{td}\cdot \hat{\mathcal{V}}_{sd[k = 2]} + (1 - \lambda_{td})\cdot \hat{\mathcal{V}}_{sd[k = 1]}$
+
+Similarly, we define $\mathcal{R}_{sd}(\theta)$ in the source-dominant space and omit it for clarity. The overall objective functions for contrastive loss are defined as follows:
+
+$$
+\mathcal {R} _ {c t} = \mathcal {R} _ {t d} (\theta) + \mathcal {R} _ {s d} (\theta). \tag {9}
+$$
+
+# 3.4 Label Consensus
+
+Even though the confusion between the source and target instances is crucial in the contrastive space, outside of the contrastive space (i.e., consensus space), we pay more attention to the uncertainty of predictions within the intra-domain than inter-domain instances (see Figure 6). Here, we exploit multiple source instances to impose perturbations to target predictions rather than classification information for the source domain. It makes a model more robust to the target predictions by enforcing consistent predictions on the target instances even with the source perturbations.
+
+We construct two randomly shuffled versions of the source instances within a mini-batch. We then apply Mixup with a single target mini-batch to obtain two different perturbed views $v_{1}$ and $v_{2}$ . Here, we set the mixup ratio for the source instances sufficiently small since too strong perturbations can impair the target class semantics. We compute two softmax probabilities from the perturbed instances $\tilde{\mathcal{X}}_{v_1}$ and $\tilde{\mathcal{X}}_{v_2}$ using an encoder, followed by a classifier. Finally, we aggregate the softmax probabilities and yield a one-hot prediction $\hat{\mathcal{Y}}$ .
+
+We accomplish target-label consensus by assigning the label $\hat{\mathcal{V}}$ to both versions of the perturbed target-dominant instances $\tilde{\mathcal{X}}_{v_1}$ and $\tilde{\mathcal{X}}_{v_2}$ . Imposing consistency to differently perturbed instances for a single target label allows us to focus on categorical information for the target domain. The objective for label consensus on target instances can be defined as follows:
+
+$$
+\mathcal {R} _ {c s} (\theta) = \frac {1}{m} \sum_ {i = 1} ^ {m} \left[ \mathcal {H} \left(h \left(f \left(\tilde {\mathcal {X}} _ {v _ {1}} ^ {(i)}\right), \hat {\mathcal {Y}} ^ {(i)}\right)\right) + \mathcal {H} \left(h \left(f \left(\tilde {\mathcal {X}} _ {v _ {2}} ^ {(i)}\right), \hat {\mathcal {Y}} ^ {(i)}\right)\right) \right], \tag {10}
+$$
+
+where $\mathcal{H}$ is the cross-entropy loss.
+
+Note that this approach is also applicable to source-dominant space, but we exclude it from the final loss as it does not significantly affect the performance.
+
+# 4 Experiments
+
+We evaluate our method on four popular benchmarks, including Office-31, OfficeHome, VisDA-C, and PACS. Moreover, we validate our method in a multi-source domain adaptation scenario using the PACS dataset.
+
+- Office-31 [37] contains 31 categories and 4,110 images in three domains: Amazon (A), Webcam (W), and DSLR (D). We verify our methodology in six domain adaptation tasks.
+
+- Office-Home [46] consists of 64 categories and 15,500 images in four domains: Art (Ar), Clipart (Cl), Product (Pr), and Real-World (Rw).
+
+| Method | A→W | D→W | W→D | A→D | D→A | W→A | Avg. |
| MSTN* (Baseline) [50] | 91.3 | 98.9 | 100.0 | 90.4 | 72.7 | 65.6 | 86.5 |
| DWL (CVPR'21) [49] | 89.2 | 99.2 | 100.0 | 91.2 | 73.1 | 69.8 | 87.1 |
| DMRL (ECCV'20) [48] | 90.8±0.3 | 99.0±0.2 | 100.0±0.0 | 93.4±0.5 | 73.0±0.3 | 71.2±0.3 | 87.9 |
| ILA-DA (CVPR'21) [41] | 95.72 | 99.25 | 100.0 | 93.37 | 72.10 | 75.40 | 89.3 |
| MCC (ECCV'20) [22] | 95.5±0.2 | 98.6±0.1 | 100.0±0.0 | 94.4±0.3 | 72.9±0.2 | 74.9±0.3 | 89.4 |
| GSDA (CVPR'20) [21] | 95.7 | 99.1 | 100 | 94.8 | 73.5 | 74.9 | 89.7 |
| SRDC (CVPR'20) [45] | 95.7±0.2 | 99.2±0.1 | 100.0±0.0 | 95.8±0.2 | 76.7±0.3 | 77.1±0.1 | 90.8 |
| RSDA (CVPR'20) [17] | 96.1±0.2 | 99.3±0.2 | 100.0±0.0 | 95.8±0.3 | 77.4±0.8 | 78.9±0.3 | 91.1 |
| FixBi (CVPR'21) [33] | 96.1±0.2 | 99.3±0.2 | 100.0±0.0 | 95.0±0.4 | 78.7±0.5 | 79.4±0.3 | 91.4 |
| CoVi (Ours) | 97.6±0.2 | 99.3±0.1 | 100.0±0.0 | 98.0±0.3 | 77.5±0.3 | 78.4±0.3 | 91.8 |
+
+Table 1: Accuracy (\%) on Office-31 for unsupervised domain adaptation (ResNet-50). The best accuracy is indicated in bold, and the second-best accuracy is underlined. * Reproduced by [6].
+
+- VisDA-C [35] is a large-scale dataset for synthetic-to-real domain adaptation across 12 categories. It contains 152,397 synthetic images for the source domain and 55,388 real-world images for the target domain.
+
+- PACS [26] is organized into seven categories with 9,991 images in four domains: Photo (P), Art Painting (A), Cartoon (C), and Sketch (S).
+
+# 4.1 Experimental Setups
+
+Following the standard UDA protocol [14,13], we utilize labeled source data and unlabeled target data. We exploit ResNet-50 [20,19] for Office-31 and Office-Home, and ResNet-101 for VisDA-C. For multi-source domain adaptation, we use ResNet-18 in the PACS dataset. We use stochastic gradient descent (SGD) with a momentum of 0.9 in all experiments and follow the same learning rate schedule as in [13]. For the contrastive loss and label consensus loss, we follow the confidence masking policy of [33] that adaptively changes according to the sample mean and standard deviation across all mini-batches. Meanwhile, we design the EMP-learner by using four convolutional layers, regardless of the dataset. More detailed information is provided in the supplementary materials.
+
+# 4.2 Comparison with the State-of-the-Art Methods
+
+We validate our method compared with the state-of-the-art methods on three public benchmarks, including Office-31, Office-Home, and VisDA-C.
+
+Office-31. In Table 1, we show the comparative performance on ResNet-50. We achieve an accuracy of $91.8\%$ , which is $5.3\%$ higher than the baseline MSTN [50], surpassing other state-of-the-art methods. Our method performs best in four out of six situations, e.g., $\mathrm{A} \rightarrow \mathrm{W}$ , $\mathrm{D} \rightarrow \mathrm{W}$ , $\mathrm{W} \rightarrow \mathrm{D}$ , and $\mathrm{A} \rightarrow \mathrm{D}$ tasks. In particular, in $\mathrm{A} \rightarrow \mathrm{W}$ and $\mathrm{A} \rightarrow \mathrm{D}$ , although the performance improvement of the recent methods has stagnated, our method achieves a significant performance gain. We also attain better performance than the Mixup-based methods, i.e., DMRL [48] and FixBi [33].
+
+Office-Home. Table 2 demonstrates the comparison results on the Office-Home dataset based on ResNet-50. Our method achieves the highest accuracy
+
+| Method | Ar→Cl | Ar→Pr | Ar→Rw | Cl→Ar | Cl→Pr | Cl→Rw | Pr→Ar | Pr→Cl | Pr→Rw | Rw→Ar | Rw→Cl | Rw→Pr | Avg. |
| MSTN* (Baseline) [50] | 49.8 | 70.3 | 76.3 | 60.4 | 68.5 | 69.6 | 61.4 | 48.9 | 75.7 | 70.9 | 55 | 81.1 | 65.7 |
| AADA (ECCV'20) [52] | 54.0 | 71.3 | 77.5 | 60.8 | 70.8 | 71.2 | 59.1 | 51.8 | 76.9 | 71.0 | 57.4 | 81.8 | 67.0 |
| ETD (CVPR'20) [27] | 51.3 | 71.9 | 85.7 | 57.6 | 69.2 | 73.7 | 57.8 | 51.2 | 79.3 | 70.2 | 57.5 | 82.1 | 67.3 |
| GSDA (CVPR'20) [21] | 61.3 | 76.1 | 79.4 | 65.4 | 73.3 | 74.3 | 65 | 53.2 | 80 | 72.2 | 60.6 | 83.1 | 70.3 |
| GVB-GD (CVPR'20) [10] | 57 | 74.7 | 79.8 | 64.6 | 74.1 | 74.6 | 65.2 | 55.1 | 81 | 74.6 | 59.7 | 84.3 | 70.4 |
| TCM (ICCV'21) [54] | 58.6 | 74.4 | 79.6 | 64.5 | 74.0 | 75.1 | 64.6 | 56.2 | 80.9 | 74.6 | 60.7 | 84.7 | 70.7 |
| RSDA (CVPR'20) [17] | 53.2 | 77.7 | 81.3 | 66.4 | 74 | 76.5 | 67.9 | 53 | 82 | 75.8 | 57.8 | 85.4 | 70.9 |
| SRDC (CVPR'20) [45] | 52.3 | 76.3 | 81 | 69.5 | 76.2 | 78 | 68.7 | 53.8 | 81.7 | 76.3 | 57.1 | 85 | 71.3 |
| MetaAlign (CVPR'21) [47] | 59.3 | 76.0 | 80.2 | 65.7 | 74.7 | 75.1 | 65.7 | 56.5 | 81.6 | 74.1 | 61.1 | 85.2 | 71.3 |
| FixBi (CVPR'21) [33] | 58.1 | 77.3 | 80.4 | 67.7 | 79.5 | 78.1 | 65.8 | 57.9 | 81.7 | 76.4 | 62.9 | 86.7 | 72.7 |
| CoVi (Ours) | 58.5 | 78.1 | 80.0 | 68.1 | 80.0 | 77.0 | 66.4 | 60.2 | 82.1 | 76.6 | 63.6 | 86.5 | 73.1 |
+
+Table 2: Accuracy (\%) on Office-Home for unsupervised domain adaptation (ResNet-50). The best accuracy is indicated in bold, and the second-best accuracy is underlined. * Reproduced by [17].
+
+| Method | aero | bicycle | bus | car | horse | knife | motor | person | plant | skate | train | truck |
| MSTN* (Baseline) [50] | 89.3 | 49.5 | 74.3 | 67.6 | 90.1 | 16.6 | 93.6 | 70.1 | 86.5 | 40.4 | 83.2 | 18.5 |
| DMRL (ECCV'20) [48] | - | - | - | - | - | - | - | - | - | - | - | - |
| TCM (ICCV'21) [54] | - | - | - | - | - | - | - | - | - | - | - | - |
| DWL (CVPR'21) [49] | 90.7 | 80.2 | 86.1 | 67.6 | 92.4 | 81.5 | 86.8 | 78.1 | 90.6 | 57.1 | 85.6 | 28.7 |
| CGDM (ICCV'21) [11] | 93.4 | 82.7 | 73.2 | 68.4 | 92.9 | 94.5 | 88.7 | 82.1 | 93.4 | 82.5 | 86.8 | 49.2 |
| STAR (CVPR'20) [29] | 95 | 84 | 84.6 | 73 | 91.6 | 91.8 | 85.9 | 78.4 | 94.4 | 84.7 | 87 | 42.2 |
| CAN (CVPR'19) [23] | 97 | 87.2 | 82.5 | 74.3 | 97.8 | 96.2 | 90.8 | 80.7 | 96.6 | 96.3 | 87.5 | 59.9 |
| FixBi (CVPR'21) [33] | 96.1 | 87.8 | 90.5 | 90.3 | 96.8 | 95.3 | 92.8 | 88.7 | 97.2 | 94.2 | 90.9 | 25.7 |
| CoVi (Ours) | 96.8 | 85.6 | 88.9 | 88.6 | 97.8 | 93.4 | 91.9 | 87.6 | 96.0 | 93.8 | 93.6 | 48.1 |
+
+Table 3: Accuracy (\%) on VisDA-C for unsupervised domain adaptation (ResNet-101). The best accuracy is indicated in bold, and the second-best accuracy is underlined. * Reproduced by [6].
+
+in half of the tasks and is the first to break the $73\%$ barrier. In particular, we attain over $10\%$ higher performance from the baseline in $\mathrm{Cl} \rightarrow \mathrm{Pr}$ and $\mathrm{Pr} \rightarrow \mathrm{Cl}$ . In addition, our method outperforms MetaAlign [47], which uses meta-learning schemes, and FixBi [33], which operates two backbone networks (i.e., ResNet).
+
+VisDA-C. In Table 3, we validate our method on a large visual domain adaptation challenge dataset with ResNet-101. Our method outperforms the state-of-the-art methods with an accuracy of $88.5\%$ . Compared to the baseline MSTN [50], our method achieves a performance improvement of over $23\%$ . In addition, our method shows better performance than the mixup-based DMRL [48] and FixBi [33]. We could not achieve the best accuracy across all categories due to the poor accuracy of the baseline $(65.0\%)$ , yet the overall score supports the effectiveness of our method.
+
+# 4.3 Ablation Studies and Discussions
+
+Analysis of EMP. We provide visual examples of the predictions of vicinal instances using Grad-CAM [39] in Figure 4. Grad-CAM highlights class-discriminative region in an instance; hence, we can identify the most dominant label in each vicinal instance. Now we demonstrate our crucial observations based on the EMP. First, we observe that the EMP is formed differently depending on the convex combinations of the source and target instances. Second, the dominant labels are switched between the source and target labels at the
+
+
+Fig. 4: Grad-CAM visualization. Our key observations in the vicinal space are as follows: (i) EMPs vary depending on the convex combination of instances. (ii) The top-1 prediction is switched between the source and target labels (e.g., Tape dispenser $\leftrightarrow$ File cabinet) around the EMP. (iii) Grad-CAM highlights the same category as our top-1 prediction as the most class-discriminative region.
+
+EMP. Lastly, because the EMP is the highest entropy point, Grad-CAM fails to highlight one specific category at this point adequately. We claim that this outcome is due to the uncertainty arising from the confusion between the source and target instances. Furthermore, we discover that the source and target classes are highlighted in instances on both sides of the EMP.
+
+Equilibrium collapse. In Figure 5, we analyze the dominance of labels between the source and target domains. Before adaptation (i.e., source-only), the equilibrium of the labels is broken by the dominant-source and recessive-target domains. In this case, even if the proportion of the target instances in the mixed-up instance is more than half (i.e., target-dominant instance), the top-1 predicted label is determined by the source label (i.e., source-dominant label). In other words, the EMP is formed where it is biased towards the source domain. By contrast, after applying our method, we achieve equilibrium at around $50\%$ , which is similar to the results of the supervised learning method. Consequently, our method alleviates the equilibrium collapse so that the target-dominant instance is properly predicted as a target label rather than a source label.
+
+Analysis of the vicinal space. Our method leverages the vicinal spaces by dividing them into a contrastive space and a consensus space. In Figure 6, we observe that the top-5 predictions of the two spaces have different characteristics. In the contrastive space, the top-2 predictions consist of the target label (i.e., mobile phone) and source label (i.e., backpack). In other words, the uncertainty between inter-domain categories is the most critical factor in the predictions. By contrast, in the top-2 predictions of the consensus space, the second label is not the source label but another category (i.e., trash can) in the target domain that looks similar to the target label (i.e., mobile phone). Hence, mitigating the intra-domain confusion of the target domain in the consensus space can be another starting point to improve performance further.
+
+
+Fig.5: Equilibrium collapse of labels. We compare the change of entropy maximization point according to the methods. Before adaptation, the source domain is dominant over the target domain. Contrarily, applying our method equilibrates around $50\%$ , similar to supervised learning.
+
+
+Fig.6: Predictions in the contrastive space vs. consensus space. Top: The first and second predicted labels consist of source and target labels in the contrastive space. Bottom: In the consensus space, the second predicted label is not the source label but a label of another category.
+
+| Baseline | \( \mathcal{R}_{emp} \) | \( \mathcal{R}_{ct} \) | \( \mathcal{R}_{cs} \) | A→W | D→W | W→D | A→D | D→A | W→A | Avg. |
| ✓ | | | | 91.3 | 98.9 | 100.0 | 90.4 | 72.7 | 65.6 | 86.5 |
| ✓ | ✓ | | | 95.9 | 99.1 | 100.0 | 95.6 | 76.3 | 75.4 | 90.4 |
| ✓ | ✓ | ✓ | | 97.1 | 99.2 | 100.0 | 97.2 | 76.4 | 76.4 | 91.1 |
| ✓ | ✓ | ✓ | ✓ | 97.6 | 99.3 | 100.0 | 98.0 | 77.5 | 78.4 | 91.8 |
+
+Table 4: Ablation results (\%) of investigating the effects of our components on Office-31.
+
+Effect of the components. We conduct ablation studies to investigate the effectiveness for each component of our method in Table 4. We observe that our EMP-Mixup improves the accuracy by an average of $3.9\%$ compared to the baseline [50]. In addition, our contrastive loss shows a substantial improvement in the tasks $\mathrm{A} \rightarrow \mathrm{W}$ and $\mathrm{A} \rightarrow \mathrm{D}$ . Meanwhile, in the tasks of $\mathrm{D} \rightarrow \mathrm{A}$ and $\mathrm{W} \rightarrow \mathrm{A}$ , our label-consensus loss significantly impacts the performance gain. Overall, our proposed method improves the baseline by an average of $5.3\%$ . This experiment verifies that each component contributes positively to performance improvement.
+
+Multi-source domain adaptation. To demonstrate the generality of our instance-wise approach, we experiment with a multi-source domain adaptation task, as shown in Table 5. Our method achieves a performance improvement of over $6\%$ on the PACS dataset compared to the baseline MSTN [50]. In terms of the average accuracy, our method shows a significant performance improvement compared to the state-of-the-art methods. In particular, our method outperforms three out of four tasks when compared with the recent methods.
+
+Feature visualization. We visualize the embedded features on task $\mathrm{A}\rightarrow \mathrm{D}$ of the Office-31 dataset using t-SNE [30] in Figure 7. Before adaptation, the source embeddings are naturally more cohesive than that of target features because only
+
+| Method | C,S,P→A | A,S,P→C | A,C,P→S | A,C,S→P | Avg. |
| MSTN* (Baseline) [50] | 85.5 | 86.22 | 80.81 | 95.27 | 86.95 |
| JiGen (CVPR'19) [4] | 86.1 | 87.6 | 73.4 | 98.3 | 86.3 |
| Meta-MCD (ECCV'20) [25] | 87.4 | 86.18 | 78.26 | 97.13 | 87.24 |
| CMSS (ECCV'20) [53] | 88.6 | 90.4 | 82 | 96.9 | 89.5 |
| DSON (ECCV'20) [40] | 86.54 | 88.61 | 86.93 | 99.42 | 90.38 |
| T-SVDNet (ICCV'21) [28] | 90.43 | 90.61 | 85.49 | 98.5 | 91.25 |
| CoVi (Ours) | 93.11 | 93.86 | 88.06 | 99.04 | 93.52 |
+
+Table 5: Accuracy (%) on PACS for multi-source unsupervised domain adaptation (ResNet-18). The best accuracy is indicated in bold, and the second-best accuracy is underlined. * Reproduced by ourselves.
+
+
+(a) Before Adaptation
+
+
+(b) Baseline (MSTN)
+
+
+(c) CoVi (Ours)
+Fig. 7: t-SNE visualization. Visualization of embedded features on task A→D. Blue and orange points denote the source and target domains, respectively.
+
+source supervision is accessible. After applying the baseline (i.e., MSTN [50]), we observe that the cohesion of the target features is improved but still fails to form tight clusters. By contrast, in our method, the target features construct compact clusters comparable to the source features. These results prove that our method works successfully in the unsupervised domain adaptation task.
+
+# 5 Conclusions
+
+In this study, we investigated the vicinal space between the source and target domains from the perspective of self-training. We raised the problem of the equilibrium collapse of labels and proposed three novel approaches. Our EMP-Mixup efficiently minimized the worst-case risk in the vicinal space. In addition, we reduce inter-domain and intra-domain confusions by dividing the vicinal space into contrastive and consensus space. The competitiveness of our approach suggests that self-predictions in vicinal space can play an important role in solving the UDA problem.
+
+Acknowledgement. This work was partially supported by the IITP grant funded by the MSIT, Korea [2014-3-00123, 2021-0-02130] and the BK21 FOUR program (NRF-5199991014091).
+
+# References
+
+1. Berthelot, D., Carlini, N., Cubuk, E.D., Kurakin, A., Sohn, K., Zhang, H., Raffel, C.: Remixmatch: Semi-supervised learning with distribution alignment and augmentation anchoring. arXiv preprint arXiv:1911.09785 (2019) 3, 4
+2. Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., Raffel, C.: Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249 (2019) 4
+3. Bousmalis, K., Trigeorgis, G., Silberman, N., Krishnan, D., Erhan, D.: Domain separation networks. Advances in neural information processing systems 29, 343-351 (2016) 2
+4. Carlucci, F.M., D'Innocente, A., Bucci, S., Caputo, B., Tommasi, T.: Domain generalization by solving jigsaw puzzles. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2229-2238 (2019) 14
+5. Chang, W.L., Wang, H.P., Peng, W.H., Chiu, W.C.: All about structure: Adapting structural information across domains for boosting semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1900-1909 (2019) 2
+6. Chang, W.G., You, T., Seo, S., Kwak, S., Han, B.: Domain-specific batch normalization for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7354-7362 (2019) 4, 10, 11
+7. Chapelle, O., Weston, J., Bottou, L., Vapnik, V.: Vicinal risk minimization. Advances in neural information processing systems pp. 416-422 (2001) 5
+8. Cubuk, E.D., Zoph, B., Mane, D., Vasudevan, V., Le, Q.V.: Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501 (2018) 4
+9. Cubuk, E.D., Zoph, B., Shlens, J., Le, Q.V.: Randaugment: Practical automated data augmentation with a reduced search space. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 702-703 (2020) 4
+10. Cui, S., Wang, S., Zhuo, J., Su, C., Huang, Q., Tian, Q.: Gradually vanishing bridge for adversarial domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12455-12464 (2020) 2, 11
+1. Du, Z., Li, J., Su, H., Zhu, L., Lu, K.: Cross-domain gradient discrepancy minimization for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3937-3946 (2021) 11
+2. Fan, K.: Minimax theorems. Proceedings of the National Academy of Sciences of the United States of America 39(1), 42 (1953) 2, 6
+3. Ganin, Y., Lempitsky, V.: Unsupervised domain adaptation by backpropagation. In: International conference on machine learning. pp. 1180-1189. PMLR (2015) 3, 10
+4. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. The journal of machine learning research 17(1), 2096-2030 (2016) 10
+5. Gong, R., Li, W., Chen, Y., Gool, L.V.: Dlow: Domain flow for adaptation and generalization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2477-2486 (2019) 2
+6. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. Advances in neural information processing systems 27 (2014) 2, 6
+
+17. Gu, X., Sun, J., Xu, Z.: Spherical space domain adaptation with robust pseudolabel loss. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9101-9110 (2020) 2, 4, 10, 11
+18. Guo, H., Mao, Y., Zhang, R.: Mixup as locally linear out-of-manifold regularization. In: Proceedings of the AAAI Conference on Artificial Intelligence. pp. 3714-3722 (2019) 4
+19. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016) 10
+20. He, K., Zhang, X., Ren, S., Sun, J.: Identity mappings in deep residual networks. In: European conference on computer vision. pp. 630-645. Springer (2016) 10
+21. Hu, L., Kan, M., Shan, S., Chen, X.: Unsupervised domain adaptation with hierarchical gradient synchronization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4043-4052 (2020) 10, 11
+22. Jin, Y., Wang, X., Long, M., Wang, J.: Minimum class confusion for versatile domain adaptation. In: European Conference on Computer Vision. pp. 464-480. Springer (2020) 10
+23. Kang, G., Jiang, L., Yang, Y., Hauptmann, A.G.: Contrastive adaptation network for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4893-4902 (2019) 4, 11
+24. Lee, D.H., et al.: Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In: Workshop on challenges in representation learning, ICML. p. 896 (2013) 2
+25. Li, D., Hospedales, T.: Online meta-learning for multi-source and semi-supervised domain adaptation. In: European Conference on Computer Vision. pp. 382-403. Springer (2020) 14
+26. Li, D., Yang, Y., Song, Y.Z., Hospedales, T.M.: Deeper, broader and artier domain generalization. In: Proceedings of the IEEE international conference on computer vision. pp. 5542-5550 (2017) 3, 10
+27. Li, M., Zhai, Y.M., Luo, Y.W., Ge, P.F., Ren, C.X.: Enhanced transport distance for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13936-13944 (2020) 11
+28. Li, R., Jia, X., He, J., Chen, S., Hu, Q.: T-svdnet: Exploring high-order prototypical correlations for multi-source domain adaptation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9991-10000 (2021) 14
+29. Lu, Z., Yang, Y., Zhu, X., Liu, C., Song, Y.Z., Xiang, T.: Stochastic classifiers for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9111-9120 (2020) 11
+30. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008) 13
+31. Mai, Z., Hu, G., Chen, D., Shen, F., Shen, H.T.: Metamixup: Learning adaptive interpolation policy of mixup with metalearning. IEEE Transactions on Neural Networks and Learning Systems (2021) 4
+32. Miyato, T., Maeda, S.i., Koyama, M., Ishii, S.: Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence 41(8), 1979-1993 (2018) 6
+33. Na, J., Jung, H., Chang, H.J., Hwang, W.: Fixbi: Bridging domain spaces for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1094-1103 (2021) 1, 2, 4, 10, 11
+
+34. Pan, F., Shin, I., Rameau, F., Lee, S., Kweon, I.S.: Unsupervised intra-domain adaptation for semantic segmentation through self-supervision. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3764-3773 (2020) 4
+35. Peng, X., Usman, B., Kaushik, N., Hoffman, J., Wang, D., Saenko, K.: Visda: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924 (2017) 3, 10
+36. Pham, H., Dai, Z., Xie, Q., Le, Q.V.: Meta pseudo labels. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11557-11568 (2021) 2
+37. Saenko, K., Kulis, B., Fritz, M., Darrell, T.: Adapting visual category models to new domains. In: European conference on computer vision. pp. 213-226. Springer (2010) 3, 9
+38. Saito, K., Ushiku, Y., Harada, T.: Asymmetric tri-training for unsupervised domain adaptation. In: International Conference on Machine Learning. pp. 2988-2997. PMLR (2017) 2
+39. Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Gradcam: Visual explanations from deep networks via gradient-based localization. In: Proceedings of the IEEE international conference on computer vision. pp. 618-626 (2017) 11
+40. Seo, S., Suh, Y., Kim, D., Kim, G., Han, J., Han, B.: Learning to optimize domain specific normalization for domain generalization. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXII 16. pp. 68-83. Springer (2020) 14
+41. Sharma, A., Kalluri, T., Chandraker, M.: Instance level affinity-based transfer for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5361-5371 (2021) 10
+42. Shimodaira, H.: Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference 90(2), 227-244 (2000) 1
+43. Shin, I., Woo, S., Pan, F., Kweon, I.S.: Two-phase pseudo label densification for self-training based domain adaptation. In: European conference on computer vision. pp. 532-548. Springer (2020) 2
+44. Sohn, K., Berthelot, D., Li, C.L., Zhang, Z., Carlini, N., Cubuk, E.D., Kurakin, A., Zhang, H., Raffel, C.: Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685 (2020) 3, 4
+45. Tang, H., Chen, K., Jia, K.: Unsupervised domain adaptation via structurally regularized deep clustering. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 8725-8735 (2020) 10, 11
+46. Venkateswara, H., Eusebio, J., Chakraborty, S., Panchanathan, S.: Deep hashing network for unsupervised domain adaptation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 5018-5027 (2017) 3, 9
+47. Wei, G., Lan, C., Zeng, W., Chen, Z.: Metaalign: Coordinating domain alignment and classification for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16643-16653 (2021) 11
+48. Wu, Y., Inkpen, D., El-Roby, A.: Dual mixup regularized learning for adversarial domain adaptation. In: European Conference on Computer Vision. pp. 540-555. Springer (2020) 2, 4, 10, 11
+49. Xiao, N., Zhang, L.: Dynamic weighted learning for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15242-15251 (2021) 1, 10, 11
+
+50. Xie, S., Zheng, Z., Chen, L., Chen, C.: Learning semantic representations for unsupervised domain adaptation. In: International conference on machine learning. pp. 5423-5432. PMLR (2018) 3, 4, 10, 11, 13, 14
+51. Xu, M., Zhang, J., Ni, B., Li, T., Wang, C., Tian, Q., Zhang, W.: Adversarial domain adaptation with domain mixup. In: Proceedings of the AAAI Conference on Artificial Intelligence. pp. 6502-6509 (2020) 2, 4
+52. Yang, J., Zou, H., Zhou, Y., Zeng, Z., Xie, L.: Mind the discriminability: Asymmetric adversarial domain adaptation. In: European Conference on Computer Vision. pp. 589-606. Springer (2020) 11
+53. Yang, L., Balaji, Y., Lim, S.N., Shrivastava, A.: Curriculum manager for source selection in multi-source domain adaptation. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIV 16. pp. 608-624. Springer (2020) 14
+54. Yue, Z., Sun, Q., Hua, X.S., Zhang, H.: Transporting causal mechanisms for unsupervised domain adaptation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 8599-8608 (2021) 1, 11
+55. Zhang, H., Cisse, M., Dauphin, Y.N., Lopez-Paz, D.: mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412 (2017) 2, 4, 5
+56. Zhu, J., Shi, L., Yan, J., Zha, H.: Automix: Mixup networks for sample interpolation via cooperative barycenter learning. In: European Conference on Computer Vision. pp. 633-649. Springer (2020) 4
\ No newline at end of file
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/images.zip b/contrastivevicinalspaceforunsuperviseddomainadaptation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4e6a345a43eea2f362aa92aaeec7138579189060
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b4ccfc835a8439d885c3f92232c3b8386d687c3518ef292e10234ac1cb4eb235
+size 548983
diff --git a/contrastivevicinalspaceforunsuperviseddomainadaptation/layout.json b/contrastivevicinalspaceforunsuperviseddomainadaptation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ad0b65af59abee2d43ddce3115e4dc1a0197764a
--- /dev/null
+++ b/contrastivevicinalspaceforunsuperviseddomainadaptation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:915ee496113970b3b4080dcfb67f1d82007a91a00284213ad99e28992c903f3e
+size 437741
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_content_list.json b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1f7266e62407bd9644c049795d5b732013d7678f
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:95a311b9f4f6ad6061231d2914e28dfbd6f14e159748a58b0a3f1dabef7238a6
+size 79692
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_model.json b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..c7e6a1078e9fca9642978f1376aa263dddc24f97
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:974afd3525a6f2cdcc1d1c0168dfd61ea121eb4247b4fc1b0ffe4a917ce2c565
+size 99436
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_origin.pdf b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3aa9ba6f6f01201da5e6aecb4d6901d1944fd732
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/e0c77b68-d1ae-4825-b938-d382be719b21_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b1fcfef5afe933cb0bbc0651bbeb59bdc0167085573be0534175a4a570cf8149
+size 1013437
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/full.md b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..bf44610e4b39c697fb5f26d072f14a5ecad52340
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/full.md
@@ -0,0 +1,274 @@
+# Contrast-Phys: Unsupervised Video-based Remote Physiological Measurement via Spatiotemporal Contrast
+
+Zhaodong Sun and Xiaobai Li
+
+Center for Machine Vision and Signal Analysis, University of Oulu, Oulu, Finland {zhaodong.sun, xiaobai.li}@oulu.fi
+
+Abstract. Video-based remote physiological measurement utilizes face videos to measure the blood volume change signal, which is also called remote photoplethysmography (rPPG). Supervised methods for rPPG measurements achieve state-of-the-art performance. However, supervised rPPG methods require face videos and ground truth physiological signals for model training. In this paper, we propose an unsupervised rPPG measurement method that does not require ground truth signals for training. We use a 3DCNN model to generate multiple rPPG signals from each video in different spatiotemporal locations and train the model with a contrastive loss where rPPG signals from the same video are pulled together while those from different videos are pushed away. We test on five public datasets, including RGB videos and NIR videos. The results show that our method outperforms the previous unsupervised baseline and achieves accuracies very close to the current best supervised rPPG methods on all five datasets. Furthermore, we also demonstrate that our approach can run at a much faster speed and is more robust to noises than the previous unsupervised baseline. Our code is available at https://github.com/zhaodongsun/contrast-phys.
+
+Keywords: Remote Photoplethysmography, Face Video, Unsupervised Learning, Contrastive Learning
+
+# 1 Introduction
+
+Traditional physiological measurement requires skin-contact sensors to measure physiological signals such as contact photoplethysmography (PPG) and electrocardiography (ECG). Some physiological parameters like heart rate (HR), respiration frequency (RF), and heart rate variability (HRV) can be derived from PPG signals for healthcare [42,55] and emotion analysis [57,29,40]. However, the skin-contact physiological measurement requires specific biomedical equipment like pulse oximeters, and contact sensors may cause discomfort and skin irritation. Remote physiological measurement uses a camera to record face videos for measuring remote photoplethysmography (rPPG). The weak color change in faces can be captured by cameras to obtain the rPPG signal from which several
+
+physiological parameters such as HR, RF, and HRV [38] can be measured. Video-based physiological measurement only requires off-the-shelf cameras rather than professional biomedical sensors, and is not constrained by physical distance, which has a great potential for remote healthcare [42,55] and emotion analysis applications [57,29,40].
+
+In earlier rPPG studies [49,38,8,52], researchers proposed handcrafted features to extract rPPG signals. Later, some deep learning (DL)-based methods [7,45,56,58,18,23,32,33,25,35] were proposed, which employed supervised approaches with various network architectures for measuring rPPG signals. On one side, under certain circumstances, e.g., when head motions are involved or the videos are heterogeneous, DL-based methods could be more robust than the traditional handcrafted approaches. On the other side, DL-based rPPG methods require a large-scale dataset including face videos and ground truth physiological signals. Although face videos are comparatively easy to obtain in large amount, it is expensive to get the ground truth physiological signals which are measured by contact sensors, and synchronized with the face videos.
+
+Can we only use face videos without ground truth physiological signals to train models for rPPG measurement? Gideon and Stent [10] proposed a self-supervised method to train rPPG measurement models without labels. They first downsample a video to get the downsampled rPPG (negative sample) and upsample the downsampled rPPG to get the reconstructed rPPG (positive sample). They also used the original video to get the anchor rPPG. Then a triplet loss is used to pull together the positive and anchor samples, and push away negative and anchor samples. However, their method has three problems. 1) They have to forward one video into their backbone model twice, which causes an extra computation burden. 2) There is still a significant gap between the performance of their unsupervised method and the state-of-the-art supervised rPPG methods [45,56,34]. 3) They showed in their paper [10] that their method is easily impacted by external periodic noise.
+
+We propose a new unsupervised method (Contrast-Phys) to tackle the problems above. Our method was built on four observations about rPPG. 1) rPPG spatial similarity: rPPG signals measured from different facial areas have similar power spectrum densities (PSDs) 2) rPPG temporal similarity: In a short time, two rPPG signals (e.g., two consecutive 5s clips) usually present similar PSDs as the HR tends to take smooth transits in most cases. 3) Cross-video rPPG dissimilarity: The PSDs of rPPG signals from different videos are different. 4) HR range constraint: The HR should fall between 40 and 250 beats per minute (bpm), so we only care about the PSD in the frequency interval between $0.66\mathrm{Hz}$ and $4.16\mathrm{Hz}$ .
+
+We propose to use a 3D convolutional neural network (3DCNN) to process an input video to get a spatiotemporal rPPG (ST-rPPG) block. The ST-rPPG block contains multiple rPPG signals along three dimensions of height, width, and time. According to the rPPG spatiotemporal similarity, we can randomly sample rPPG signals from the same video in different spatiotemporal locations and pull them together. According to the cross-video rPPG dissimilarity, the sampled
+
+rPPG signals from different videos are pushed away. The whole procedures are shown in Fig. 4 and Fig. 5.
+
+The contributions of this work are 1) We propose a novel rPPG representation called spatiotemporal rPPG (ST-rPPG) block to obtain rPPG signals in spatiotemporal dimensions. 2) Based on four observations about rPPG, including rPPG spatiotemporal similarity and cross-video rPPG dissimilarity, we propose an unsupervised method based on contrastive learning. 3) We conduct experiments on five rPPG datasets (PURE [46], UBFC-rPPG [4], OBF [19], MR-NIRP [26], and MMSE-HR [59]) including RGB and NIR videos under various scenarios. Our method outperforms the previous unsupervised baseline [10] and achieves very close performance to supervised rPPG methods. Contrast-Phys also shows significant advantages with fast running speed and noise robustness compared to the previous unsupervised baseline.
+
+# 2 Related Work
+
+Video-Based Remote Physiological Measurement. Verkruysse et al. [49] first proposed that rPPG can be measured from face videos from the green channel. Several traditional handcraft methods [38,8,9,52,17,48,53] were proposed to further improve rPPG signal quality. Most rPPG methods proposed in earlier years used handcrafted procedures and did not need datasets for training, which are referred to as traditional methods. Deep learning (DL) methods for rPPG measurement are rapidly emerging. Several studies [7,45,23,35] used a 2D convolutional neural network (2DCNN) with two consecutive video frames as the input for rPPG measurement. Another type of DL-based methods [32,33,25] used a spatial-temporal signal map extracted from different facial areas as the input to feed into a 2DCNN model. Recently, 3DCNN-based methods [58,56,10] were proposed to achieved good performance on compressed videos [58]. The DL-based methods require both face videos and ground truth physiological signals, so we refer to them as supervised methods. Recently, Gideon and Stent [10] proposed an unsupervised method to train a DL model without ground truth physiological signals. However, their method falls behind some supervised methods and is not robust to external noise. In addition, the running speed is not satisfactory.
+
+Contrastive Learning. Contrastive learning is a self-supervised learning method widely used in video and image feature embedding, which facilitates downstream task training and small dataset fine-tuning [12,41,36,6,47,13,11,30,39]. A DL model working as a feature extractor maps a high-dimensional image/video into a low dimensional feature vector. To train this DL feature extractor, features from different views of the same sample (positive pairs) are pulled together, while features from views of different samples (negative pairs) are pushed away. Data augmentations (such as cropping, blurring [6], and temporal sampling [39]) are used to obtain different views of the same sample so that the learned features are invariant to some augmentations. Previous works mentioned above use
+
+contrastive learning to let a DL model produce abstract features for downstream tasks such as image classification [6], video classification [39], face recognition [41]. On the other hand, our work uses contrastive learning to directly let a DL model produce rPPG signals, enabling unsupervised learning without ground truth physiological signals.
+
+# 3 Observations about rPPG
+
+This section describes four observations about rPPG, which are the precondition to design our method and enable unsupervised learning.
+
+rPPG Spatial Similarity. rPPG signals from different facial areas have similar waveforms, and their PSDs are also similar. Several works [17,48,16,53,51,22,21] also exploited rPPG spatial similarity to design their methods. There might be small phase and amplitude differences between two rPPG signals from two different body skin areas [14,15]. However, when rPPG waveforms are transformed to PSDs, the phase information is erased, and the amplitude can be normalized to cancel the amplitude difference. In Fig. 1, the rPPG waveforms from four spatial areas are similar, and they have the same peaks in PSDs.
+
+
+Fig. 1: Illustration of rPPG spatial similarity. The rPPG signals from four facial areas (A, B, C, D) have similar waveforms and power spectrum densities (PSDs)
+
+rPPG Temporal Similarity. The HR does not change rapidly in a short term [10]. Stricker et al. [46] also found that the HR varies slightly in a short time interval in their dataset. Since the HR has a dominant peak in PSD, the PSD does not change rapidly, either. If we randomly sample several small windows from a short rPPG clip (e.g., 10s), the PSDs of these windows should be similar. In Fig. 2, we sample two 5s windows from a short 10s rPPG signal and get the PSDs of these two windows. The two PSDs are similar and have sharp peaks at the same frequency. Since this observation is only valid under the condition of short-term rPPG signals, in the following sensitivity analysis part, we will discuss the influence of the signal length on our model performance. Overall, we can use the equation $\mathrm{PSD}\big\{G\big(v(t_1\to t_1 + \Delta t,\mathcal{H}_1,\mathcal{W}_1)\big)\big\} \approx \mathrm{PSD}\big\{G\big(v(t_2\to$
+
+$\left. t_{2} + \Delta t, \mathcal{H}_{2}, \mathcal{W}_{2}\right)\right\}$ to describe spatiotemporal rPPG similarity. $v \in \mathbb{R}^{T \times H \times W \times 3}$ is a facial video, $G$ is an rPPG measurement algorithm. We can choose one facial area with a set of height $\mathcal{H}_{1}$ and width $\mathcal{W}_{1}$ , and a time interval $t_{1} \to t_{1} + \Delta t$ from video $v$ to achieve one rPPG signal. We can achieve another rPPG signal similarly from the same video with $\mathcal{H}_{2}$ , $\mathcal{W}_{2}$ , and $t_{2} \to t_{2} + \Delta t$ . $|t_{1} - t_{2}|$ should be small to satisfy the condition of short-term rPPG signals.
+
+
+Fig. 2: Illustration of rPPG temporal similarity. The rPPG signals from two temporal windows (A, B) have similar PSDs
+
+
+
+
+
+# Cross-video rPPG Dissimilarity.
+
+We assume rPPG signals from different face videos have different PSDs. Each video is recorded with different people and different physiological states (such as exercises and emotion status), so the HRs across different videos are likely different [1]. Even though the HRs might be similar between two videos, the PSDs might still be different since PSD also contains other physiological factors such as respiration rate [5] and HRV [37] which
+
+are unlikely to be all the same between two videos. To further validate the observation, we calculate the mean squared error for all cross-video PSD pairs in the OBF dataset [19] and show the most similar and most different cross-video PSD pairs in Fig. 3. It can be observed that the main cross-video PSD difference is the heart rate peak. The following equation describes cross-video rPPG dissimilarity. PSD $\{G(v(t_1 \to t_1 + \Delta t, \mathcal{H}_1, \mathcal{W}_1))\} \neq \mathrm{PSD}\{G(v'(t_2 \to t_2 + \Delta t, \mathcal{H}_2, \mathcal{W}_2))\}$ where $v$ and $v'$ are two different videos. We can choose facial areas and time intervals from these two videos. The PSDs of the two rPPG signals should be different.
+
+HR Range Constraint. The HR range for most people is between 40 and 250 bpm [2]. Most works [38,20] use this HR range for rPPG signal filtering and find
+
+
+Fig.3: The most similar (left) and most different (right) cross-video PSD pairs in the OBF dataset.
+
+
+
+the highest peak to estimate the HR. Therefore, our method will focus on PSD between $0.66\mathrm{Hz}$ and $4.16\mathrm{Hz}$ .
+
+# 4 Method
+
+The overview of Contrast-Phys is shown in Fig. 4 and Fig. 5. We describe the procedures of Contrast-Phys in this section.
+
+
+Fig. 4: Contrast-Phys Diagram. A pair of videos are fed into the same 3DCNN to generate a pair of ST-rPPG blocks. Multiple rPPG samples are sampled from the ST-rPPG blocks (The spatiotemporal sampler is illustrated in Fig. 5) and converted to PSDs. The PSDs from the same video are attracted while the PSDs from different videos are repelled.
+
+# 4.1 Preprocessing
+
+The original videos are firstly preprocessed to crop the face to get the face video shown in Fig. 4 left. Facial landmarks are generated using OpenFace [3]. We first get the minimum and maximum horizontal and vertical coordinates of the landmarks to locate the central facial point for each frame. The bounding box size is 1.2 times the vertical coordinate range of landmarks from the first frame and is fixed for the following frames. After getting the central facial point of each frame and the size of the bounding box, we crop the face from each frame. The cropped faces are resized to $128 \times 128$ , which are ready to be fed into our model.
+
+# 4.2 Spatiotemporal rPPG (ST-rPPG) Block Representation
+
+We modify 3DCNN-based PhysNet [56] to get the ST-rPPG block representation. The modified model has an input RGB video with the shape of $T \times 128 \times$
+
+$128 \times 3$ where $T$ is the number of frames. In the last stage of our model, we use adaptive average pooling to downsample along spatial dimensions, which can control the output spatial dimension length. This modification allows our model to output a spatiotemporal rPPG block with the shape of $T \times S \times S$ where $S$ is spatial dimension length as shown in Fig. 5. More details about the 3DCNN model are described in the supplementary material.
+
+The ST-rPPG block is a collection of rPPG signals in spatiotemporal dimensions. We use $P \in \mathbb{R}^{T \times S \times S}$ to denote the ST-rPPG block. Suppose we choose a spatial location $(h, w)$ in the ST-rPPG block. In that case, the corresponding rPPG signal in this position is $P(\cdot, h, w)$ which is extracted from the receptive field of this spatial position in the original video. We can deduce that when the spatial dimension length $S$ is small, each spatial position in the ST-rPPG block has a larger receptive field. The receptive field of each spatial position in the ST-rPPG block can cover part of the facial region, which means all spatial positions in the ST-rPPG block can include rPPG information.
+
+# 4.3 rPPG Spatiotemporal Sampling
+
+
+Fig. 5: Spatiotemporal Sampler
+
+Several rPPG signals are sampled from the ST-rPPG block as illustrated in Fig. 5. For spatial sampling, we can get the rPPG signal $P(\cdot ,h,w)$ at one spatial position. For temporal sampling, we can sample a short time interval from $P(\cdot ,h,w)$ , and the final spatiotemporal sample is $P(t\rightarrow t + \Delta t,h,w)$ where $h$ and $w$ are the spatial position, $t$ is the starting time, and $\Delta t$ is the time interval length. For one ST-rPPG block, we will loop over all spatial positions and sample $K$ rPPG clips with a randomly chosen starting time $t$ for each spatial position. Therefore, we can get $S\cdot S\cdot K$ rPPG clips from the ST-rPPG block. The more detailed sampling procedures are in our supplementary material. The sampling
+
+procedures above are used during model training. After our model is trained and used for testing, we can directly average ST-rPPG over spatial dimensions to get the rPPG signal.
+
+# 4.4 Contrastive Loss Function
+
+As illustrated in Fig. 4, we have two different videos randomly chosen from a dataset as the input. For one video, we can get one ST-rPPG block $P$ , a set of rPPG samples $[p_1, \ldots, p_N]$ and the corresponding PSDs $[f_1, \ldots, f_N]$ . For another video, we can get one ST-rPPG block $P'$ , one set of rPPG samples $[p_1', \ldots, p_N']$ and the corresponding PSDs $[f_1', \ldots, f_N']$ in the same way. As shown in Fig. 4 right, the principle of our contrastive loss is to pull together PSDs from the same video and push away PSDs from different videos. It is noted that we only use the PSD between $0.66\mathrm{Hz}$ and $4.16\mathrm{Hz}$ according to the HR range constraint in Sec. 3.
+
+Positive Loss Term. According to rPPG spatiotemporal similarity, we can conclude that the PSDs from the spatiotemporal sampling of the same ST-rPPG block should be similar. We can use the following equations to describe this property for the two input videos. For one video, $\mathrm{PSD}\big\{P(t_1\to t_1 + \Delta t,h_1,w_1)\big\} \approx$ $\mathrm{PSD}\big\{P(t_2\to t_2 + \Delta t,h_2,w_2)\big\} \Rightarrow f_i\approx f_j,i\neq j.$ For another video, $\mathrm{PSD}\big\{P'(t_1\to t_1 + \Delta t,h_1,w_1)\big\} \approx \mathrm{PSD}\big\{P'(t_2\to t_2 + \Delta t,h_2,w_2)\big\} \Rightarrow f_i'\approx$ $f_{j}^{\prime},i\neq j.$
+
+We can use the mean squared error as the loss function to pull together PSDs (positive pairs) from the same video. The positive loss term $L_{p}$ is shown below, which is normalized with the total number of positive pairs.
+
+$$
+L _ {p} = \sum_ {i = 1} ^ {N} \sum_ {\substack {j = 1 \\ j \neq i}} ^ {N} \left(\| f _ {i} - f _ {j} \| ^ {2} + \| f _ {i} ^ {\prime} - f _ {j} ^ {\prime} \| ^ {2}\right) / \left(2 N (N - 1)\right) \tag{1}
+$$
+
+Negative Loss Term. According to the cross-video rPPG dissimilarity, we can conclude that the PSDs from the spatiotemporal sampling of the two different ST-rPPG blocks should be different. We can use the following equation to describe this property for the two input videos. PSD $\{P(t_1 \to t_1 + \Delta t, h_1, w_1)\} \neq$ PSD $\{P'(t_2 \to t_2 + \Delta t, h_2, w_2)\} \Rightarrow f_i \neq f_j'$
+
+We use the negative mean squared error as the loss function to push away PSDs (negative pairs) from two different videos. The negative loss term $L_{n}$ is shown below, which is normalized with the total number of negative pairs.
+
+$$
+L _ {n} = - \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {N} \| f _ {i} - f _ {j} ^ {\prime} \| ^ {2} / N ^ {2} \tag {2}
+$$
+
+The overall loss function is $L = L_{p} + L_{n}$ , which is the sum of the positive and negative loss terms.
+
+Why Our Method Works. Our four rPPG observations are constraints to make the model learn to keep rPPG and exclude noises since noises do not satisfy the observations. Noises that appear in a small local region such as periodical eye blinking are excluded since the noises violate rPPG spatial similarity. Noises such as head motions/facial expressions that do not have a temporal constant frequency are excluded since they violate rPPG temporal similarity. Noises such as light flickering that exceed the heart rate range are also excluded due to the heart rate range constraint. Cross-video dissimilarity in the loss can make two videos' PSDs discriminative and show clear heart rate peaks since heart rate peaks are one of the discriminative clues between two videos' PSDs.
+
+# 5 Experiments
+
+# 5.1 Experimental Setup and Metrics
+
+Datasets. We test five commonly used rPPG datasets covering RGB and NIR videos recorded under various scenarios. PURE [46], UBFC-rPPG [4], OBF [19] and MR-NIRP [26] are used for the intra-dataset testing. MMSE-HR [59] is used for cross-dataset testing. PURE has ten subjects' face videos recorded in six different setups, including steady and motion tasks. We use the same experimental protocol as in [45,25] to divide the training and test set. UBFC-rPPG includes facial videos from 42 subjects who were playing a mathematical game to increase their HRs. We use the same protocol as in [25] for the train-test split and evaluation. OBF has 100 healthy subjects' videos recorded before and after exercises. We use subject-independent ten-fold cross-validation as used in [56,58,33] to make fair comparison with previous results. MR-NIRP has NIR videos from eight subjects sitting still or doing motion tasks. The dataset is challenging due to its small scale, and weak rPPG signals in NIR [28,50]. We will use a leave-one-subject-out cross-validation protocol for our experiments. MMSE-HR has 102 videos from 40 subjects recorded in emotion elicitation experiments. This dataset is also challenging since spontaneous facial expressions, and head motions are involved. More details about these datasets can be found in the supplementary material.
+
+Experimental Setup. This part shows our experimental setup during training and testing. For the spatiotemporal sampler, we evaluate different spatial resolutions and time lengths of ST-rPPG blocks in the sensitivity analysis part. According to the results, we fix the parameters in the other experiments as follows. We set $K = 4$ , which means, for each spatial position in the ST-rPPG block, four rPPG samples are randomly chosen. We set the spatial resolution of the ST-rPPG block as $2 \times 2$ , and the time length of the ST-rPPG block as 10s. The time interval $\Delta t$ of each rPPG sample is half of the time length of the ST-rPPG block. We use AdamW optimizer [24] to train our model with a learning rate of $10^{-5}$ for 30 epochs on one NVIDIA Tesla V100 GPU. For each
+
+training iteration, the inputs are two 10s clips from two different videos, respectively. During testing, we broke each test video into non-overlapping 30s clips and computed rPPG for each clip. We locate the highest peak in the PSD of an rPPG signal to calculate the HR. We use Neurokit2 [27] to calculate HRV metrics for the reported HRV results.
+
+Evaluation Metrics. Following previous work [20,33,58], we use mean absolute error (MAE), root mean squared error (RMSE), and Pearson correlation coefficient (R) to evaluate the accuracy of HR measurement. Following [25], we also use standard deviation (STD), RMSE, and R to evaluate the accuracy of HRV features, including respiration frequency (RF), low-frequency power (LF) in normalized units (n.u.), high-frequency power (HF) in normalized units (n.u.), and the ratio of LF and HF power (LF/HF). For MAE, RMSE, and STD, smaller values mean lower errors, while for R, larger values close to one mean lower errors. Please check our supplementary material for more details about evaluation metrics.
+
+# 5.2 Intra-dataset Testing
+
+HR Estimation. We perform intra-dataset testing for HR estimation on PURE [46], UBFCrPPG [4], OBF [19], and MR-NIRP [26]. Table 1 shows HR estimation results, including traditional methods, supervised methods, and unsupervised methods. The proposed Contrast-Phys largely surpasses the previous unsupervised baseline [10] and almost approaches the best supervised methods. The superior performance of Contrast-Phys is consistent on all four datasets, including the MR-NIRP [26] dataset, which contains NIR videos. The results indicate that the unsupervised Contrast-Phys can achieve reliable HR estimation on both RGB and NIR videos without requiring any ground truth physiological signals for training. Fig. 6 also shows that the rPPG way method is very similar to the ground truth PPGs
+
+
+Fig.6: rPPG waveform and ground truth PPG signal.
+
+HRV Estimation. We also perform intra-dataset testing for HRV on UBFC-rPPG [4] as shown in Table 2. HRV results need to locate each systolic peak, which requires high-quality rPPG signals. Our method significantly outperforms traditional methods and the previous unsupervised baseline [10] on HRV results. There is a marginal difference in HRV results between ours and the supervised methods [33,25]. The results indicate that Contrast-Phys can achieve high-quality rPPG signals with accurate systolic peaks to calculate HRV features, which makes it feasible to be used for emotion understanding [57,29,40] and healthcare applications [42,55].
+
+Table 1: Intra-dataset HR results. The best results are in bold, and the second-best results are underlined.
+
+| Method Types | Methods | UBFC-rPPG | PURE | OBF | MR-NIRP (NIR) |
| MAE (bpm) | RMSE (bpm) | R | MAE (bpm) | RMSE (bpm) | R | MAE (bpm) | RMSE (bpm) | R | MAE (bpm) | RMSE (bpm) | R |
| Traditional | GREEN [49] | 7.50 | 14.41 | 0.62 | - | - | - | - | 2.162 | 0.99 | - | - | - |
| ICA [38] | 5.17 | 11.76 | 0.65 | - | - | - | - | - | - | - | - | - |
| CHROM [8] | 2.37 | 4.91 | 0.89 | 2.07 | 9.92 | 0.99 | - | 2.733 | 0.98 | - | - | - |
| 2SR [54] | - | - | - | 2.44 | 3.06 | 0.98 | - | - | - | - | - | - |
| POS [52] | 4.05 | 8.75 | 0.78 | - | - | - | - | 1.906 | 0.991 | - | - | - |
| Super-vised | CAN [7] | - | - | - | - | - | - | - | - | - | 7.78 | 16.8 | -0.03 |
| HR-CNN [45] | - | - | - | 1.84 | 2.37 | 0.98 | - | - | - | - | - | - |
| SynRhythm [31] | 5.59 | 6.82 | 0.72 | - | - | - | - | - | - | - | - | - |
| PhysNet [56] | - | - | - | 2.1 | 2.6 | 0.99 | - | 1.812 | 0.992 | 3.07 | 7.55 | 0.655 |
| rPPGNet [58] | - | - | - | - | - | - | - | 1.8 | 0.992 | - | - | - |
| CVD [33] | - | - | - | - | - | - | - | 1.26 | 0.996 | - | - | - |
| PulseGAN [44] | 1.19 | 2.10 | 0.98 | - | - | - | - | - | - | - | - | - |
| Dual-GAN [25] | 0.44 | 0.67 | 0.99 | 0.82 | 1.31 | 0.99 | - | - | - | - | - | - |
| Nowara2021 [35] | - | - | - | - | - | - | - | - | - | 2.34 | 4.46 | 0.85 |
| Unsupervised | Gideon2021 [10] | 1.85 | 4.28 | 0.93 | 2.3 | 2.9 | 0.99 | 2.83 | 7.88 | 0.825 | 4.75 | 9.14 | 0.61 |
| Ours | 0.64 | 1.00 | 0.99 | 1.00 | 1.40 | 0.99 | 0.51 | 1.39 | 0.994 | 2.68 | 4.77 | 0.85 |
+
+Table 2: HRV results on UBFC-rPPG. The best results are in bold, and the second-best results are underlined.
+
+| Method Types | Methods | LF (n.u.) | HF (n.u.) | LF/HF | RF(Hz) |
| STD | RMSE | R | STD | RMSE | R | STD | RMSE | R | STD | RMSE | R |
| Tradi- tional | GREEN [49] | 0.186 | 0.186 | 0.280 | 0.186 | 0.186 | 0.280 | 0.361 | 0.365 | 0.492 | 0.087 | 0.086 | 0.111 |
| ICA [38] | 0.243 | 0.240 | 0.159 | 0.243 | 0.240 | 0.159 | 0.655 | 0.645 | 0.226 | 0.086 | 0.089 | 0.102 |
| POS [52] | 0.171 | 0.169 | 0.479 | 0.171 | 0.169 | 0.479 | 0.405 | 0.399 | 0.518 | 0.109 | 0.107 | 0.087 |
| Super- vised | CVD [33] | 0.053 | 0.065 | 0.740 | 0.053 | 0.065 | 0.740 | 0.169 | 0.168 | 0.812 | 0.017 | 0.018 | 0.252 |
| Dual-GAN [25] | 0.034 | 0.035 | 0.891 | 0.034 | 0.035 | 0.891 | 0.131 | 0.136 | 0.881 | 0.010 | 0.010 | 0.395 |
| Unsup- ervised | Gideon2021 [10] | 0.091 | 0.139 | 0.694 | 0.091 | 0.139 | 0.694 | 0.525 | 0.691 | 0.684 | 0.061 | 0.098 | 0.103 |
| Ours | 0.050 | 0.098 | 0.798 | 0.050 | 0.098 | 0.798 | 0.205 | 0.395 | 0.782 | 0.055 | 0.083 | 0.347 |
+
+# 5.3 Cross-dataset Testing
+
+We conduct cross-dataset testing on MMSE-HR [59] to test the generalization ability of our method. We train Contrast-Phys and Gideon2021 on UBFC-rPPG and test on MMSE-HR. We also show MMSE-HR cross-dataset results reported in the papers of some supervised methods [32,56,33,23,35] with different training sets. Table 3 shows the cross-dataset test results. Our method still outperforms Gideon2021 [10] and is close to supervised methods. The cross-dataset testing results demonstrate that Contrast-Phys can be trained on one dataset without ground truth physiological signals, and then generalize well to a new dataset.
+
+# 5.4 Running Speed
+
+We test the running speed of the proposed Contrast-Phys and compare it with Gideon2021 [10]. During training, the speed of our method is 802.45 frames
+
+Table 3: Cross-dataset HR Estimation on MMSE-HR. The best results are in bold, and the second-best results are underlined.
+
+| Method Types | Methods | MAE (bpm) | RMSE (bpm) | R |
| Traditional | Li2014 [20] | - | 19.95 | 0.38 |
| CHROM [8] | - | 13.97 | 0.55 |
| SAMC [48] | - | 11.37 | 0.71 |
| Supervised | RhythmNet [32] | - | 7.33 | 0.78 |
| PhysNet [56] | - | 13.25 | 0.44 |
| CVD [33] | - | 6.04 | 0.84 |
| TS-CAN [23] | 3.41 | 7.82 | 0.84 |
| Nowara2021 [35] | 2.27 | 4.90 | 0.94 |
| Unsupervised | Gideon2021 [10] | 4.10 | 11.55 | 0.70 |
| Ours | 2.43 | 7.34 | 0.86 |
+
+
+Fig. 7: irrelevant power ratio change during training time for unsupervised and supervised methods
+
+per second (fps), while that of Gideon2021 is 387.87 fps, which is about half of our method's speed. The large difference is due to different method designs. For Gideon2021, one input video has to be fed into the model twice, i.e., firstly as the original video and then as a temporal resampled video for a second time, which causes double computation. For our method, one video is fed into the model once, which can substantially decrease computational cost compared with Gideon2021.
+
+Furthermore, we compare the convergence speed of the two unsupervised methods and one supervised method (PhysNet [56]) using the metric of irrelevant power ratio (IPR). IPR is used in [10] to evaluate the signal quality during training, and lower IPR means higher signal quality. (more details about IPR are in the supplementary materials.) Fig. 7 shows IPR with respect to time during training on the OBF dataset. Our method converges to the lowest IPR point for about 2.5 hours, while Gideon2021 [10] converges to the lowest point for about 5 hours. In addition, the lowest IPR for our method is about 0.36 while that for Gideon2021 [10] is about 0.66 which is higher than ours. The above evidence demonstrates that our method converges faster to a lower IPR than Gideon2021 [10]. In addition, our method also achieves lower IPR than the supervised method (PhysNet [56])
+
+# 5.5 Saliency Maps
+
+We calculate saliency maps to illustrate the interpretability of our method. The saliency maps are obtained using a gradient-based method proposed in [43]. We fix the weights of the trained model and get the gradient of Pearson correlation with respect to the input video (More details are in the supplementary materials.). Saliency maps can highlight spatial regions from which the model estimates the rPPG signals, so the saliency map of a good rPPG model should have a large response on skin regions, as demonstrated in [56,58,10,7,35].
+
+
+(a)
+Fig. 8: Saliency maps for our method and Gideon2021 [10] (a) We add a random flashing block with the HR range between 40-250 bpm in the top left corner to all UBFC-rPPG videos. The models for our method and Gideon2021 [10] are trained on these videos with the noise. Our saliency maps have a high response on facial regions, while Gideon2021 focuses on this injected periodic noise. Table 4 also shows that our method is robust to the noise. (b) We choose the head motion moments in PURE dataset (Video frames shown here are blurred due to privacy issues.) and show the saliency maps for our method and Gideon2021 [10].
+
+
+(b)
+
+Fig. 8 shows saliency maps under two cases, 1) periodic noise is manually injected, and 2) head motion is involved. When a periodic noise patch is injected to the left-upper corner of videos, our method is not distracted by the noise and still focuses on skin areas, while Gideon2021 is completely distracted by the noise block. We also calculate the two methods' performance on UBFC-rPPG videos with the injected noise, and the results are listed in Table 4. The results are
+
+consistent with the saliency map analysis, that the periodic noise does not impact Contrast-Phys, but fails Gideon2021 completely. Our method is robust to the noise because the noise only exists in one region, which violates rPPG spatial similarity. Fig. 8(b) shows the saliency maps when head motion is involved. The saliency maps for our method focus and activate most skin areas, while saliency maps for Gideon2021 [10] show messy patterns and only partially cover facial areas during head motions.
+
+Table 4: HR results trained on UBFC-rPPG with/without injected periodic noise shown in Fig. 8(a)
+
+| Methods | Injected Periodic Noise | MAE (bpm) | RMSE (bpm) | R |
| Gideon2021 [10] | w/o w/ | 1.85 22.47 | 4.28 25.41 | 0.939 0.244 |
| Ours | w/o w/ | 0.64 0.74 | 1.00 1.34 | 0.995 0.991 |
+
+# 5.6 Sensitivity Analysis
+
+We perform sensitivity analysis on two variables: 1) the spatial length $S$ of the ST-rPPG block, and 2) the temporal length $T$ of the ST-rPPG block.
+
+Table 5(a) shows the HR results on UBFC-rPPG, when the ST-rPPG spatial resolution is set in four levels of $1 \times 1$ , $2 \times 2$ , $4 \times 4$ or $8 \times 8$ . Note that $1 \times 1$ means that rPPG spatial similarity is not used. The results of $1 \times 1$ are worse than other results with spatial information, which means rPPG spatial similarity improves performance. In addition, $2 \times 2$ is enough to perform well since larger resolutions do not significantly improve the HR estimation. Although $8 \times 8$ or $4 \times 4$ provides more rPPG samples, it has a smaller receptive field and thus produces noisier rPPG samples than a $2 \times 2$ block.
+
+Table 5(b) shows the HR results on UBFC-rPPG, when the ST-rPPG temporal length is set on three levels of 5s, 10s and 30s. The results indicate that 10s is the best choice. A shorter time length (5s) causes coarse PSD estimation, while a long time length (30s) causes a slight violation of short-term signal condition in rPPG temporal similarity. Therefore, in these two cases (5s and 30s), the performance is lower than that of 10s.
+
+Table 5: Sensitivity Analysis: (a) HR results on UBFC-rPPG with different ST-rPPG block spatial resolutions. (b) HR results on UBFC-rPPG with different ST-rPPG block time lengths. (The best results are in bold.)
+
+| (a) |
| Spatial Resolution | MAE (bpm) | RMSE (bpm) | R |
| 1 × 1 | 3.14 | 4.06 | 0.963 |
| 2 × 2 | 0.64 | 1.00 | 0.995 |
| 4 × 4 | 0.55 | 1.06 | 0.994 |
| 8 × 8 | 0.60 | 1.09 | 0.993 |
+
+| (b) |
| Time Length | MAE (bpm) | RMSE (bpm) | R |
| 5s | 0.68 | 1.36 | 0.990 |
| 10s | 0.64 | 1.00 | 0.995 |
| 30s | 1.97 | 3.58 | 0.942 |
+
+# 6 Conclusion
+
+We propose Contrast-Phys which can be trained without ground truth physiological signals and achieve accurate rPPG measurement. Our method is based on four observations about rPPG and utilizes spatiotemporal contrast to enable unsupervised learning. Contrast-Phys significantly outperforms the previous unsupervised baseline [10] and is on par with the state-of-the-art supervised rPPG methods. In the future work, we would like to combine the supervised and the proposed unsupervised rPPG methods to further improve performance.
+
+Acknowledgment. The study was supported by Academy of Finland (Project 323287 and 345948) and the Finnish Work Environment Fund (Project 200414). The authors also acknowledge CSC-IT Center for Science, Finland, for providing computational resources.
+
+# References
+
+1. All about heart rate (pulse), https://www.heart.org/en/health-topics/high-blood-pressure/the-facts-about-high-blood-pressure/all-about-heart-rate-pulse
+2. Target heart rates chart, https://www.heart.org/en/healthy-living/fitness/fitness-basics/target-heart-rates
+3. Baltrusaitis, T., Zadeh, A., Lim, Y.C., Morency, L.P.: Openface 2.0: Facial behavior analysis toolkit. In: 2018 13th IEEE international conference on automatic face & gesture recognition (FG 2018). pp. 59-66. IEEE (2018)
+4. Bobbia, S., Macwan, R., Benezeth, Y., Mansouri, A., Dubois, J.: Unsupervised skin tissue segmentation for remote photoplethysmography. Pattern Recognition Letters 124, 82-90 (2019)
+5. Chen, M., Zhu, Q., Wu, M., Wang, Q.: Modulation model of the photoplethysmography signal for vital sign extraction. IEEE Journal of Biomedical and Health Informatics 25(4), 969-977 (2020)
+6. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International conference on machine learning. pp. 1597-1607. PMLR (2020)
+7. Chen, W., McDuff, D.: Deepphys: Video-based physiological measurement using convolutional attention networks. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 349-365 (2018)
+8. De Haan, G., Jeanne, V.: Robust pulse rate from chrominance-based rppg. IEEE Transactions on Biomedical Engineering 60(10), 2878-2886 (2013)
+9. De Haan, G., Van Leest, A.: Improved motion robustness of remote-ppg by using the blood volume pulse signature. Physiological measurement 35(9), 1913 (2014)
+0. Gideon, J., Stent, S.: The way to my heart is through contrastive learning: Remote photoplethysmography from unlabelled video. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3995-4004 (2021)
+1. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al.: Bootstrap your own latent-a new approach to self-supervised learning. Advances in Neural Information Processing Systems 33, 21271-21284 (2020)
+2. Hadsell, R., Chopra, S., LeCun, Y.: Dimensionality reduction by learning an invariant mapping. In: 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06). vol. 2, pp. 1735-1742. IEEE (2006)
+3. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 9729-9738 (2020)
+4. Kamshilin, A.A., Miridonov, S., Teplov, V., Saarenheimo, R., Nippolainen, E.: Photoplethysmographic imaging of high spatial resolution. Biomedical optics express 2(4), 996-1006 (2011)
+5. Kamshilin, A.A., Teplov, V., Nippolainen, E., Miridonov, S., Giniatullin, R.: Variability of microcirculation detected by blood pulsation imaging. PloS one 8(2), e57117 (2013)
+6. Kumar, M., Veeraraghavan, A., Sabharwal, A.: Distanceppg: Robust non-contact vital signs monitoring using a camera. Biomedical optics express 6(5), 1565-1588 (2015)
+7. Lam, A., Kuno, Y.: Robust heart rate measurement from video using select random patches. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 3640-3648 (2015)
+
+18. Lee, E., Chen, E., Lee, C.Y.: Meta-rppg: Remote heart rate estimation using a transductive meta-learner. In: European Conference on Computer Vision. pp. 392–409. Springer (2020)
+19. Li, X., Alikhani, I., Shi, J., Seppanen, T., Junttila, J., Majamaa-Voltti, K., Tulppo, M., Zhao, G.: The obf database: A large face video database for remote physiological signal measurement and atrial fibrillation detection. In: 2018 13th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2018). pp. 242-249. IEEE (2018)
+20. Li, X., Chen, J., Zhao, G., Pietikainen, M.: Remote heart rate measurement from face videos under realistic situations. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4264-4271 (2014)
+21. Liu, S.Q., Lan, X., Yuen, P.C.: Remote photoplethysmography correspondence feature for 3d mask face presentation attack detection. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 558-573 (2018)
+22. Liu, S., Yuen, P.C., Zhang, S., Zhao, G.: 3d mask face anti-spoofing with remote photoplethysmography. In: European Conference on Computer Vision. pp. 85-100. Springer (2016)
+23. Liu, X., Fromm, J., Patel, S., McDuff, D.: Multi-task temporal shift attention networks for on-device contactless vitals measurement. In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M.F., Lin, H. (eds.) Advances in Neural Information Processing Systems. vol. 33, pp. 19400-19411 (2020)
+24. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. In: International Conference on Learning Representations (2019), https://openreview.net/forum?id=Bkg6RiCqY7
+25. Lu, H., Han, H., Zhou, S.K.: Dual-gan: Joint bvp and noise modeling for remote physiological measurement. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12404-12413 (2021)
+26. Magdalena Nowara, E., Marks, T.K., Mansour, H., Veeraraghavan, A.: Sparseppg: Towards driver monitoring using camera-based vital signs estimation in near-infrared. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops. p. 1272-1281 (2018)
+27. Makowski, D., Pham, T., Lau, Z.J., Brammer, J.C., Lespinasse, F., Pham, H., Schölzel, C., Chen, S.: Neurokit2: A python toolbox for neurophysiological signal processing. Behavior research methods 53(4), 1689-1696 (2021)
+28. Martinez, L.F.C., Paez, G., Strojnik, M.: Optimal wavelength selection for noncontact reflection photoplethysmography. In: 22nd Congress of the International Commission for Optics: Light for the Development of the World. vol. 8011, p. 801191. International Society for Optics and Photonics (2011)
+29. McDuff, D., Gontarek, S., Picard, R.: Remote measurement of cognitive stress via heart rate variability. In: 2014 36th annual international conference of the IEEE engineering in medicine and biology society. pp. 2957-2960. IEEE (2014)
+30. Misra, I., Maaten, L.v.d.: Self-supervised learning of pretext-invariant representations. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6707-6717 (2020)
+31. Niu, X., Han, H., Shan, S., Chen, X.: Synrhythm: Learning a deep heart rate estimator from general to specific. In: 2018 24th International Conference on Pattern Recognition (ICPR). pp. 3580-3585. IEEE (2018)
+32. Niu, X., Shan, S., Han, H., Chen, X.: Rhythmnet: End-to-end heart rate estimation from face via spatial-temporal representation. IEEE Transactions on Image Processing 29, 2409-2423 (2019)
+
+33. Niu, X., Yu, Z., Han, H., Li, X., Shan, S., Zhao, G.: Video-based remote physiological measurement via cross-verified feature disentangling. In: European Conference on Computer Vision. pp. 295-310. Springer (2020)
+34. Nowara, E.M., Marks, T.K., Mansour, H., Veeraraghavan, A.: Near-infrared imaging photoplethysmography during driving. IEEE Transactions on Intelligent Transportation Systems (2020)
+35. Nowara, E.M., McDuff, D., Veeraraghavan, A.: The benefit of distraction: Denoising camera-based physiological measurements using inverse attention. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4955-4964 (2021)
+36. Van den Oord, A., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv e-prints pp. arXiv-1807 (2018)
+37. Pai, A., Veeraraghavan, A., Sabharwal, A.: Hrvcam: robust camera-based measurement of heart rate variability. Journal of Biomedical Optics 26(2), 022707 (2021)
+38. Poh, M.Z., McDuff, D.J., Picard, R.W.: Advancements in noncontact, multiparameter physiological measurements using a webcam. IEEE transactions on biomedical engineering 58(1), 7-11 (2010)
+39. Qian, R., Meng, T., Gong, B., Yang, M.H., Wang, H., Belongie, S., Cui, Y.: Spatiotemporal contrastive video representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6964-6974 (2021)
+40. Sabour, R.M., Benezeth, Y., De Oliveira, P., Chappe, J., Yang, F.: Ubfc-phys: A multimodal database for psychophysiological studies of social stress. IEEE Transactions on Affective Computing (2021)
+41. Schroff, F., Kalenichenko, D., Philbin, J.: Facenet: A unified embedding for face recognition and clustering. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 815-823 (2015)
+42. Shi, J., Alikhani, I., Li, X., Yu, Z., Seppänen, T., Zhao, G.: Atrial fibrillation detection from face videos by fusing subtle variations. IEEE Transactions on Circuits and Systems for Video Technology 30(8), 2781-2795 (2019)
+43. Simonyan, K., Vedaldi, A., Zisserman, A.: Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034 (2013)
+44. Song, R., Chen, H., Cheng, J., Li, C., Liu, Y., Chen, X.: Pulsegan: Learning to generate realistic pulse waveforms in remote photoplethysmography. IEEE Journal of Biomedical and Health Informatics 25(5), 1373-1384 (2021)
+45. Špetlík, R., Franc, V., Matas, J.: Visual heart rate estimation with convolutional neural network. In: Proceedings of the British machine vision conference, Newcastle, UK. pp. 3-6 (2018)
+46. Stricker, R., Müller, S., Gross, H.M.: Non-contact video-based pulse rate measurement on a mobile service robot. In: The 23rd IEEE International Symposium on Robot and Human Interactive Communication. pp. 1056-1062. IEEE (2014)
+47. Tian, Y., Krishnan, D., Isola, P.: Contrastive multiview coding. In: European conference on computer vision. pp. 776-794. Springer (2020)
+48. Tulyakov, S., Alameda-Pineda, X., Ricci, E., Yin, L., Cohn, J.F., Sebe, N.: Self-adaptive matrix completion for heart rate estimation from face videos under realistic conditions. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2396-2404 (2016)
+49. Verkruysse, W., Svaasand, L.O., Nelson, J.S.: Remote plethysmographic imaging using ambient light. Optics express 16(26), 21434-21445 (2008)
+
+50. Vizbara, V.: Comparison of green, blue and infrared light in wrist and forehead photoplethysmography. BIOMEDICAL ENGINEERING 2016 17(1) (2013)
+51. Wang, W., den Brinker, A.C., De Haan, G.: Discriminative signatures for remote-ppg. IEEE Transactions on Biomedical Engineering 67(5), 1462-1473 (2019)
+52. Wang, W., den Brinker, A.C., Stuijk, S., De Haan, G.: Algorithmic principles of remote ppg. IEEE Transactions on Biomedical Engineering 64(7), 1479-1491 (2016)
+53. Wang, W., Stuijk, S., De Haan, G.: Exploiting spatial redundancy of image sensor for motion robust rppg. IEEE transactions on Biomedical Engineering 62(2), 415-425 (2014)
+54. Wang, W., Stuijk, S., De Haan, G.: A novel algorithm for remote photoplethysmography: Spatial subspace rotation. IEEE transactions on biomedical engineering 63(9), 1974-1984 (2015)
+55. Yan, B.P., Lai, W.H., Chan, C.K., Chan, S.C.H., Chan, L.H., Lam, K.M., Lau, H.W., Ng, C.M., Tai, L.Y., Yip, K.W., et al.: Contact-free screening of atrial fibrillation by a smartphone using facial pulsatile photoplethysmographic signals. Journal of the American Heart Association 7(8), e008585 (2018)
+56. Yu, Z., Li, X., Zhao, G.: Remote photoplethysmograph signal measurement from facial videos using spatio-temporal networks. In: 30th British Machine Vision Conference 2019. p. 277. BMVA Press (2019)
+57. Yu, Z., Li, X., Zhao, G.: Facial-video-based physiological signal measurement: Recent advances and affective applications. IEEE Signal Processing Magazine 38(6), 50-58 (2021)
+58. Yu, Z., Peng, W., Li, X., Hong, X., Zhao, G.: Remote heart rate measurement from highly compressed facial videos: an end-to-end deep learning solution with video enhancement. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 151-160 (2019)
+59. Zhang, Z., Girard, J.M., Wu, Y., Zhang, X., Liu, P., Ciftci, U., Canavan, S., Reale, M., Horowitz, A., Yang, H., et al.: Multimodal spontaneous emotion corpus for human behavior analysis. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3438-3446 (2016)
\ No newline at end of file
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/images.zip b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..0ae6fadcaf3557b98612bceda2127fc3425cc504
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de079a7a866e05315ee6e2f2e9673125b7dd30b691a6f16cb010ca2962c8a729
+size 485123
diff --git a/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/layout.json b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..52f446836db736c05100a812fee0ff94fae881b1
--- /dev/null
+++ b/contrastphysunsupervisedvideobasedremotephysiologicalmeasurementviaspatiotemporalcontrast/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f2cc33ea2ad68c127b0e0e23176a5cd4521a53945977c0f18681fc169191175
+size 377769
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_content_list.json b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7171e9bfc2b28bff33ce9a1c67e3671f7015a236
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eba2b6e3c16fe299dd1e468003f9f2aac765db0f261586fb7c88dd45b75335da
+size 90725
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_model.json b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5353ad928b8448aca6d17d146f40edbe5bbf648f
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b72db88da27dd75e40e587ba5b70ea0c1693fd67402f77eea316d9d57a2639f3
+size 120047
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_origin.pdf b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..108e0f5c89c29aec97c8c89cc5f5197be469b8eb
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/d2d435c1-ef0d-4f3c-901b-93e9491f3fb0_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c5384f6bf2b77f527514e7294ded1962199ac0b1c28d3de6d782c567f5146e2
+size 6296970
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/full.md b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..11df85c4b48bf1dd0d34fefd31d3926ec71ad5b7
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/full.md
@@ -0,0 +1,351 @@
+# Controllable and Guided Face Synthesis for Unconstrained Face Recognition
+
+Feng Liu, Minchul Kim, Anil Jain, and Xiaoming Liu
+
+Michigan State University, Computer Science & Engineering {liufeng6,kimminc2,jain,liuxm}@msu.edu
+
+Abstract. Although significant advances have been made in face recognition (FR), FR in unconstrained environments remains challenging due to the domain gap between the semi-constrained training datasets and unconstrained testing scenarios. To address this problem, we propose a controllable face synthesis model (CFSM) that can mimic the distribution of target datasets in a style latent space. CFSM learns a linear subspace with orthogonal bases in the style latent space with precise control over the diversity and degree of synthesis. Furthermore, the pre-trained synthesis model can be guided by the FR model, making the resulting images more beneficial for FR model training. Besides, target dataset distributions are characterized by the learned orthogonal bases, which can be utilized to measure the distributional similarity among face datasets. Our approach yields significant performance gains on unconstrained benchmarks, such as IJB-B, IJB-C, TinyFace and IJB-S (+5.76% Rank1). Code is available at http://cvlab.cse.msu.edu/project-cfsm.html.
+
+Keywords: Face Synthesis, Model Training, Target Dataset Distribution, Unconstrained Face Recognition
+
+# 1 Introduction
+
+Face recognition (FR) is now one of the most well-studied problems in the area of computer vision and pattern recognition. The rapid progress in face recognition accuracy can be attributed to developments in deep neural network models [25, 29,71,74], sophisticated design of loss functions [12,33,48,49,53,73,81-84,86,93], and large-scale training datasets, e.g., MS-Celeb-1M [24] and WebFace260M [95].
+
+Despite this progress, state-of-the-art (SoTA) FR models do not work well on real-world surveillance imagery (unconstrained) due to the domain shift issue, that is, the large-scale training datasets (semi-constrained) obtained via web-crawled celebrity faces lack in-the-wild variations, such as inherent sensor noise, low resolution, motion blur, turbulence effect, etc. For instance, 1:1 verification accuracy reported by one of the SoTA models [68] on unconstrained IJB-S [34] dataset is about $30\%$ lower than on semi-constrained LFW [30]. A potential remedy to such a performance gap is to assemble a large-scale unconstrained face dataset. However, constructing such a training dataset with tens of thousands of subjects is prohibitively difficult with high manual labeling cost.
+
+
+Fig. 1. (a) Given an input face image, our controllable face synthesis model (CFSM) enables precise control of the direction and magnitude of the targeted styles in the generated images. The latent style has both the direction and the magnitude, where the direction linearly combines the learned bases to control the type of style, while the magnitude controls the degree of style. (b) CFSM can incorporate the feedback provided by the FR model to generate synthetic training data that can benefit the FR model training and improve generalization to the unconstrained testing scenarios.
+
+An alternative solution is to develop facial image generation models that can synthesize face images with desired properties. Face translation or synthesis using GANs [10, 37, 40, 41, 85, 90] or 3D face reconstruction [2, 27, 42, 63, 76, 77, 94] has been well studied in photo-realistic image generation. However, most of these methods mainly focus on face image restoration or editing, and hence do not lead to better face recognition accuracies. A recent line of research [44, 62, 70, 79] adopts disentangled face synthesis [13, 75, 78], which can provide control over explicit facial properties (pose, expression and illumination) for generating additional synthetic data for varied training data distributions. However, the handcrafted categorization of facial properties and lack of design for cross-domain translation limits their generalizability to challenging testing scenarios. Shi et al. [69] propose to use an unlabeled dataset to boost unconstrained face recognition. However, all of the previous methods can be considered as performing blind data augmentation, i.e., without the feedback of the FR model, which is required to provide critical information for improving the FR performance.
+
+In Fig. 1, we show the difference between a blind and feedback-based face synthesis paradigm. For blind face synthesis, the FR model does not take part in the synthesis process, so there is no guidance from the FR model to avoid trivial synthesis. With feedback from the FR model, as in Fig. 1 (b), synthesized images can be more relevant to increasing the FR performance. Therefore, it is the goal of our paper to allow the FR model to guide the face synthesis towards creating synthetic datasets that can improve the FR performance.
+
+It is not trivial to incorporate the signal from the FR model, as the direct manipulation of an input image towards decreasing the FR loss results in adversarial images that are not analogous to the real image distribution [23]. We thus propose to learn manipulation in the subspace of the style space of the target properties, so that the control can be accomplished 1) in low-dimensions, 2) semantically meaningful along with various quality factors.
+
+In light of this, this paper aims to answer these three questions:
+
+1. Can we learn a face synthesis model that can discover the styles in the target unconstrained data, which enables us to precisely control and increase the diversity of the labeled training samples?
+2. Can we incorporate the feedback provided by the FR model in generating synthetic training data, towards facilitating FR model training?
+3. Additionally, as a by-product of our proposed style based synthesis, can we model the distribution of a target dataset, so that it allows us to quantify the distributional similarity among face datasets?
+
+Towards this end, we propose a face synthesis model that is 1) controllable in the synthesis process and 2) guided in the sense that the sample generation is aided by the signal from the FR model. Specifically, given a labeled training sample set, our controllable face synthesis model (CFSM) is trained to discover different attributes of the unconstrained target dataset in a style latent space. To learn the explicit degree and direction that control the styles in an unsupervised manner, we embed one linear subspace model with orthogonal bases into the style latent space. Within generative adversarial training, the face synthesis model seeks to capture the principal variations of the data distribution, and the style feature magnitude controls the degree of manipulation in the synthesis process.
+
+More importantly, to extract the feedback of the FR model, we apply adversarial perturbations (FGSM) in the learned style latent space to guide the sample generation. This feedback is rendered meaningful and efficient because the manipulation is in the low dimensional style space as opposed to in the high dimensional image space. With the feedback from the FR model, the synthesized images are more beneficial to the FR performance, leading to significantly improved generalization capabilities of the FR models trained with them. It is worth noting that our pre-trained synthesis models could be a plug-in to any SoTA FR model. Unlike the conventional face synthesis models that focus on high quality realistic facial images, our face synthesis module is a conditional mapping from one image to a set of style shifted images that match the distribution of the target unconstrained dataset towards boosting its FR performance.
+
+Additionally, the learned orthogonal bases characterize the target dataset distribution that could be utilized to quantify distribution similarity between datasets. The quantification of datasets has broad impact on various aspects. For example, knowing the dataset distribution similarity could be utilized to gauge the expected performance of FR systems in new datasets. Likewise, given a choice of various datasets to train an FR model, one can find one closest to the testing scenario of interest. Finally, when a new face dataset is captured in the future, we may also access its similarity to existing datasets in terms of styles, in addition to typical metrics such as number of subjects, demographics, etc.
+
+In summary, the contributions of this work include:
+
+$\diamond$ We show that a controllable face synthesis model with linear subspace style representation can generate facial images of the target dataset style, with precise control in the magnitude and type of style.
+
+$\diamond$ We show that FR model performance can be greatly increased by synthesized images when the feedback of the FR model is used to optimize the latent style coefficient during image synthesis.
+$\diamond$ Our learned linear subspace model can characterize the target dataset distribution for quantifying the distribution similarity between face datasets.
+$\diamond$ Our approach yields significant performance gains on unconstrained face recognition benchmarks, such as IJB-B, IJB-C, IJB-S and TinyFace.
+
+# 2 Prior Work
+
+Controllable Face Synthesis With the remarkable ability of GANs [22], face synthesis has seen rapid developments, such as StyleGAN [40] and its variations [38,39,41] which can generate high-fidelity face images from random noises. Lately, GANs have seen widespread use in face image translation or manipulation [6, 10, 13, 28, 47, 61, 72, 88]. These methods typically adopt an encoder-decoder/generator-discriminator paradigm where the encoder embeds images into disentangled latent representations characterizing different face properties. Another line of works incorporates 3D prior (i.e., 3DMM [5]) into GAN for 3D-controllable face synthesis [11, 16, 17, 42, 52, 59, 60, 67]. Also, EigenGAN [26] introduces the linear subspace model into each generator layer, which enables to discover layer-wise interpretable variations. Unfortunately, these methods mainly focus on high-quality face generation or editing on pose, illumination and age, which has a well-defined semantic meaning. However, style or domain differences are hard to be factorized at the semantic level. Therefore, we utilize learned bases to cover unconstrained dataset attributes, such as resolution, noise, etc.
+
+Face Synthesis for Recognition Early attempts exploit disentangled face synthesis to generate additional synthetic training data for either reducing the negative effects of dataset bias in FR [44, 62, 64, 70, 79] or more efficient training of pose-invariant FR models [78, 91, 92], resulting in increased FR accuracy. However, these models only control limited face properties, such as pose, illumination and expression, which are not adequate for bridging the domain gap between the semi-constrained and unconstrained face data. The most pertinent study to our work is [69], which proposes to generalize face representations with auxiliary unlabeled data. Our framework differs in two aspects: i) our synthesis model is precisely-controllable in the style latent space, in both magnitude and direction, and ii) our synthesis model incorporates guidance from the FR model, which significantly improves the generalizability to unconstrained FR.
+
+Domain Generalization and Adaptation Domain Generalization (DG) aims to make DNN perform well on unseen domains [18, 19, 46, 55, 56]. Conventionally, for DG, few labeled samples are provided for the target domain to generalize. Popular DG methods utilize auxiliary losses such as Maximum Mean Discrepancy or domain adversarial loss to learn a shared feature space across multiple source domains [18, 46, 56]. In contrast, our method falls into the category of Unsupervised Domain Adaptation where adaptation is achieved by adversarial loss, contrastive loss or image translation, and learning a shared feature
+
+
+Fig. 2. Overview of the proposed method. Top (Stage 1): Pipeline for training the controllable face synthesis module that mimics the distribution of the target domain. $\mathcal{L}_{adv}$ ensures target domain similarity, $\mathcal{L}_{id}$ enforces the magnitude of $\mathbf{o}$ to control the degree of synthesis, and $\mathcal{L}_{ort}$ factorizes the target domain style with linear bases. Bottom (Stage 2): Pipeline for using the pre-trained face synthesis module for the purpose of training an FR model. The synthesis module works as an augmentation to the training data. We adversarially update $\mathbf{o}$ to maximize $\mathcal{L}_{cls}$ of a given FR model.
+
+space that works for both the original and target domains [15, 36, 57, 58, 65, 80]. Our method augments data resembling the target domain with unlabeled images. Dataset Distances It is important to characterize and contrast datasets in computer vision research. In recent years, various notions of dataset similarity have been proposed [1, 4, 50]. Alpha-distance and discrepancy distance [4, 50] measures a dissimilarity that depends on a loss function and the predictor. To avoid the dependency on the label space, [1] proposes OT distance, an optimal transport distance in the feature space. However, it still depends on the ability of the predictor to create a separable feature space across domains. Moreover, a feature extractor trained on one domain may not predict the resulting features as separable in a new domain. In contrast, we propose to utilize the learned linear bases for latent style codes, which are optimized for synthesizing images in target domains, to measure the dataset distance. The style-based distance has the benefit of not being dependent on the feature space or the label space.
+
+# 3 Proposed Method
+
+# 3.1 Controllable Face Synthesis Model
+
+Generally, for face recognition model training, we are given a labeled semi-constrained dataset that consists of $n$ face images $\mathcal{X} = \{\mathbf{X}\}_{i=1}^{n}$ and the corresponding identity labels. Meanwhile, similar to the work in [69], we assume the availability of an unlabeled target face dataset with $m$ images $\mathcal{Y} = \{\mathbf{Y}\}_{i=1}^{m}$ , which contains a large variety of unconstrained factors. Our goal is to learn a style latent space where the face synthesis model, given an input image from the semi-constrained dataset, can generate new face images of the same subject,
+
+whose style is similar to the target dataset. Due to the lack of corresponding images, we seek an unsupervised algorithm that can learn to translate between domains without paired input-output examples. In addition, we hope this face synthesis model has explicit dimensions to control the unconstrained attributes.
+
+Our face synthesis model is not designed to translate the intrinsic properties between faces, i.e., pose, identity or expression. It is designed to focus on capturing the unconstrained imaging environment factors in unconstrained face images, such as noise, low resolution, motion blur, turbulence effects, etc. These variations are not present in large-scale labeled training data for face recognition. Multimodal Image Translation Network. We adopt a multimodal image-to-image translation network [32,45] to discover the underlying style distribution in the target domain. Specifically, as shown in Fig. 2, our face synthesis generator consists of an encoder $E$ and a decoder $G$ . Given an input image $\mathbf{X} \in \mathbb{R}^{W \times H \times 3}$ , the encoder first extracts its content features $\mathbf{C} = E(\mathbf{X})$ . Then, the decoder generates the output image $\hat{\mathbf{X}} \in \mathbb{R}^{W \times H \times 3}$ , conditioned on both the content features and a random style latent code $\mathbf{z} \in \mathcal{Z}^d$ : $\hat{\mathbf{X}} = G(\mathbf{C},\mathbf{z})$ . Here, the style code $\mathbf{z}$ is utilized to control the style of the output image.
+
+Inspired by recent works that use affine transformation parameters in normalization layers to represent image styles [14, 31, 32, 40], we equip the residual blocks in the decoder $D$ with Adaptive Instance Normalization (AdaIN) layers [31], whose parameters are dynamically generated by a multilayer perceptron (MLP) from the style code $\mathbf{z}$ . Formally, the decoder process can be presented as
+
+$$
+\hat {\mathbf {X}} = G (\mathbf {C}, \operatorname {M L P} (\mathbf {z})). \tag {1}
+$$
+
+It is worth noting that such $G$ can model continuous distributions which enables us to generate multimodal outputs from a given input.
+
+We employ one adversarial discriminator $D$ to match the distribution of the synthesized images to the target data distribution; images generated by the model should be indistinguishable from real images in the target domain. The discriminator loss can be described as:
+
+$$
+\mathcal {L} _ {D} = - \mathbb {E} _ {\mathbf {Y} \sim y} [ \log (D (\mathbf {Y})) ] - \mathbb {E} _ {\mathbf {X} \sim \mathcal {X}, \mathbf {z} \sim \mathcal {Z}} [ \log (1 - D (\hat {\mathbf {X}})) ]. \tag {2}
+$$
+
+The adversarial loss for the generator (including $E$ and $G$ ) is then defined as:
+
+$$
+\mathcal {L} _ {a d v} = - \mathbb {E} _ {\mathbf {X} \sim \mathcal {X}, \mathbf {z} \sim \mathcal {Z}} [ \log (D (\hat {\mathbf {X}})) ]. \tag {3}
+$$
+
+Domain-Aware Linear Subspace Model. To enable precise control of the targeted face properties, achieving flexible image generation, we propose to embed a linear subspace model with orthogonal bases into the style latent space. As illustrated in Fig. 2, a random style coefficient $\mathbf{o} \sim \mathcal{N}_q(\mathbf{0},\mathbf{I})$ can be used to linearly combine the bases and form a new style code $\mathbf{z}$ , as in
+
+$$
+\mathbf {z} = \mathbf {U} \mathbf {o} + \boldsymbol {\mu}, \tag {4}
+$$
+
+where $\mathbf{U} = [\mathbf{u}_1,\dots ,\mathbf{u}_q]\in \mathbb{R}^{d\times q}$ is the orthonormal basis of the subspace. $\pmb {\mu}\in \mathbb{R}^d$ denotes the mean style. This equation relates a $q$ -dimensional coefficient $\mathbf{o}$ to a
+
+corresponding $d$ -dimensional style vector ( $q < d$ ) by an affine transformation and translation. During training, both $\mathbf{U}$ and $\pmb{\mu}$ are learnable parameters. The entire bases $\mathbf{U}$ are optimized with the orthogonality constraint [26]: $\mathcal{L}_{ort} = |\mathbf{U}^{\mathrm{T}}\mathbf{U} - \mathbf{I}|_{1}$ , where $\mathbf{I}$ is an identity matrix.
+
+The isotropic prior distribution of $\mathbf{o}$ does not indicate which directions are useful. However, with the help of the subspace model, each basis vector in $\mathbf{U}$ identifies a latent direction that allows control over target image attributes that vary from straightforward high-level face properties. This mechanism is algorithmically simple, yet leads to effective control without requiring ad-hoc supervision. Accordingly, Eqn. 1 can be updated as $\hat{\mathbf{X}} = G(\mathbf{C},\mathrm{MLP}(\mathbf{U}\mathbf{o} + \boldsymbol {\mu}))$
+
+Magnitude of the Style Coefficient and Identity Preservation. Although the adversarial learning (Eqn. 2 and 3) could encourage the face synthesis module to characterize the attributes in the target data, it cannot ensure the identity information is maintained in the output face image. Hence, the cosine similarity $S_{C}$ between the face feature vectors $f(\mathbf{X})$ and $f(\hat{\mathbf{X}})$ is used to enforce identity preservation: $\mathcal{L}_{id} = 1 - S_{C}(f(\mathbf{X}), f(\hat{\mathbf{X}}))$ , where $f(\cdot)$ represents a pre-trained feature extractor, i.e., ArcFace [12] in our implementation.
+
+Besides identifying the meaningful latent direction, we continue to explore the property of the magnitude $a = ||\mathbf{o}||$ of the style coefficient. We expect the magnitude can measure the degree of identity-preservation in the synthesized image $\hat{\mathbf{X}}$ . In other words, $S_{C}(f(\mathbf{X}), f(\hat{\mathbf{X}}))$ monotonically increases when the magnitude $a$ is decreased. To realize this goal, we re-formulate the identity loss:
+
+$$
+\mathcal {L} _ {i d} = \left\| \left(1 - S _ {C} (f (\mathbf {X}), f (\hat {\mathbf {X}}))\right) - g (a) \right\| _ {2} ^ {2}, \tag {5}
+$$
+
+where $g(a)$ is a function with respect to $a$ . We assume the magnitude $a$ is bounded in $[l_a, u_a]$ . In our implementation, we define $g(a)$ as a linear function on $[l_a, u_a]$ with $g(l_a) = l_m$ , $g(u_a) = u_m$ : $g(a) = (a - l_a)\frac{u_m - l_m}{u_a - l_a} + l_m$ .
+
+By simultaneously learning the direction and magnitude of the style latent coefficients, our model becomes precisely controllable in capturing the variability of faces in the target domain. To our knowledge, this is the first method which is able to explore the complete set of two properties associated with the style, namely direction and magnitude, in unsupervised multimodal face translation.
+
+Model learning. The total loss for the generator (including encoder $E$ , decoder $G$ and domain-aware linear subspace model), with weights $\lambda_{i}$ , is
+
+$$
+\mathcal {L} _ {\mathcal {G}} = \lambda_ {a d v} \mathcal {L} _ {a d v} + \lambda_ {o r t} \mathcal {L} _ {o r t} + \lambda_ {i d} \mathcal {L} _ {i d}. \tag {6}
+$$
+
+# 3.2 Guided Face Synthesis for Face Recognition
+
+In this section, we introduce how to incorporate the pre-trained face synthesis module into deep face representation learning, enhancing the generalizability to unconstrained FR. It is effectively addressing, which synthetic images, when added as an augmentation to the data, will increase the performance of the learned FR model in the unconstrained scenarios?
+
+Formally, the FR model is trained to learn a mapping $\mathcal{F}$ , such that $\mathcal{F}(\mathbf{X})$ is discriminative for different subjects. If $\mathcal{F}$ is only trained on the domain defined by semi-constrained $\mathcal{X}$ , it does not generalize well to unconstrained scenarios. However, $\mathbf{X}$ with identity label $l$ in a training batch may be augmented with a random style coefficient $\mathbf{o}$ to produce a synthesized image $\hat{\mathbf{X}}$ with CFSM.
+
+However, such data synthesis with random style coefficients may generate either extremely easy or hard samples, which may be redundant or detrimental to the FR training. To address this issue, we introduce an adversarial regularization strategy to guide the data augmentation process, so that the face synthesis module is able to generate meaningful samples for the FR model. Specifically, for a given pre-trained CFSM, we apply adversarial perturbations in the learned style latent space, in the direction of maximizing the FR model loss. Mathematically, given the perturbation budget $\epsilon$ , the adversary tries to find a style latent perturbation $\delta \in \mathbb{R}^d$ to maximize the classification loss function $\mathcal{L}_{cla}$ :
+
+$$
+\boldsymbol {\delta} ^ {*} = \underset {| | \boldsymbol {\delta} | | _ {\infty} < \epsilon} {\arg \max } \mathcal {L} _ {c l a} (\mathcal {F} (\mathbf {X} ^ {*}), l), \text {w h e r e} \mathbf {X} ^ {*} = G (E (\mathbf {X}), \operatorname {M L P} (\mathbf {U} (\mathbf {o} + \boldsymbol {\delta}) + \boldsymbol {\mu})). \tag {7}
+$$
+
+Here, $\mathbf{X}^*$ denotes the perturbed synthesized image. $\mathcal{L}_{cla}$ could be any classification-based loss, e.g., popular angular margin-based loss, ArcFace [12] in our implementation. In this work, for efficiency, we adopt the one-step Fast Gradient Sign Method (FGSM) [23] to obtain $\delta^{*}$ and subsequently update $\mathbf{o}$ :
+
+$$
+\mathbf {o} ^ {*} = \mathbf {o} + \boldsymbol {\delta} ^ {*}, \quad \boldsymbol {\delta} ^ {*} = \epsilon \cdot \operatorname {s g n} \left(\nabla_ {\mathbf {z}} \mathcal {L} _ {c l a} \left(\mathcal {F} \left(\mathbf {X} ^ {*}\right), l\right)\right), \tag {8}
+$$
+
+where $\nabla \mathcal{L}_{cla}(\cdot ,\cdot)$ denotes the gradient of $\mathcal{L}_{cla}(\cdot ,\cdot)$ w.r.t. $\mathbf{o}$ , and $\mathrm{sgn}(\cdot)$ is the sign function.
+
+Finally, based on the adversarial-based augmented face images, we further optimize the face embedding model $\mathcal{F}$ via the objective:
+
+$$
+\min _ {\theta} \mathcal {L} _ {c l a} ([ \mathbf {X} ^ {*}, \mathbf {X} ], l), \tag {9}
+$$
+
+where $\theta$ indicates the parameters of FR model $\mathcal{F}$ and $[\cdot ]$ refers to concatenation in the batch dimension. In other words, it encourages to search for the best perturbations in the
+
+
+Fig.3. Plot of mini-batch samples augmented with CFSM during training of the FR model. Top: Original images. Middle: Synthesized results before the feedback of the FR model. Bottom: Synthesized results after the feedback. The guide from the FR model can vary the images' style for increased difficulty (a-d), and preventing the images from identity lost (e-h).
+
+learned style latent space in the direction of maximal difficulty for the FR model. Examples within a mini-batch are shown in Fig. 3.
+
+Dataset Distribution Measure As mentioned above, as a by-product of our learned face synthesis model, we obtain a target-specific linear subspace model, which can characterize the variations in the target dataset. Such learned linear subspace models allow us to quantify the distribution similarity among different datasets. For example, given two unlabeled datasets $A$ and $B$ , we can learn the
+
+corresponding linear subspace models $\{\mathbf{U}_A, \pmb{\mu}_A\}$ and $\{\mathbf{U}_B, \pmb{\mu}_B\}$ . We define the distribution similarity between them as
+
+$$
+\mathcal {S} (A, B) = \frac {1}{q} \left(\sum_ {i} ^ {q} S _ {C} \left(\mathbf {u} _ {A} ^ {i} + \boldsymbol {\mu} _ {A}, \mathbf {u} _ {B} ^ {i} + \boldsymbol {\mu} _ {B}\right)\right), \tag {10}
+$$
+
+where $S_{C}(\cdot, \cdot)$ denotes the Cosine Similarity between the corresponding basis vectors in $\mathbf{U}_A$ and $\mathbf{U}_B$ respectively, and $q$ is the number of the basis vectors.
+
+Measuring the distance or similarity between datasets is a fundamental concept underlying research areas such as domain adaptation and transfer learning. However, the solution to this problem typically involves measuring feature distance with respect to a learned model, which may be susceptible to modal failure that the model may encounter in unseen domains. In this work, we provide an alternative solution via learned style bases vectors, that are directly optimized to capture the characteristics of the target dataset. We hope our method could provide new understandings and creative insights in measuring the dataset similarity. For visualizations of $S$ among different datasets, please refer to Sec. 4.3.
+
+# 3.3 Implementation Details
+
+All face images are aligned and resized into $112 \times 112$ pixels. The network architecture of the face synthesis model is given in the supplementary (Supp). In the main experiments, we set $q = 10$ , $d = 128$ , $l_a = 0$ , $u_a = 6$ , $l_m = 0.05$ , $u_m = 0.65$ , $\lambda_{adv} = 1$ , $\lambda_{ort} = 1$ , $\lambda_{id} = 8$ , $\epsilon = 0.314$ . For more details, refer to Sec. 4 or Supp.
+
+# 4 Experimental Results
+
+# 4.1 Comparison with SoTA FR methods
+
+Datasets Following the experimental setting of [69], we use MS-Celeb-1M [24] as our labeled training dataset. MS-Celeb-1M is a large-scale public face dataset with web-crawled celebrity photos. For a fair comparison, we use the cleaned MS1M-V2 (3.9M images of 85.7K classes) from [69]. For our target data, WiderFace [89] is used. WiderFace is a dataset collected for face detection in challenging scenarios, with a diverse set of unconstrained variations. It is a suitable target dataset for training CFSM, as we aim to bridge the gap between the semi-constrained training faces and the faces in challenging testing scenarios. We follow [69] and use 70K face images from WiderFace. For evaluation, we test on four unconstrained face recognition benchmarks: IJB-B, IJB-C, IJB-S and TinyFace. These 4 datasets represent real-world testing scenarios where faces are significantly different from the semi-constrained training dataset.
+
+$\diamond$ IJB-B [87] contains both high-quality celebrity photos collected in the wild and low-quality photos or video frames with large variations. It consists of 1,845 subjects with 21.8K still images and 55K frames from 7,011 videos.
+$\diamond$ IJB-C [51] is an extension of IJB-B, which includes about 3,500 subjects with a total of 31,334 images and 117,542 unconstrained video frames.
+
+Table 1. Comparison with state-of-the-art methods on the IJB-B benchmark. \* denotes a subset of data selected by the authors.
+
+| Method | Train Data, #labeled(+#unlabeled) | Backbone | Verification | Identification |
| 1e-5 | 1e-4 | 1e-3 | Rank1 | Rank5 |
| VGGFace2 [7] | VGGFace2, 3.3M | SE-ResNet-50 | 70.50 | 83.10 | 90.80 | 90.20 | 94.6 |
| AFRN [35] | VGGFace2*, 3.1M | ResNet-101 | 77.10 | 88.50 | 94.90 | 97.30 | 97.60 |
| ArcFace [12] | MS1MV2, 5.8M | ResNet-50 | 84.28 | 91.66 | 94.81 | 92.95 | 95.60 |
| MagFace [53] | MS1MV2, 5.8M | ResNet-50 | 83.87 | 91.47 | 94.67 | - | - |
| Shi et al. [69] | cleaned MS1MV2, 3.9M(+70K) | ResNet-50 | 88.19 | 92.78 | 95.86 | 95.86 | 96.72 |
| ArcFace | cleaned MS1MV2, 3.9M | ResNet-50 | 87.26 | 94.01 | 95.95 | 94.61 | 96.52 |
| ArcFace+Ours | cleaned MS1MV2, 3.9M(+70K) | ResNet-50 | 90.95 | 94.61 | 96.21 | 94.96 | 96.84 |
+
+Table 2. Comparison with state-of-the-art methods on the IJB-C benchmark.
+
+| Method | Train Data, #labeled(+#unlabeled) | Backbone | Verification | Identification |
| 1e-6 | 1e-5 | 1e-4 | Rank1 | Rank5 |
| VGGFace2 [7] | VGGFace2, 3.3M | SE-ResNet-50 | - | 76.80 | 86.20 | 91.40 | 95.10 |
| AFRN [35] | VGGFace2*, 3.1M | ResNet-101 | - | 88.30 | 93.00 | 95.70 | 97.60 |
| PFE [68] | MS1M-, 4.4M | ResNet-64 | - | 89.64 | 93.25 | 95.49 | 97.17 |
| DUL [8] | MS1M-, 3.6M | ResNet-64 | - | 90.23 | 94.20 | 95.70 | 97.60 |
| ArcFace [12] | MS1MV2, 5.8M | ResNet-50 | 80.52 | 88.36 | 92.52 | 93.26 | 95.33 |
| MagFace [53] | MS1MV2, 5.8M | ResNet-50 | 81.69 | 88.95 | 93.34 | - | - |
| Shi et al. [69] | cleaned MS1MV2, 3.9M(+70K) | ResNet-50 | 87.92 | 91.86 | 94.66 | 95.61 | 97.13 |
| ArcFace | cleaned MS1MV2, 3.9M | ResNet-50 | 87.24 | 93.32 | 95.61 | 95.89 | 97.08 |
| ArcFace+ours | cleaned MS1MV2, 3.9M(+70K) | ResNet-50 | 89.34 | 94.06 | 95.90 | 96.31 | 97.48 |
+
+$\diamond$ IJB-S [34] is an extremely challenging benchmark where the images were collected in real-world surveillance environments. The dataset contains 202 subjects with an average of 12 videos per subject. Each subject also has 7 high-quality enrollment photos under different poses. We test on three protocols, Surveillance-to-Still (V2S), Surveillance-to-Booking (V2B) and Surveillance-to-Surveillance (V2V). The first/second notation in the protocol refers to the probe/gallery image source. 'Surveillance' (V) refers to the surveillance video, 'still' (S) refers to the frontal high-quality enrollment image and 'Booking' (B) refers to the 7 high-quality enrollment images.
+
+$\diamond$ TinyFace [9] consists of 5,139 labelled facial identities given by 169,403 native low-resolution face images, which is created to facilitate the investigation of unconstrained low-resolution face recognition.
+
+Experiment Setting We first train CFSM with $\sim 10\%$ of MS-Celeb-1M training data ( $n = 0.4\mathrm{M}$ ) as the source domain, and WiderFace as the target domain ( $m = 70\mathrm{K}$ ). The model is trained for 125,000 steps with a batch size of 32. Adam optimizer is used with $\beta_{1} = 0.5$ and $\beta_{2} = 0.99$ at a learning rate of $1e - 4$ .
+
+For the FR model training, we adopt ResNet-50 as modified in [12] as the backbone and use ArcFace loss function [12] for training. We also train a model without using CFSM (i.e., replication of ArcFace) for comparison, denoted as ArcFace. The efficacy of our method (ArcFace+Ours) is validated by training an FR model with the guided face synthesis as the auxiliary data augmentation during training according to Eq. 9.
+
+Results. Tables 1 and 2 respectively show the face verification and identification results on IJB-B and IJB-C datasets. Our approach achieves SoTA performance on most of the protocols. For IJB-B, performance increase from us
+
+Table 3. Comparison with state-of-the-art methods on three protocols of the IJB-S and TinyFace benchmark. The performance is reported in terms of rank retrieval (closed-set) and TAR@FAR (open-set). It is worth noting that MARN [21] is a multimode aggregation method and is fine-tuned on UMDFaceVideo [3], a video dataset.
+
+| Method | Labeled Train Data | Backbone | IJB-S V2S | IJB-S V2B | IJB-S V2V | TinyFace |
| Rank1 | Rank5 | 1% | 10% | Rank1 | Rank5 | 1% | 10% | Rank1 | Rank5 | 1% | 10% | Rank1 | Rank5 |
| C-FAN [20] | MS1M-* | ResNet-64 | 50.82 | 61.16 | 16.44 | 24.19 | 53.04 | 62.67 | 27.40 | 29.70 | 10.05 | 17.55 | 0.11 | 0.68 | - | - |
| MARN [21] | MS1M-* | ResNet-64 | 58.14 | 64.11 | 21.47 | - | 59.26 | 65.93 | 32.07 | - | 22.25 | 34.16 | 0.19 | - | - | - |
| PFE [68] | MS1M-* | ResNet-64 | 50.16 | 58.33 | 31.88 | 35.33 | 53.60 | 61.75 | 35.99 | 39.82 | 9.20 | 20.82 | 0.84 | 2.83 | - | - |
| ArcFace [12] | MS1MV2 | ResNet-50 | 50.39 | 60.42 | 32.39 | 42.99 | 52.25 | 61.19 | 34.87 | 43.50 | - | - | - | - | - | - |
| Shi et al. [69] | MS1MV2-* | ResNet-50 | 59.29 | 66.91 | 39.92 | 50.49 | 60.58 | 67.70 | 32.39 | 44.32 | 17.35 | 28.34 | 1.16 | 5.37 | - | - |
| ArcFace [12] | MS1MV2-* | ResNet-50 | 58.78 | 66.40 | 40.99 | 50.45 | 60.66 | 67.43 | 43.12 | 51.38 | 14.81 | 26.72 | 2.51 | 5.72 | 62.21 | 66.85 |
| ArcFace+Ours* | MS1MV2-* | ResNet-50 | 61.69 | 68.33 | 43.99 | 53.34 | 62.20 | 69.50 | 44.38 | 53.49 | 18.14 | 31.34 | 2.09 | 4.51 | 62.39 | 67.36 |
| ArcFace+Ours | MS1MV2-* | ResNet-50 | 63.86 | 69.95 | 47.86 | 56.44 | 65.95 | 71.16 | 47.28 | 57.24 | 21.38 | 35.11 | 2.96 | 7.41 | 63.01 | 68.21 |
| AdaFace [43] | WebFace12M | IResNet-100 | 71.35 | 76.24 | 59.40 | 66.34 | 71.93 | 76.56 | 59.37 | 66.68 | 36.71 | 50.03 | 4.62 | 11.84 | 72.29 | 74.97 |
| AdaFace+Ours | WebFace12M | IResNet-100 | 72.54 | 77.59 | 60.94 | 66.02 | 72.65 | 78.18 | 60.26 | 65.88 | 39.14 | 50.91 | 5.05 | 13.17 | 73.87 | 76.77 |
+
+
+
+
+
+
+
+
+Fig.4. Comparison on three IJB-S protocols with varied number of training data on the $x$ -axis (maximum is 3.9M). The plots show that using guided CFSM as an augmentation $(\mathbf{ArcFace} + \mathbf{Ours})$ can lead to higher performance in all settings. Note that CFSM trained on 70K unlabeled data is more useful than 3M original data as shown by the higher V2V performance of Ours with 0.5M than Baseline 3.9M.
+
+
+
+
+
+ing CFSM (ArcFace+Ours) is $3.69\%$ for TAR@FAR $= 1e - 5$ , and $2.10\%$ for TAR@FAR $= 1e - 6$ on IJB-C. Since both IJB-B and IJB-C are a mixture of high quality images and low quality videos, the performance gains with the augmented data indicate that our model can generalize to both high and low quality scenarios. In Tab. 3, we show the comparisons on IJB-S and TinyFace. With our CFSM (ArcFace+Ours), ArcFace model outperforms all the baselines in both face identification and verification tasks, and achieves a new SoTA performance.
+
+# 4.2 Ablation and Analysis
+
+In this experiment, we compare the face verification and identification performance on the most challenging IJB-S and TinyFace datasets.
+
+
+Fig.5. (a) Few examples from each dataset. Note differences in style. For example, AgeDB contains old grayscale photos, WiderFace has mostly low resolution faces, and IJB-S includes extreme unconstrained attributes (i.e., noise, motion blur or turbulence effect). (b) shows the pairwise distribution similarity scores among datasets that are calculated using the learned subspace via Eq. 10. Note both IJB-B and WiderFace have high similarity scores with IJB-S. (c) The t-SNE plot of the learned $[\mathbf{u}_1,\dots,\mathbf{u}_{10}]$ and mean style $\mu$ . The dots represent $\mathbf{u}_i + \mu$ and the stars denote $\mu$ .
+
+Large-scale Training Data vs. Augmentation. To further validate the applicability of our CFSM as an augmentation in different training settings, we adopt IResNet-100 [12] as the FR model backbone and utilize SoTA AdaFace loss function [43] and large-scale WebFace12M [95] dataset for training. As compared in Tab. 3, our model still improves unconstrained face recognition accuracies by a promising margin (Rank1: $+2.43\%$ on the IJB-S V2V protocol and $+1.58\%$ on TinyFace) on a large-scale training dataset (WebFace12M).
+
+Effect of Guidance in CFSM. To validate the effectiveness of the proposed controllable and guided face synthesis model in face recognition, we train a FR model with CFSM as augmentation but with random style coefficients $(\mathbf{Ours}^*)$ and compare with guided CFSM (Ours). Tab. 3 shows that the synthesis with random coefficients does not bring significant benefit to unconstrained IJB-S dataset performance. However, when samples are generated with guided CFSM, the trained FR model performs much better. Fig. 3 shows the effect of guidance in the training images. For low quality images, too much degradation leads to images with altered identity. Fig. 3 shows that guided CFSM avoids synthesizing bad quality images that are unidentifiable.
+
+Effect of the Number of Labeled Training Data. To validate the effect of the number of labeled training data, we train a series of models by adjusting the number of labeled training samples from 0.5M to 3.9M and report results both on ArcFace and ArcFace+Ours settings. Fig. 4 shows the performance on various IJB-S protocols. For the full data usage setting, our model trained with guided CFSM as an augmentation outperforms the baseline by a large margin. Also note that the proposed method trained with 1/8th (0.5M) labeled data still achieves comparable performance, or even better than the baseline with 3.9M labeled data on V2V protocol. This is due to CFSM generating target data-specific augmentations, thus demonstrating the value of our controllable and guided face synthesis, which can significantly boost unconstrained FR performance.
+
+
+Fig. 6. Interpretable magnitude of the style coefficients. Given an input image, we randomly sample two sets of style coefficients $\mathbf{o_1}$ (left) and $\mathbf{o_2}$ (right) for all 3 models (respectively trained with the IJB-S, WiderFace and AgeDB datasets as the target data). We dynamically adjust the magnitude of these two coefficients by $0.5a$ , $a$ , $1.5a$ , $2a$ , $3a$ , $4a$ , where $a = \frac{\mathbf{o}}{||\mathbf{o}||}$ . As can be seen, our model indeed realizes the goal of changing the degree of style synthesis with the coefficient magnitude.
+
+# 4.3 Analysis and Visualizations of the Face Synthesis model
+
+In this experiment, we quantitatively evaluate the distributional similarity between datasets based on the learned linear subspace model for face synthesis. To this end, we choose 6 face datasets that are publicly available and popular for face recognition testing. These datasets are LFW [30], AgeDB-30 [54], CFP-FP [66], IJB-B [87], WiderFace (WF) [89] and IJB-S [34]. Figure 5(a) shows examples from these 6 datasets. Each dataset has its own style. For example, CFP-FP includes profile faces, WiderFace has mostly low resolution faces, and IJB-S contains extreme unconstrained attributes. During training, for each dataset, we randomly select 12K images as our target data to train the synthesis model. For the source data, we use the same subset of MS-Celeb-1M as in Sec. 4.1.
+
+Distribution Similarity Based on the learned dataset-specific linear subspace model, we calculate the pairwise distribution similarity score via Eqn. 10. As shown in Fig. 5(b), the score reflects the style correlation between datasets. For instance, strong correlations among IJB-B, IJB-S and WiderFace (WF) are observed. We further visualize the learned basis vectors $[\mathbf{u}_1,\dots,\mathbf{u}_q]$ and the mean style $\mu$ in Fig. 5(c). The basis vectors are well clustered and the discriminative grouping indicates the correlation between dataset-specific models.
+
+Visualizations of Style Latent Spaces Fig. 6 shows face images generated by the learned CFSM. It can be seen that when the magnitude increases, the corresponding synthesized faces reveal more dataset-specific style variations. This implies the magnitude of the style code is a good indicator of image quality.
+
+We also visualize the learned $\mathbf{U}$ of 6 models in Fig. 7. As we move along a basis vector of the learned subspace, the synthesized images change their style in dataset-specific ways. For instance, with target as WiderFace or IJB-S, synthesized images show various low quality styles such as blurring or turbulence effect. CFP dataset contains cropped images, and the "crop" style manifests in certain directions. Also, we can observe the learned $\mathbf{U}$ are different among
+
+
+Fig. 7. Given a single input image, we visualize the synthesized images by traversing along with the learned orthonormal basis $\mathbf{U}$ in the 6 dataset-specific models. For each dataset, Rows 1-3 illustrate the first 3 basis vectors traversed. Columns 1-5 show the directions which are scaled to emphasize their effect, i.e., only one element of style coefficient $\mathbf{o}$ varies from $-3\sigma$ to $3\sigma$ while other $q - 1$ elements remain 0.
+
+datasets, which further verifies that our learned linear subspace model in CFSM is able to capture the variations in target datasets.
+
+# 5 Conclusions
+
+We answer the fundamental question of "How can image synthesis benefit the end goal of improving the recognition task?" Our controllable face synthesis model (CFSM) with adversarial feedback of FR model shows the merit of task-oriented image manipulation, evidenced by significant performance increases in unconstrained face datasets (IJB-B, IJB-C, IJB-S and TinyFace). In a broader context, it shows that adversarial manipulation could go beyond being an attacker, and serve to increase recognition accuracies in vision tasks. Meanwhile, we define a dataset similarity metric based on the learned style bases, which capture the style differences in a label or predictor agnostic way. We believe that our research has presented the power of a controllable and guided face synthesis model for unconstrained FR and provides an understanding of dataset differences.
+
+Acknowledgments. This research is based upon work supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via 2022-21102100004. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein.
+
+# References
+
+1. Alvarez-Melis, D., Fusi, N.: Geometric dataset distances via optimal transport. Advances in Neural Information Processing Systems 33, 21428-21439 (2020) 5
+2. Bai, Z., Cui, Z., Liu, X., Tan, P.: Riggable 3d face reconstruction via in-network optimization. In: CVPR (2021) 2
+3. Bansal, A., Castillo, C., Ranjan, R., Chellappa, R.: The do's and don'ts for CNN-based face verification. In: ICCVW (2017) 11
+4. Ben-David, S., Blitzer, J., Crammer, K., Pereira, F.: Analysis of representations for domain adaptation. In: NeurIPS (2006) 5
+5. Blanz, V., Vetter, T.: A morphable model for the synthesis of 3D faces. In: SIGGRAPH (1999) 4
+6. Bulat, A., Yang, J., Tzimiropoulos, G.: To learn image super-resolution, use a gan to learn how to do image degradation first. In: ECCV (2018) 4
+7. Cao, Q., Shen, L., Xie, W., Parkhi, O.M., Zisserman, A.: VGGface2: A dataset for recognising faces across pose and age. In: FG (2018) 10
+8. Chang, J., Lan, Z., Cheng, C., Wei, Y.: Data uncertainty learning in face recognition. In: CVPR (2020) 10
+9. Cheng, Z., Zhu, X., Gong, S.: Low-resolution face recognition. In: ACCV (2018) 10
+10. Choi, Y., Choi, M., Kim, M., Ha, J.W., Kim, S., Choo, J.: StarGAN: Unified generative adversarial networks for multi-domain image-to-image translation. In: CVPR (2018) 2, 4
+1. Deng, J., Cheng, S., Xue, N., Zhou, Y., Zafeiriou, S.: UV-GAN: Adversarial facial uv map completion for pose-invariant face recognition. In: CVPR (2018) 4
+2. Deng, J., Guo, J., Xue, N., Zafeiriou, S.: ArcFace: Additive angular margin loss for deep face recognition. In: CVPR (2019) 1, 7, 8, 10, 11, 12
+3. Deng, Y., Yang, J., Chen, D., Wen, F., Tong, X.: Disentangled and controllable face image generation via 3D imitative-contrastive learning. In: CVPR (2020) 2, 4
+4. Dumoulin, V., Shlens, J., Kudlur, M.: A learned representation for artistic style. In: ICLR (2017) 6
+5. Ganin, Y., Lempitsky, V.: Unsupervised domain adaptation by backpropagation. In: ICML (2015) 5
+6. Gecer, B., Bhattarai, B., Kittler, J., Kim, T.K.: Semi-supervised adversarial learning to generate photorealistic face images of new identities from 3D morphable model. In: ECCV (2018) 4
+7. Geng, Z., Cao, C., Tulyakov, S.: 3D guided fine-grained face manipulation. In: CVPR (2019) 4
+8. Ghifary, M., Balduzzi, D., Kleijn, W.B., Zhang, M.: Scatter component analysis: A unified framework for domain adaptation and domain generalization. PAMI (2016) 4
+9. Ghifary, M., Kleijn, W.B., Zhang, M., Balduzzi, D.: Domain generalization for object recognition with multi-task autoencoders. In: ICCV (2015) 4
+20. Gong, S., Shi, Y., Kalka, N.D., Jain, A.K.: Video face recognition: Component-wise feature aggregation network. In: ICB (2019) 11
+21. Gong, S., Shi, Y., Jain, A.: Low quality video face recognition: Multi-mode aggregation recurrent network. In: ICCVW (2019) 11
+22. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: NeurIPS (2014) 4
+
+23. Goodfellow, I.J., Shlens, J., Szegedy, C.: Explaining and harnessing adversarial examples. In: ICLR (2015) 2, 8
+24. Guo, Y., Zhang, L., Hu, Y., He, X., Gao, J.: MS-Celeb-1M: A dataset and benchmark for large-scale face recognition. In: ECCV (2016) 1, 9
+25. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016) 1
+26. He, Z., Kan, M., Shan, S.: EigenGAN: Layer-wise eigen-learning for gans. In: ICCV (2021) 4, 7
+27. Hou, A., Sarkis, M., Bi, N., Tong, Y., Liu, X.: Face relighting with geometrically consistent shadows. In: CVPR (2022) 2
+28. Hu, Q., Szabó, A., Portenier, T., Favaro, P., Zwicker, M.: Disentangling factors of variation by mixing them. In: CVPR (2018) 4
+29. Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q.: Densely connected convolutional networks. In: CVPR (2017) 1
+30. Huang, G.B., Ramesh, M., Berg, T., Learned-Miller, E.: Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Tech. Rep. 07-49, University of Massachusetts, Amherst (2007) 1, 13
+31. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: ICCV (2017) 6
+32. Huang, X., Liu, M.Y., Belongie, S., Kautz, J.: Multimodal unsupervised image-to-image translation. In: ECCV (2018) 6
+33. Huang, Y., Wang, Y., Tai, Y., Liu, X., Shen, P., Li, S., Li, J., Huang, F.: CurriculumFace: adaptive curriculum learning loss for deep face recognition. In: CVPR (2020) 1
+34. Kalka, N.D., Maze, B., Duncan, J.A., O'Connor, K., Elliott, S., Hebert, K., Bryan, J., Jain, A.K.: IJB-S: Iarpa janus surveillance video benchmark. In: BTAS (2018) 1, 10, 13
+35. Kang, B.N., Kim, Y., Jun, B., Kim, D.: Attentional feature-pair relation networks for accurate face recognition. In: ICCV (2019) 10
+36. Kang, G., Jiang, L., Yang, Y., Hauptmann, A.G.: Contrastive adaptation network for unsupervised domain adaptation. In: CVPR (2019) 5
+37. Karras, T., Aila, T., Laine, S., Lehtinen, J.: Progressive growing of gans for improved quality, stability, and variation. In: ICLR (2018) 2
+38. Karras, T., Aittala, M., Hellsten, J., Laine, S., Lehtinen, J., Aila, T.: Training generative adversarial networks with limited data. In: NeurIPS (2020) 4
+39. Karras, T., Aittala, M., Laine, S., Harkonen, E., Hellsten, J., Lehtinen, J., Aila, T.: Alias-free generative adversarial networks. In: NeurIPS (2021) 4
+40. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: CVPR (2019) 2, 4, 6
+41. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of stylegan. In: CVPR (2020) 2, 4
+42. Kim, H., Garrido, P., Tewari, A., Xu, W., Thies, J., Niessner, M., Pérez, P., Richardt, C., Zollhöfer, M., Theobalt, C.: Deep video portraits. TOG (2018) 2, 4
+43. Kim, M., Jain, A.K., Liu, X.: AdaFace: Quality adaptive margin for face recognition. In: CVPR (2022) 11, 12
+44. Kortylewski, A., Egger, B., Schneider, A., Gerig, T., Morel-Forster, A., Vetter, T.: Analyzing and reducing the damage of dataset bias to face recognition with synthetic data. In: CVPRW (2019) 2, 4
+45. Lee, H.Y., Tseng, H.Y., Huang, J.B., Singh, M., Yang, M.H.: Diverse image-to-image translation via disentangled representations. In: ECCV (2018) 6
+
+46. Li, H., Pan, S.J., Wang, S., Kot, A.C.: Domain generalization with adversarial feature learning. In: CVPR (2018) 4
+47. Lin, J., Xia, Y., Qin, T., Chen, Z., Liu, T.Y.: Conditional image-to-image translation. In: CVPR (2018) 4
+48. Liu, H., Zhu, X., Lei, Z., Li, S.Z.: AdaptiveFace: Adaptive margin and sampling for face recognition. In: CVPR (2019) 1
+49. Liu, W., Wen, Y., Yu, Z., Li, M., Raj, B., Song, L.: SphereFace: Deep hypersphere embedding for face recognition. In: CVPR (2017) 1
+50. Mansour, Y., Mohri, M., Rostamizadeh, A.: Domain adaptation: Learning bounds and algorithms. In: COLT (2009) 5
+51. Maze, B., Adams, J., Duncan, J.A., Kalka, N., Miller, T., Otto, C., Jain, A.K., Niggel, W.T., Anderson, J., Cheney, J., et al.: Iarpa janus benchmark-C: Face dataset and protocol. In: ICB (2018) 9
+52. Medin, S.C., Egger, B., Cherian, A., Wang, Y., Tenenbaum, J.B., Liu, X., Marks, T.K.: MOST-GAN: 3d morphable stylegan for disentangled face image manipulation. In: AAAI (2022) 4
+53. Meng, Q., Zhao, S., Huang, Z., Zhou, F.: MagFace: A universal representation for face recognition and quality assessment. In: CVPR (2021) 1, 10
+54. Moschoglou, S., Papaioannou, A., Sagonas, C., Deng, J., Kotsia, I., Zafeiriou, S.: AgeDB: the first manually collected, in-the-wild age database. In: CVPRW (2017) 13
+55. Motiian, S., Piccirilli, M., Adjeroh, D.A., Doretto, G.: Unified deep supervised domain adaptation and generalization. In: ICCV (2017) 4
+56. Muandet, K., Balduzzi, D., Scholkopf, B.: Domain generalization via invariant feature representation. In: ICML (2013) 4
+57. Murez, Z., Kolouri, S., Kriegman, D., Ramamoorthi, R., Kim, K.: Image to image translation for domain adaptation. In: CVPR (2018) 5
+58. Nam, H., Lee, H., Park, J., Yoon, W., Yoo, D.: Reducing domain gap by reducing style bias. In: CVPR (2021) 5
+59. Nguyen-Phuoc, T., Li, C., Theis, L., Richardt, C., Yang, Y.L.: HoloGAN: Unsupervised learning of 3d representations from natural images. In: ICCV (2019) 4
+60. Piao, J., Qian, C., Li, H.: Semi-supervised monocular 3D face reconstruction with end-to-end shape-preserved domain transfer. In: ICCV (2019) 4
+61. Pumarola, A., Agudo, A., Martinez, A.M., Sanfeliu, A., Moreno-Noguer, F.: Ganimationation: Anatomically-aware facial animation from a single image. In: ECCV (2018) 4
+62. Qiu, H., Yu, B., Gong, D., Li, Z., Liu, W., Tao, D.: SynFace: Face recognition with synthetic data. In: ICCV (2021) 2, 4
+63. Rossler, A., Cozzolino, D., Verdoliva, L., Riess, C., Thies, J., Nießner, M.: Faceforensics++: Learning to detect manipulated facial images. In: ICCV (2019) 2
+64. Ruiz, N., Theobald, B.J., Ranjan, A., Abdelaziz, A.H., Apostoloff, N.: MorphGAN: One-shot face synthesis gan for detecting recognition bias. arXiv preprint arXiv:2012.05225 (2020) 4
+65. Saito, K., Watanabe, K., Ushiku, Y., Harada, T.: Maximum classifier discrepancy for unsupervised domain adaptation. In: CVPR (2018) 5
+66. Sengupta, S., Chen, J.C., Castillo, C., Patel, V.M., Chellappa, R., Jacobs, D.W.: Frontal to profile face verification in the wild. In: WACV (2016) 13
+67. Shen, Y., Zhou, B., Luo, P., Tang, X.: Facefeat-GAN: a two-stage approach for identity-preserving face synthesis. arXiv preprint arXiv:1812.01288 (2018) 4
+
+68. Shi, Y., Jain, A.K.: Probabilistic face embeddings. In: ICCV (2019) 1, 10, 11
+69. Shi, Y., Jain, A.K.: Boosting unconstrained face recognition with auxiliary unlabeled data. In: CVPRW (2021) 2, 4, 5, 9, 10, 11
+70. Shi, Y., Yu, X., Sohn, K., Chandraker, M., Jain, A.K.: Towards universal representation learning for deep face recognition. In: CVPR (2020) 2, 4
+71. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014) 1
+72. Sun, T., Barron, J.T., Tsai, Y.T., Xu, Z., Yu, X., Fyffe, G., Rhemann, C., Busch, J., Debevec, P.E., Ramamoorthi, R.: Single image portrait relighting. TOG (2019) 4
+73. Sun, Y., Cheng, C., Zhang, Y., Zhang, C., Zheng, L., Wang, Z., Wei, Y.: Circle loss: A unified perspective of pair similarity optimization. In: CVPR (2020) 1
+74. Tan, M., Le, Q.: Efficientnet: Rethinking model scaling for convolutional neural networks. In: ICML (2019) 1
+75. Tewari, A., Elgharib, M., Bharaj, G., Bernard, F., Seidel, H.P., Pérez, P., Zollhofer, M., Theobalt, C.: StyleRig: Rigging stylegan for 3D control over portrait images. In: CVPR (2020) 2
+76. Thies, J., Zollhofer, M., Stamminger, M., Theobalt, C., Nießner, M.: Face2Face: Real-time face capture and reenactment of RGB videos. In: CVPR (2016) 2
+77. Tran, L., Liu, X.: Nonlinear 3d face morphable model. In: CVPR (2018) 2
+78. Tran, L., Yin, X., Liu, X.: Disentangled representation learning GAN for pose-invariant face recognition. In: CVPR (2017) 2, 4
+79. Trigueros, D.S., Meng, L., Hartnett, M.: Generating photo-realistic training data to improve face recognition accuracy. Neural Networks (2021) 2, 4
+80. Tzeng, E., Hoffman, J., Saenko, K., Darrell, T.: Adversarial discriminative domain adaptation. In: CVPR (2017) 5
+81. Wang, F., Cheng, J., Liu, W., Liu, H.: Additive margin softmax for face verification. SPL (2018) 1
+82. Wang, F., Xiang, X., Cheng, J., Yuille, A.L.: NormFace: L2 hypersphere embedding for face verification. In: ACMMM (2017) 1
+83. Wang, H., Wang, Y., Zhou, Z., Ji, X., Gong, D., Zhou, J., Li, Z., Liu, W.: CosFace: Large margin cosine loss for deep face recognition. In: CVPR (2018) 1
+84. Wang, X., Zhang, S., Wang, S., Fu, T., Shi, H., Mei, T.: Mis-Classified vector guided softmax loss for face recognition. In: AAAI (2020) 1
+85. Wang, X., Li, Y., Zhang, H., Shan, Y.: Towards real-world blind face restoration with generative facial prior. In: CVPR (2021) 2
+86. Wen, Y., Zhang, K., Li, Z., Qiao, Y.: A discriminative feature learning approach for deep face recognition. In: ECCV (2016) 1
+87. Whitelam, C., Taborsky, E., Blanton, A., Maze, B., Adams, J., Miller, T., Kalka, N., Jain, A.K., Duncan, J.A., Allen, K., et al.: Iarpa janus benchmark-B face dataset. In: CVPRW (2017) 9, 13
+88. Xiao, T., Hong, J., Ma, J.: Elegant: Exchanging latent encodings with GAN for transferring multiple face attributes. In: ECCV (2018) 4
+89. Yang, S., Luo, P., Loy, C.C., Tang, X.: Wider face: A face detection benchmark. In: CVPR (2016) 9, 13
+90. Yang, T., Ren, P., Xie, X., Zhang, L.: GAN prior embedded network for blind face restoration in the wild. In: CVPR (2021) 2
+91. Yin, X., Yu, X., Sohn, K., Liu, X., Chandraker, M.: Towards large-posed face frontalization in the wild. In: ICCV (2017) 4
+92. Zhao, J., Xiong, L., Li, J., Xing, J., Yan, S., Feng, J.: 3D-aided dual-agent GANs for unconstrained face recognition. TPAMI (2018) 4
+
+93. Zheng, Y., Pal, D.K., Savvides, M.: Ring loss: Convex feature normalization for face recognition. In: CVPR (2018) 1
+94. Zhu, X., Lei, Z., Liu, X., Shi, H., Li, S.Z.: Face alignment across large poses: A 3D solution. In: CVPR (2016) 2
+95. Zhu, Z., Huang, G., Deng, J., Ye, Y., Huang, J., Chen, X., Zhu, J., Yang, T., Lu, J., Du, D., et al.: WebFace260M: A benchmark unveiling the power of million-scale deep face recognition. In: CVPR (2021) 1, 12
\ No newline at end of file
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/images.zip b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cd45c089990d7d863cc07db93ff4025c737fb74f
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a17005644936c50cbdd478e194db4efa7f35ef1f6a20ff545990362092de9b47
+size 607366
diff --git a/controllableandguidedfacesynthesisforunconstrainedfacerecognition/layout.json b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7c5f1f777d15da80bb71bd7f8510ffda04121fb0
--- /dev/null
+++ b/controllableandguidedfacesynthesisforunconstrainedfacerecognition/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:46c69ea500e3a84cbb84826b1f711d64a72b918383714886569c7cf1ac845424
+size 526880
diff --git a/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_content_list.json b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7c3ace2c564605568a45a5cffd4ef8b2f41332c3
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7316d709cfe8f7a3ba0c7cb1c82ca93c8ecc43a445ef16d88ef75ca8d526b22
+size 72663
diff --git a/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_model.json b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..223544fe4919c5002460ee9b06bf0412dee2ff10
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b28b9eaafbcab79fab530e3e421e96c13ea7b583e7310d2950bc96df9f340a8b
+size 92037
diff --git a/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_origin.pdf b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4779537977897ca1b81062e8460d82b68fdae579
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/500e74c9-5e27-4d2a-bacd-5b0ab37f7a0c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:65e94a226c791f1cdf8d72913653c625b293ba6fad1d4e99a74692130e2bee90
+size 8839023
diff --git a/controllableshadowgenerationusingpixelheightmaps/full.md b/controllableshadowgenerationusingpixelheightmaps/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..644ae967f90d1d0f45d8c7cadedf79d7006bf006
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/full.md
@@ -0,0 +1,293 @@
+# Controllable Shadow Generation Using Pixel Height Maps\*
+
+Yichen Sheng\*, Yifan Liu\*, Jianming Zhang, Wei Yin, A. Cengiz Oztireli, He Zhang, Zhe Lin, Eli Shechtman, and Bedrich Benes
+
+$^{1}$ Purdue University $^{2}$ University of Adelaide
+
+$^{3}$ Adobe Research $^{4}$ University of Cambridge
+
+Abstract. Shadows are essential for realistic image compositing from 2D image cutouts. Physics-based shadow rendering methods require 3D geometries, which are not always available. Deep learning-based shadow synthesis methods learn a mapping from the light information to an object's shadow without explicitly modeling the shadow geometry. Still, they lack control and are prone to visual artifacts. We introduce "Pixel Height", a novel geometry representation that encodes the correlations between objects, ground, and camera pose. The Pixel Height can be calculated from 3D geometries, manually annotated on 2D images, and can also be predicted from a single-view RGB image by a supervised approach. It can be used to calculate hard shadows in a 2D image based on the projective geometry, providing precise control of the shadows' direction and shape. Furthermore, we propose a data-driven soft shadow generator to apply softness to a hard shadow based on a softness input parameter. Qualitative and quantitative evaluations demonstrate that the proposed Pixel Height significantly improves the quality of the shadow generation while allowing for controllability.
+
+# 1 Introduction
+
+Shadow generation is an important step for image composting that enhances photo realism and adds positional and directional cues for the composed objects. Advanced image editing techniques enable composing objects into a new background with accurate segmentation and matting [23] and harmonization of color styles [17]. However, the composited objects are not realistic if no matching shadows are synthesized (see the 1st and 3rd images in the second row in Fig. 1). Manually creating a perceptually plausible shadow for a 2D object is tedious, even for an experienced artist, especially for extended (linear or area) light sources.
+
+Mature techniques that calculate soft shadows for 3D scenes exist [6,26]. However, 3D shape information is often unavailable when we composite objects from real images. Recent deep learning advancements brought significant progress to shadow generation in 2D images. A series of methods [14,21,45]
+
+
+Fig. 1. Controllable shadow generation with the proposed method. First row: With the help of our new introduced Pixel Height of an object, users can control the position and the softness of the generated shadows. Second row: The composited images with our generated shadows (2nd and 4th) are much more natural than the direct composites (1st and 3rd).
+
+based on generative adversarial networks (GANs) have been proposed to automatically generate shadows by training with pairs of shadow and shadow-free images. These methods mainly focus on generating hard shadows, and the final results are not editable. Moreover, these methods require the background scene to implicitly provide light information, while in many application scenarios, objects are either composited on abstract or pure color background. Also, shadow editing needs to be applied on separate image layers with background images missing or incomplete at the time of editing. Therefore, shadow generation for object cutouts with user control is more suited for professional image editing workflows. Recently, Sheng et al. [36] proposed to learn a mapping from a 2D cutout of the object to the corresponding soft shadows based on a controllable lightmap and achieved promising results. However, due to the lack of geometry guidance, this method cannot generalize well for varying scenes and may lead to visible artifacts in the generated shadows.
+
+We introduce a controllable and editable shadow generation method for 2D object cutouts. We introduce Pixel Height, a new 2.5D shape representation for an image to provide geometry guidance. The Pixel Height is defined as the pixel distance between a point on an object and its footpoint, namely its vertical projection on the ground in the image (see Fig. 2-(a)). Based on Pixel Height, we can explicitly compute the shadow point based on projective geometry. The Pixel Height could be measured and annotated on a 2D image or calculated from synthetic data with 3D object models. Similar to monocular depth estimation, Pixel Height can also be estimated from a single RGB image by a data-driven method. We collect synthetic and real annotated data (see Fig. 2-(b) and (c)) to train a Pixel Height map prediction model for object cutouts.
+
+Given the annotated or predicted Pixel Height map of an object, we render a hard shadow based on the position of the horizon and the point light in the 2D image space with a proposed hard shadow renderer. To add softness to the shadow, we learn an efficient and controllable mapping from the hard shadow to the soft shadows based on a softness parameter using a soft shadow generator. As shown in Fig. 1, our system can generate varying shadow maps controlled by
+
+the light source position and the softness control. Our method explicitly models the shadow geometry that is more controllable and robust than methods that directly predict shadows based on an image background or a light map.
+
+
+Fig.2. Pixel Height. (a). The number of pixels between point $A_{i}$ and $B_{i}$ is the Pixel Height for point $A_{i}$ . We collected two datasets with Pixel Height annotation: Synthetic60K and Real1500. (b) shows the sample data with various poses from 3D models. (c) shows samples of the sparsely labeled data and the interpolated Pixel Height map. Note that every Pixel Height map is divided by its max-height value for visualization.
+
+
+
+
+
+We conduct extensive experiments to show that the Pixel Height map improves the controllability of shadow generation. Realistic shadows are synthesized by easy and intuitive user control given the RGB image and an object segmentation mask. Qualitative and quantitative results demonstrate that our method generates higher quality shadows than previous interactive and automatic shadow generation algorithms in 2D images. Our main contributions are:
+
+- A formulation of hard shadow rendering in images based on a novel geometry representation, Pixel Height, which can be manually labeled or predicted by a model from a single image.
+- A controllable shadow generation framework, where users control the position and softness of an object shadow. The framework consists of a Pixel Height estimation, a hard shadow renderer and a soft shadow generator.
+- Extensive evaluation and analysis, showing improved quality and controllability of our proposed Pixel Height based shadow synthesis method.
+
+# 2 Related Work
+
+Shadow rendering in graphics. Shadow rendering based on 3D geometries is a well-studied technique in computer graphics. In real-time rendering, shadow volume [2,34] and shadow map based rendering techniques are mainstream approaches [7,28,35,41]. The soft shadow is approximated either by blurring the hard shadow boundaries [1,4,8,11,12,38] or weighted sum of a set of hard shadows
+
+sampling on an area or volume light source [6]. Many works [9,24,26] have been proposed to speed up this sampling process by adjusting the density and the weight. Besides, some simplified geometries [10,30] or light representations [13] are proposed to render shadows in real-time. Global illumination algorithms [5,18,25,37,40] render soft shadows implicitly. Such methods can render realistic shadows for complicated objects given accurate 3D object models. However, 3D models are not always available for objects in real images, especially in image compositing tasks in computer vision.
+
+Shadow synthesis with deep learning. In recent years, generative adversarial networks (GANs) have achieved significant improvements on image translation tasks [16,22]. A series of works [14,15,21,45,39] have been introduced for generating shadows directly from a composited shadow-free image based on the object mask guidance. ARShadowGan [21] renders a dataset by inserting 3D objects into real background images with augmented reality. Hong et al. [14] generate the shadow-free images by removing the shadow region from the real-world images. These methods try to predict the style and the color of the final shadow by a data-driven method, but they cannot provide controllability for the user.
+
+Sheng et al. [36] propose an interactive soft shadow generation network based on a user-provided lightmap. Physics-based methods on 3D object models render their training data. The network is trained to learn the mapping from the 2D object cutout and environment lightmap to the soft shadow maps. Contrary to the previous works, we generate soft shadows by first generating a hard shadow and converting it to a soft shadow using a softness input parameter. This hard-to-soft transformation is much easier to learn. The hard shadow can be obtained with our proposed pixel-height map by calculating the occlusion directly in the 2D projection space with a simple shadow projection model.
+
+Geometry representation. Similar to monocular depth estimation [33], recovering Pixel Height map from a single image is an ill-posed problem. Numerous methods [20,43,44] exist to estimate depth from a single view image by supervised methods. As the depth is a 2.5D representation, the intrinsic camera parameters are required for recovering the 3D shape of the object. The 3D point cloud [29] is another geometry representation for 3D objects' shape. They can be captured by special scanners, recovered from multi-view images, but cannot be labeled directly just from a monocular image. Furthermore, methods [31,32] have been proposed to directly recover the 3D shape, especially for humans from a monocular image. The proposed Pixel Height map is a new geometry representation, which reflects the correlation among the object, shadow receiver, and camera pose. It is easier to interpret and annotate, and it is useful for applications that require explicit occluder-receiver constraints such as shadow generation.
+
+# 3 Method
+
+We propose a new approach to generate perceptually plausible soft shadows on 2D images without 3D object models. The key idea of our approach is to render the object's hard shadow from a point light in the image plane following
+
+a simplified projective geometry constraint (see Sec. 3.1), and then synthesize the corresponding soft shadow based on the hard shadow using a data-driven approach (see Sec. 3.3).
+
+
+Fig.3. Given a 2D foreground image and its Pixel Height map, a user can control the position and the softness of the generated shadow by the user-defined light information or the existing image-based light information. The Pixel Height map can be manually annotated on images or predicted from a single image by training a model.
+
+We need to know the shape of the object and its relationship with the shadow receiver and the camera to render a hard shadow on the image plane. A new geometry representation Pixel Height is proposed to represent the object shape in 2D images, which is essential to rendering the hard shadow. We verify that this representation can be estimated by a data-driven approach (see Sec. 3.2).
+
+As shown in Fig. 3, given the foreground object image and its mask, we can annotate or estimate its Pixel Height map. The hard shadow's position and shape can be determined by the controllable light information (the sun position) and the ground (the horizon line). Finally, based on the hard shadow, the soft shadow generator can produce a perceptually pleasing soft shadow according to the softness control parameter. The user could provide all the controllable variables with a simple GUI (see the supplementary videos), but they can also be potentially estimated from the background image.
+
+# 3.1 Hard Shadow Renderer in 2D Image
+
+This section introduces our novel hard shadow rendering method based on the following assumptions: (1) images are upright, and the vertical lines are parallel. This corresponds to the one-point perspective or the two-point perspective, which is very common, and (2) the light source is a point light and is always above ground. Note that if the first assumption does not exactly hold, the generated hard shadow will be slightly distorted, but still a good approximation.
+
+A simple example of the projective geometry following our assumptions is shown in Fig. 4. Given an object $A'B'$ that stands vertically on the ground and a point light source $P'$ , the object's shadow is then cast to $B'C'$ . Given an image
+
+
+(a)
+
+
+
+
+(c)
+Fig. 4. Hard shadow renderer using Pixel Height representation. (a) shows the camera model, where $A'B'$ is the object standing upright on the ground, $P'$ is the point light source and $C'$ is the shadow point of $A'$ . (b) and (c) show two typical cases of the projection of the light, the object, and its shadow on the image plane. $D$ is the perpendicular feet of $P$ . The intersection point $C$ of $DB$ and $PA$ is a projection of the shadow point $C'$ . The 3D collinear property in the shadow geometry is preserved after being projected to the image plane.
+
+plane, the light source, the object, and the shadow are projected to $P$ , $AB$ , and $BC$ , respectively. The point $D'$ is the perpendicular footpoint of the light, which is projected to $D$ . Note that $P'$ , $A'$ and $C'$ are always collinear; and $C'$ , $B'$ and $D'$ are always co-linear. Thus, the projections of these points are also collinear in the image plane. For a non-planar shadow receiver, e.g. a wall, a similar collinear condition still holds except that the shadow point $C'$ will be above the ground, and it will have its footpoint. For simplicity, we study the special case where the shadow receiver is the ground plane in the following. A more general formulation can be found in the supplementary material.
+
+Fig. 4 (b) and (c) show the image plane and the relevant variables. We define the upper left corner of the image as the origin of the coordinate system. The light $P$ and its projected perpendicular footpoint $D$ are located at $(x_p, y_p)$ and $(x_p, y_p + H)$ respectively, where $H$ is the pixel distance between $P$ and its footpoint, and we call it the Pixel Height of the light. Similarly, the object point $A$ , its footpoint $B$ and its shadow point $C$ are located at $(x_a, y_a)$ , $(x_a, y_a + h)$ and $(x_c, y_c)$ , where $h$ is the Pixel Height of $A$ .
+
+According to the triangle similarity in Fig. 4-(b) and Fig. 4-(c), we have
+
+$$
+\frac {h}{H} = \frac {C N}{C M} = \frac {x _ {c} - x _ {a}}{x _ {c} - x _ {p}} = \frac {A N}{P M} = \frac {y _ {c} - y _ {a}}{y _ {c} - y _ {p}}. \tag {1}
+$$
+
+The shadow point $C$ can be derived from $(x_{a},y_{a},h)$ and $(x_{p},y_{p},H)$ by
+
+$$
+C = \left[ x _ {c}, y _ {c} \right] = \frac {1}{H - h} \left[ H x _ {a} - h x _ {p}, H y _ {a} - h y _ {p} \right]. \tag {2}
+$$
+
+Note that $H$ may take a positive or a negative value. A negative value of $H$ indicates that the light is behind the camera, and the shadow will be cast away from the camera (see Fig. 4-(c)). Note that the derived $C$ may not exist. For example, when $h > H > 0$ , the ray $\overrightarrow{PA}$ will not intersect with the ground. In this case, the derived $C$ is actually the ground intersection point in the opposite direction of the ray. There is a special case when the light is infinity, and its footpoint is on the horizon. Let $Z$ denote the y coordinate of the horizon. In this case, we can replace $H$ with $Z - y_{p}$ in Eq. 2, and control the perspective of the shadow using the horizon line (see Fig. 9).
+
+The above formulation describes how the shadow geometry is derived for our Pixel Height representation. For generic scenarios, the Pixel Height map of the shadow receiver needs to be provided, and the shadow map can be calculated by checking the collinear conditions similar to the ones mentioned above. We implemented the rendering algorithm for generic shadow receivers using CUDA. Please refer to supplementary materials for details. The visibility of the pixels on the shadow receiver can be computed in $20~\mathrm{ms}$ for a $512\times 512$ image.
+
+# 3.2 Pixel Height Map Estimation
+
+A Pixel Height map is a 2.5D representation similar to a depth map. Different from the depth map, the Pixel Height map uses the ground plane as a world frame reference to locate the object. It captures the object-ground relation so that the contact points and the uprightness of the object are explicitly enforced. In addition, Pixel Height map is measurable in the image space and can be annotated manually. In contrast, traditional 2.5D representations like depth are challenging to annotate from a single image. Objects reconstructed from a depth map can also be tilted if the camera intrinsic parameters are unknown.
+
+The proposed Pixel Height representation is essential to the hard shadow rendering in a 2D image, and can be useful in other applications as well. In this section, we propose several methods to obtain the Pixel Height map.
+
+Calculated from 3D geometries. Given a 3D geometry and camera parameters, the Pixel Height map can be computed by calculating the projection of the distance between each projected point and its footpoint. Fig. 2-(b) illustrates the rendererd RGB image and its Pixel Height map. With an accurate Pixel Height map, the proposed approach can render realistic soft shadows in real-time and generate visually comparable results with the renderings from a physics-based renderer (see Fig. 7).
+
+Labeled from 2D images. The Pixel Height could also be annotated from a real RGB image by experienced annotators. Annotators are required to label sparse points on the object masks. For each point, its perpendicular footpoint on the ground is annotated. Thus, the Pixel Height could be calculated by the distance along the y-axis. Bi-linear interpolation is employed to get the dense Pixel Height map for the object of interest. Although the interpolation method is not physically correct, the generated hard shadows with the interpolated dense Pixel Height maps are perceptually pleasing. Fig. 2-(c) illustrates the sparsely labeled RGB images and interpolated Pixel Height maps.
+
+
+Fig. 5. The training set for the soft shadow generator. a) the mask of the object. b) the hard shadow of the object. Figures c)-f) show the soft shadows and visualized light maps at different levels of softness. Softness models the size of the light source.
+
+Estimated from 2D images. Similar to the monocular depth estimation [33], estimating the Pixel Height from a single view image is an ill-posed problem. We verify that the Pixel Height could be estimated from a single view image. We propose a neural network for estimating humans' Pixel Height. The input to the network is the concatenation of the foreground image, the object mask, and a Y-Coordinate Map (YCM). We normalize the YCM by setting the lowest point in the object mask to be zero. Pixel Height map estimation is a high-level prediction problem, and the network should encode global information to get a better understanding of the geometry of the object. We employ an off-the-shelf transformer backbone, Mix Transformer encoder (MiT) [42]. A simple decoder merges features from different scales. The network's output is a one-channel Pixel Height map. For the training, We minimize the mean square error for each pixel inside the object mask between the prediction and the ground truth Pixel Height map. A total variation loss is used to regularize the prediction.
+
+We use a synthetic dataset consisting of $60K$ renderings of 3D human models with various poses. We name this dataset Synthetic60K. To improve the model's generalization on real images, 1,500 real images are collected and sparsely annotated to build a benchmark named Real1500. We used 1,000 (500) images as the training (validation set). The ground truth Pixel Height of Synthetic60K and Real1500 are generated based on the methods described earlier in this section. We merge the Synthetic60K and the Real1500 training set to train a Pixel Height Estimation Network (HENet). Each mini-batch is evenly sampled from the two datasets. More implementation details about the training are in the supplementary materials.
+
+# 3.3 Soft Shadow Generator
+
+With the Pixel Height map and the proposed hard shadow renderer, a hard shadow map can be generated given a point light position in the image. To add softness to the shadow, we train a soft shadow generator to create the effect of an area light and control the softness based on user input.
+
+Data generation. The soft shadows are generated following the pipeline in the Soft Shadow Network (SSN) [36]. They divided the location of the light into grids, and then randomly sampled an environment light map based on a 2D Gaussian distribution at one random grid. Soft shadow bases are generated
+
+by merging the hard shadows of a local patch for each grid. The hard shadow is generated by a GPU-based render with 3D models. Soft shadow based on the environment lightmap will be the weighted sum for the shadow bases. SSN enforces the network to learn a mapping from the lightmap and the soft shadow, which is very complicated. Different from their method, we want to render a soft shadow based on the hard shadow and a pre-define softness. To get our training samples, for each soft shadow and its paired environment lightmap, we find the corresponding hard shadow and the softness from the lightmap. The hard shadow is rendered with a given point light, which locates at the center of the area light. The softness is defined as the size of the Gaussian which is used to generate the lightmap. Fig. 5 illustrates that an environment lightmap can be represented as a hard shadow and a softness value. Finally, we get our training triplet (hard shadow, soft shadow, and softness) on the fly during training.
+
+Network structure. The soft shadow generator (SSG) is a variant of the U-Net. Similar to the shadow render in SSN [36], the encoder of the network is composed of a series of $3 \times 3$ convolution layers. Skip connections are employed to capture the low-level features. SSN [36] estimates the soft shadow based on the object mask and the environment lightmap. It requires the network to learn a complex mapping between the object shadow and the light source. In contrast, we use a physical model to render the hard shadow in 2D space (described in Sec. 3.1). The input of the encoder network is the concatenation of the mask and the hard shadow. To inject a softness control into the network, we uniformly discretize the continuous softness into multiple bins in the log space and then sampled a soft Gaussian distribution on these bins following [3,44]. Thus, a softness value can be represented by an embedding with a fixed dimension. Following [19], the adaptive instance normalization is then employed in the decoder to take the softness embedding for the softness control. The training details follow [36].
+
+# 4 Experiments and Evaluation
+
+Our system consists of several key components: the Height Estimation Network (HENet), the Hard Shadow Renderer (HSR), and the Soft Shadow Generator (SSG). We first validate the effectiveness of HENet on human images and then the soft shadow quality from SSG. Finally, a user study and qualitative comparisons are conducted to evaluate our full system on real images.
+
+HENet is trained to predict the Pixel Height for human images in our current implementation. In the following experiments, unless otherwise specified, the Pixel Height maps for humans are predicted by our HENet. The Pixel Height maps for other general objects are manually labeled. The average labeling time for one object is about two minutes.
+
+# 4.1 Evaluation of HENet
+
+We conduct ablation studies on the proposed components to estimate the Pixel Height map. The network is trained on the merged dataset of Synthetic60K and
+
+Table 1. Effectiveness of each components in predicting the Pixel Height. YCM: using normalized Y-coordinate Map as input. Real: training on the real and synthetic data. $\ell_{tv}$ : training with the total variation loss. The metrics are evaluated on the sparse points labelled by annotators on natural images. Base: Employing Y-Coordinate Map as the Pixel Height.
+
+ | YCM | Real | ℓtv | Abs ↓ | rel ↓ |
| Base | | | | 10.84 | 3.64 |
| a | ✓ | ✓ | | 6.12 | 2.01 |
| b | | ✓ | ✓ | 6.04 | 1.98 |
| c | ✓ | | ✓ | 7.05 | 2.34 |
| d | ✓ | ✓ | ✓ | 5.92 | 1.94 |
+
+
+(a)
+
+
+
+
+(b)
+Fig.6. For the input image without shadow (a) we use the Y-Coordinate Map to replace the Pixel Height map in our system (b). It can not handle the foot contact with the ground properly. Based on our predicted Pixel Height map, the shadow in the foot contact area is more realistic (c).
+
+
+
+
+(c)
+
+the Real1500 training set. The results are evaluated on the sparse points labeled by annotators of the Real1500 validation set. In Tab. 1, the evaluation results show that adding the Y-Coordinate Map (YCM) and using the total variation loss $(\ell_{tv})$ can both reduce the error. Moreover, training on the merged dataset can significantly improve the model's generalization ability, reducing the relative error from $2.34\%$ to $1.82\%$ . We also list the evaluation results of the baseline to verify that HENet does not just learn a trivial identity mapping of the YCM. As shown in Fig. 6, using the YCM instead of the Pixel Height map can not generate the correct shadow in the foot contact area.
+
+# 4.2 Evaluation of SSG
+
+Instead of implicitly learning a mapping from the light source to a shadow [36], our SSG only focuses on adding softness to the hard shadow based on a controllable input scalar. We build an evaluation benchmark to evaluate the model. We used 20 new assets of 3D models that have no overlap with the training set, and they are collected from the Internet. For each new asset, we uniformly sample $4 \times 66$ positions of the light source and divide them into three groups on average based on the length of the generated shadows, named as 'Short', 'Medium', and
+
+
+GT
+
+
+SSN
+
+
+SSG
+(a)
+
+
+
+
+
+
+(b)
+(c)
+Fig. 7. Comparison between our proposed SSG, SSN [36] and synthetic ground truth based on 3D models. (a) The direction of the shadow is more accurate as a hard shadow is given. (b) SSN may fail to generate a long hard shadow. (c-d) Both methods perform well on soft shadows. The shadows from SSG are comparable to the physics-based renderer.
+
+
+
+
+
+
+
+
+
+
+
+
+(d)
+
+'Long'. For each position, 9 types of softness are sampled. The evaluation benchmark is also divided into 'Soft', 'Medium', and 'Hard' based on the softness. The ground truth shadows are rendered with Mitsuba with 3D models. The evaluation metrics include the average of the pixel-level absolute error (Abs) and the zero normalized cross-correlation (ZNCC). The first one evaluates the pixel-level error, and the second one considers the similarity of the shape.
+
+Results. The evaluation results are shown in Tab. 2. On average, the proposed SSG outperforms SSN on both evaluation metrics, improving Abs and ZNCC by $27\%$ and $112\%$ , respectively. For hard shadows, the proposed SSG reduces the Abs error of SSN from 0.039 to 0.025, and increases the ZNCC from 0.198 to 0.761. The SSN performs slightly better on 'Short' shadows according to the Abs, indicating that directly learning the mapping has some advantage in those cases. Still, it gets unstable for generating long and hard shadows due to the lack of model capacity in long-distance geometric modeling. Samples of visualization results are shown in Fig. 7. SSN may produce inaccurate direction of the shadow based on the given lightmap as shown in Fig. 7-(a). The errors on harder shadows are more apparent, and people are less sensitive to the difference in soft shadows.
+
+Table 2. Quantitative evaluation. Abs: pixel-level absolute error. ZNCC: zero normalized cross-correlation. The ground truth shadows are rendered with Mitsuba given 3D shapes. On average, our proposed SSG outperforms SSN [36]. The quality of the 'Long' shadow and the 'Hard' shadow is improved with a larger margin.
+
+ | Mean Abs | Mean ZNCC |
| SSN [36] | 0.033 | 0.370 |
| Ours | 0.024 | 0.788 |
| Abs ↓ | ZNCC ↑ |
| Length | Long | Medium | Short | Long | Medium | Short |
| SSN [36] | 0.041 | 0.029 | 0.031 | 0.330 | 0.311 | 0.437 |
| Ours | 0.028 | 0.012 | 0.033 | 0.743 | 0.883 | 0.725 |
| Softness | Hard | Medium | Soft | Hard | Medium | Soft |
| SSN [36] | 0.039 | 0.034 | 0.024 | 0.198 | 0.336 | 0.606 |
| Ours | 0.025 | 0.028 | 0.017 | 0.761 | 0.779 | 0.834 |
+
+Table 3. User study on natural images. In a 2AFC study the users chose the more realistic image from a pair. The results indicate that $74\%$ of users perceived the shadows generated by our algorithm as more realistic.
+
+| Rate | Length | Softness | Mean |
| Long | Medium | Short | Hard | Medium | Soft |
| SSN | 0.27 | 0.22 | 0.35 | 0.20 | 0.29 | 0.31 | 0.26 |
| SSG | 0.73 | 0.78 | 0.65 | 0.80 | 0.71 | 0.69 | 0.74 |
+
+# 4.3 Full System Evaluation
+
+We qualitatively evaluated our entire system on natural images. Specifically, we performed a user study, where we asked human subjects to compare the perceived visual quality of the generated shadows from our method and SNN.
+
+We conducted a user study on the shadows generated for 2D natural images. For SSN, the shadow is rendered with the cutout of the object and an interactive light source. For our method, the shadow is rendered with an interactive interface with shadow position and softness controls (see the video demo in our supplementary materials). We prepared 24 shadow pairs mimicking the effect of different lengths and softness. We have shown pairs of images in random order and random position (left-right) to 50 users (80% males and 20% females) and asked the participants which of the two images looks more realistic. Tab. 3 shows that 74% of the users perceived the shadows rendered with our method as more realistic, especially for long and hard shadows (see Fig. 8).
+
+# 5 Discussions
+
+Controllability. Our system based on Pixel Height improves the controllability of the shadow synthesis. A demo video of our simple GUI is in the supplementary materials, enabling users to change the direction of the shadow by a simple click on the preferred position, similar to the method presented in [27]. Our method also allows the control of the shadow shape using the horizon line, mimicking
+
+
+Fig. 8. Samples images from our user study. Our results have clearer shapes on hard shadows and less artifact on long shadows compared with SSN [36].
+
+
+Fig. 9. Controllability. We can mimic the shadow effect for different camera poses by changing the horizon line.
+
+the perspective effect from a camera (see Fig. 9). The softness is controlled by a slider. Fig. 10 shows some example results generated from our GUI using height maps obtained from different approaches. Fig. 11 shows a case where the object's shadow is cast on a complex shadow receiver with a floating effect. Our method can also be applied on animated objects. Please check out our supplementary materials for more examples.
+
+Potential applications of the Pixel Height map. Pixel Height map can also be used to generate reflection effects. A slightly modified checking condition is used to compute the correspondence between a point and its reflection on the ground. We demonstrate this in the supplementary material.
+
+# 6 Conclusion
+
+We proposed an approach for generating controllable perceptually plausible shadows based on the Pixel Height map. The new geometry representation, Pixel Height map, encodes the correlations among objects shape, camera pose, and the ground. It can be directly labeled or estimated from 2D images. The position and softness is controlled in an easy interactive way. Qualitative and quantitative comparisons demonstrate the results and generalization ability of the proposed
+
+
+(a)
+
+
+Fig. 10. Given a Pixel Height map, our method can produce realistic shadows with desired position and softness. The Pixel Height map can be calculated from 3D models, manually annotated or predicted by HENet. (a) Hard shadow mask. (b) Softness is 0.05. (c) Softness is 0.4.
+(a)
+(b)
+(c)
+(d)
+Fig. 11. Shadow generation for a floating object and a complex shadow receiver. (a) and (c) show that hard shadows can be cast on a non-planar shadow receiver using the Pixel Height map of background as input. Our hard shadow renderer can also render shadows for floating objects by simply adding a shift value to the Pixel Height map of the object. (b) and (d) show the corresponding soft shadow generated by SSG.
+
+method outperforms previous deep learning-based shadow generation methods. However, our Pixel Height map representation only considers the frontal surface of the object. A thickness is worth future exploration to address the problem.
+
+Acknowledgment Most of the work was done during Yifan and Yichen's internship at Adobe. This work was also supported by a UKRI Future Leaders Fellowship [grant number G104084]. We thank Dr. Zhi Tian for the discussions.
+
+# References
+
+1. Annen, T., Dong, Z., Mertens, T., Bekaert, P., Seidel, H.P., Kautz, J.: Real-time, all-frequency shadows in dynamic scenes. ACM TOG 27(3), 1-8 (2008) 3
+2. Assarsson, U., Akenine-Möller, T.: A geometry-based soft shadow volume algorithm using graphics hardware. ACM TOG 22(3), 511-520 (2003) 3
+3. Cao, Y., Wu, Z., Shen, C.: Estimating depth from monocular images as classification using deep fully convolutional residual networks. IEEE TCSVT 28(11), 3174-3182 (2017) 9
+4. Chan, E., Durand, F.: Rendering fake soft shadows with smoothies. In: Rendering Techniques. pp. 208-218. Citeseer (2003) 3
+5. Cook, R.L., Porter, T., Carpenter, L.: Distributed ray tracing. In: ACM SIGGRAPH. pp. 137-145 (1984) 4
+6. Crow, F.C.: Shadow algorithms for computer graphics. ACM SIGGRAPH 11(2), 242-248 (1977) 1, 4
+7. Donnelly, W., Lauritzen, A.: Variance shadow maps. In: Proceedings of the 2006 symposium on Interactive 3D graphics and games. pp. 161-165 (2006) 3
+8. Fernando, R.: Percentage-closer soft shadows. In: ACM SIGGRAPH, pp. 35-es (2005) 3
+9. Franke, T.A.: Delta voxel cone tracing. In: 2014 IEEE International Symposium on Mixed and Augmented Reality (ISMAR). pp. 39-44. IEEE (2014) 4
+10. Fuchs, H., Goldfeather, J., Hultquist, J.P., Spach, S., Austin, J.D., Brooks Jr, F.P., Eyles, J.G., Poulton, J.: Fast spheres, shadows, textures, transparencies, and image enhancements in pixel-planes. ACM SIGGRAPH 19(3), 111-120 (1985) 4
+11. Guennebaud, G., Barthe, L., Paulin, M.: Real-time soft shadow mapping by backprojection. In: Rendering techniques. pp. 227-234 (2006) 3
+12. Guennebaud, G., Barthe, L., Paulin, M.: High-quality adaptive soft shadow mapping. In: Computer Graphics Forum. vol. 26, pp. 525-533. Wiley Online Library (2007) 3
+13. Heitz, E., Dupuy, J., Hill, S., Neubelt, D.: Real-time polygonal-light shading with linearly transformed cosines. ACM TOG 35(4), 1-8 (2016) 4
+14. Hong, Y., Niu, L., Zhang, J., Zhang, L.: Shadow generation for composite image in real-world scenes. arXiv preprint arXiv:2104.10338 (2021) 1, 4
+15. Hu, X., Jiang, Y., Fu, C.W., Heng, P.A.: Mask-shadowgan: Learning to remove shadows from unpaired data. In: ICCV. pp. 2472-2481 (2019) 4
+16. Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: CVPR. pp. 1125-1134 (2017) 4
+17. Jiang, Y., Zhang, H., Zhang, J., Wang, Y., Lin, Z., Sunkavalli, K., Chen, S., Amirghodsi, S., Kong, S., Wang, Z.: Ssh: A self-supervised framework for image harmonization. In: ICCV. pp. 4832-4841 (2021) 1
+18. Kajiya, J.T.: The rendering equation. In: ACM SIGGRAPH. pp. 143-150 (1986) 4
+19. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: CVPR. pp. 4401-4410 (2019) 9
+20. Li, Z., Snavely, N.: Megadepth: Learning single-view depth prediction from internet photos. In: CVPR. pp. 2041-2050 (2018) 4
+21. Liu, D., Long, C., Zhang, H., Yu, H., Dong, X., Xiao, C.: Arshadowgan: Shadow generative adversarial network for augmented reality in single light scenes. In: CVPR. pp. 8139-8148 (2020) 1, 4
+
+22. Liu, Y., Qin, Z., Wan, T., Luo, Z.: Auto-painter: Cartoon image generation from sketch by using conditional Wasserstein generative adversarial networks. Neurocomputing 311, 78-87 (2018) 4
+23. Lu, H., Dai, Y., Shen, C., Xu, S.: Indices matter: Learning to index for deep image matting. In: ICCV. pp. 3266-3275 (2019) 1
+24. Mehta, S.U., Wang, B., Ramamoorthi, R.: Axis-aligned filtering for interactive sampled soft shadows. ACM TOG 31(6), 1-10 (2012) 4
+25. Ng, R., Ramamoorthi, R., Hanrahan, P.: All-frequency shadows using non-linear wavelet lighting approximation. In: ACM SIGGRAPH, pp. 376-381 (2003) 4
+26. Öz Tireli, A.C.: Integration with stochastic point processes. ACM TOG 35(5), 1-16 (2016) 1, 4
+27. Pellacini, F., Tole, P., Greenberg, D.P.: A user interface for interactive cinematic shadow design. ACM TOG 21(3), 563-566 (2002) 12
+28. Reeves, W.T., Salesin, D.H., Cook, R.L.: Rendering antialiased shadows with depth maps. In: ACM SIGGRAPH. pp. 283-291 (1987) 3
+29. Remondino, F.: From point cloud to surface: the modeling and visualization problem. International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences 34 (2003) 4
+30. Ren, Z., Wang, R., Snyder, J., Zhou, K., Liu, X., Sun, B., Sloan, P.P., Bao, H., Peng, Q., Guo, B.: Real-time soft shadows in dynamic scenes using spherical harmonic exponentiation. In: ACM SIGGRAPH, pp. 977-986 (2006) 4
+31. Saito, S., Huang, Z., Natsume, R., Morishima, S., Kanazawa, A., Li, H.: Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. ICCV (2019) 4
+32. Saito, S., Simon, T., Saragih, J., Joo, H.: Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3d human digitization. In: CVPR (June 2020) 4
+33. Saxena, A., Chung, S.H., Ng, A.Y., et al.: Learning depth from single monocular images. In: NeurIPS. vol. 18, pp. 1-8 (2005) 4, 8
+34. Schwarz, M., Stamminger, M.: Bitmask soft shadows. In: Computer Graphics Forum. vol. 26, pp. 515-524. Wiley Online Library (2007) 3
+35. Sen, P., Cammarano, M., Hanrahan, P.: Shadow silhouette maps. ACM TOG 22(3), 521-526 (2003) 3
+36. Sheng, Y., Zhang, J., Benes, B.: SSN: Soft shadow network for image compositing. In: CVPR. pp. 4380-4390 (2021) 2, 4, 8, 9, 10, 11, 12, 13
+37. Sillion, F.X., Arvo, J.R., Westin, S.H., Greenberg, D.P.: A global illumination solution for general reflectance distributions. In: ACM SIGGRAPH. pp. 187-196 (1991) 4
+38. Soler, C., Sillion, F.X.: Fast calculation of soft shadow textures using convolution. In: ACM SIGGRAPH. pp. 321-332 (1998) 3
+39. Wang, Y., Curless, B.L., Seitz, S.M.: People as scene probes. In: European Conference on Computer Vision. pp. 438-454. Springer (2020) 4
+40. Westin, S.H., Arvo, J.R., Torrance, K.E.: Predicting reflectance functions from complex surfaces. In: ACM SIGGRAPH. pp. 255-264 (1992) 4
+41. Williams, L.: Casting curved shadows on curved surfaces. In: ACM SIGGRAPH. pp. 270-274 (1978) 3
+42. Xie, E., Wang, W., Yu, Z., Anandkumar, A., Alvarez, J.M., Luo, P.: Segformer: Simple and efficient design for semantic segmentation with transformers. NeurIPS (2021) 8
+43. Yin, W., Liu, Y., Shen, C.: Virtual normal: Enforcing geometric constraints for accurate and robust depth prediction. IEEE TPAMI (2021) 4
+
+44. Yin, W., Liu, Y., Shen, C., Yan, Y.: Enforcing geometric constraints of virtual normal for depth prediction. In: ICCV. pp. 5684-5693 (2019) 4, 9
+45. Zhang, S., Liang, R., Wang, M.: Shadowgan: Shadow synthesis for virtual objects with conditional adversarial networks. Computational Visual Media 5(1), 8 (2019) 1, 4
\ No newline at end of file
diff --git a/controllableshadowgenerationusingpixelheightmaps/images.zip b/controllableshadowgenerationusingpixelheightmaps/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c67cf88f1afaa36644222aedca1c0c0f2cd1326e
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7acf757bb55202ba46325ce7e12e84b5efeda51a2cf482b3f90c0e89472e65b0
+size 395743
diff --git a/controllableshadowgenerationusingpixelheightmaps/layout.json b/controllableshadowgenerationusingpixelheightmaps/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2f99053ca45c2d9e710251c16600ac77e2aa476d
--- /dev/null
+++ b/controllableshadowgenerationusingpixelheightmaps/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e9dd03f0316ebac9535ec44523f206d92dbbf592bde96809f54684aa9e0ab28
+size 395388
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_content_list.json b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ba65911399a368fcb6621260c75a0efc066fa580
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e27f06e09dbd2131503147121c04a1d3ee75fee8c3d55558fd6159a656772dff
+size 92883
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_model.json b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..64c1d38efde359607b21707942ca6455474804de
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:074b019957925353432d52559781adf03b7c6bcaf6456dfcadcdeb25289a2cdc
+size 115298
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_origin.pdf b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ac3172b974cbf422cde7164b01345d1a6ec6ae57
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/43fcb392-a70a-4e3e-b0a3-cc088d2bbf61_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab4afef5de2222372c62415d0e4d31d104fc16e933264b7f26e6bc4ae9451673
+size 450241
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/full.md b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8f235e0feeab2eb402155a3b261c8c282f0442db
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/full.md
@@ -0,0 +1,289 @@
+# Convolutional Embedding Makes Hierarchical Vision Transformer Stronger
+
+Cong Wang $^{1,2}$ , Hongmin Xu $^{1}$ , Xiong Zhang $^{4}$ , Li Wang $^{2}$ , Zhitong Zheng $^{1}$ , and Haifeng Liu $^{1,3}$
+
+1 Data & AI Engineering System, OPPO, Beijing, China {wangcong3575, xhmjimmy}@gmail.com, {liam,blade}@oppo.com
+
+$^{2}$ Beijing Key Lab of Urban Intelligent Traffic Control Technology, North China University of Technology, Beijing, China
+
+li.wang@ncut.edu.cn
+
+3 University of Science and Technology of China, Hefei, China
+
+4 Neolix Autonomous Vehicle, Beijing, China
+
+zhangxiong@neolix.cn
+
+Abstract. Vision Transformers (ViTs) have recently dominated a range of computer vision tasks, yet it suffers from low training data efficiency and inferior local semantic representation capability without appropriate inductive bias. Convolutional neural networks (CNNs) inherently capture regional-aware semantics, inspiring researchers to introduce CNNs back into the architecture of the ViTs to provide desirable inductive bias for ViTs. However, is the locality achieved by the micro-level CNNs embedded in ViTs good enough? In this paper, we investigate the problem by profoundly exploring how the macro architecture of the hybrid CNNs/ViTs enhances the performances of hierarchical ViTs. Particularly, we study the role of token embedding layers, alias convolutional embedding (CE), and systemically reveal how CE injects desirable inductive bias in ViTs. Besides, we apply the optimal CE configuration to 4 recently released state-of-the-art ViTs, effectively boosting the corresponding performances. Finally, a family of efficient hybrid CNNs/ViTs, dubbed CETNets, are released, which may serve as generic vision backbones. Specifically, CETNets achieve $84.9\%$ Top-1 accuracy on ImageNet-1K (training from scratch), $48.6\%$ box mAP on the COCO benchmark, and $51.6\%$ mIoU on the ADE20K, substantially improving the performances of the corresponding state-of-the-art baselines.
+
+Keywords: Vision Transformers, Convolutional Neural Networks, Convolutional Embedding, Micro and Macro Design
+
+# 1 Introduction
+
+Over the last decades, convolutional neural networks (CNNs) significantly succeeded in the computer vision community due to their inherent properties, including the translation invariance, the locality attention, and the sharing weight design. Those characteristics prove critical for many tasks, such as image recognition [16, 25], semantic image segmentation[7, 70], and object detection[11, 42].
+
+At the same time, researchers take a very different way in the natural language processing (NLP) field. Since the seminal work [54] demonstrated the extraordinary capability of the transformer by employing a unified yet simple architecture to tackle the machine translation task, transformers have become the de-facto architectures to resolve NLP tasks [40, 17].
+
+
+Fig. 1. Performance Improvements of the Convolutional Embedding (CE). The figure presents the performance gains of the CE among 4 SOTA ViTs, i.e., $CvT$ [59], $PVT$ [56], $SWin$ [35], and $CSWin$ [18] on the ImageNet-1K dataset, indicating that the CE indeed significantly improves the baseline methods
+
+In the computer vision domain, certain works [57, 3, 46, 29] successfully brought the key idea of transformer, i.e., attention paradigm, into CNNs and achieved remarkable improvements. Naively transferring the transformer to image recognition, Dosovitskiy et al.[19] demonstrated that the vanilla Vision Transformers (ViTs) structure could achieve comparable performance compared with the state-of-the-art (SOTA) approaches on the ImageNet-1K dataset [19]. Further, pre-trained on the huge dataset JFT-300M [48], the vanilla ViTs outperformed all the SOTA CNNs by a large margin and substantially advanced the SOTA, suggesting that ViTs may have a higher performance ceiling.
+
+ViTs rely on highly flexible multi-head self-attention layers to favor dynamic attention, capture global semantics, and achieve good generalization ability. Yet, recent works find that lacking proper inductive bias, locality, ViTs are substandard optimizability [60], low training sample-efficient [15], and poor to model the complex visual features and the local relation in an image [39, 59]. Most existing works attempt to introduce local mechanisms to ViTs in two paths. One line of work relives the inductive bias problem via non-convolutional ways. Liu et al. [35, 18, 53] limits the attention computation in a local window to enable local receptive field for attention layers, making the overall network still maintain nearly pure attention-based architecture. Concurrently, as the CNNs are inherently efficient for their sliding-window manner, local receptive field, and inductive bias [2], another line of work directly integrates CNNs into ViTs design
+
+to bring convolutional inductive bias into ViTs in a hard [59, 33, 65] or soft [15, 52] way. However, most of those works focus on modifying the micro design of ViTs to enable locality, which raises the question:
+
+Is the inductive bias obtained via the micro design of ViTs good enough to empower the locality to ViTs? or Can the macro architecture design of the network further introduce the desirable inductive bias to ViTs?
+
+We ask the questions mentioned above based on the following findings. The previous work, EarlyConv [60], notices that simply replacing the original patchify stem with a 5-layer convolutional stem can yield $1 - 2\%$ top-1 accuracy on ImageNet-1K and improve the training stability of ViTs. Subsequently, CoAtNet [14] further explore the hybrid design of CNNs and ViTs based on the observation: the depth-wise convolution can be naturally integrated into the attention block. Meanwhile, those works suggest that the convolutional layers can efficiently introduce inductive bias in a shallow layer of the whole network. However, when we retrospect the roadmap of modern CNNs, at the late of 2012, after AlexNet [32] exhibited the potential of CNNs, subsequent studies, for instance, VGG [45], ResNet [25], DenseNet [30], EfficientNet [50, 51] ConvNet2020 [36], and etc. reveal that: convolutions can represent the complex visual features even in a deep layer of network effectively and efficiently. Our research explores the macro network design with hybrid CNNs/ViTs. We want to bridge the gap between the pure CNNs network and the pure ViT network and extend the limitation of the hybrid CNNs/ViTs network.
+
+To test this hypothesis, we start from CNNs' effective receptive field (ERF). As previous work of Luo et al. [38] points out, the output of CNNs considerably depends on their ERF. With larger ERF, CNNs can leave out no vital information, which leads to better prediction results or visual features. Under this perspective, our exploration is imposing strong and effective inductive bias for attention layers via the macro design of network architecture. We specifically focus on patch embedding, alias convolutional embedding (CE), of the hierarchical ViTs architecture. CE locate at the beginning of each stage, as shown in Fig. 2. The CE aims to adjust the dimension and the number of tokens. Most following works also apply one or two convolutions embedding layers [59, 18, 68, 56, 33]. However, these embedding layers cannot offer enough ERF to capture complex visual representations with desirable inductive bias. Since stacking more convolutional layers can increase the ERF [38], we construct a simple baseline with only 1-layer CE and gradually increase the number of convolutions layers in CE to get more variants. Meanwhile, keep changing FLOPs and parameter numbers as small as possible. We observe that the small change of CE in each stage results in a significant performance increase in the final model.
+
+Based on extensive experiments, we further understand how CE affects the hybrid network design of CNNs/ViTs by injecting desirable inductive bias. We make several observations. 1) CNNs bring strong inductive bias even in deep layers of a network, making the whole network easier to train and capturing much complex visual features. At the same time, ViTs allow the entire network has a higher generalization ceiling. 2) CE can impose effective inductive bias, yet
+
+different convolution layers show variable effectiveness. Besides, the large ERF is essential to designing CE or injecting the desirable inductive bias to ViTs, even though it is a traditional design in a pure CNNs network [51, 38]. 3) CNNs can help ViTs see better even in deep networks, providing valuable insights to guide how to design the hybrid CNNs/ViTs network. 4) It is beneficial to combine the macro and micro introduce inductive bias to obtain a higher generalization ceiling of ViTs-based network.
+
+Our results advocate the importance of CE and deep hybrid CNNs/ViTs design for vision tasks. ViT is a general version of CNN [10], and tons of works have proven the high generalization of ViTs-based networks, which spurs researchers to line up to chase the performance ceiling with pure attention networks. After inductive bias is found to be crucial to significantly improve the training speed and sample-efficiency of ViTs, people's efforts are mainly devoted to creating the micro design of ViTs to enhance it [35, 15]. Concurrently, EarlyConv [60] and CoAtNet [14] verify the efficiency of convolutions in shallow layers of the ViT-based network. Our study further pushes the boundary of the macro design of the hybrid CNNs/ViTs network. Our results also suggest that even in deep layers of the ViTs network, correctly choosing the combination of CNNs/ViTs design, one can further improve the upper-performance limitation of the whole network. Finally, we propose a family of models of hybrid CNNs/ViTs as a generic vision backbone.
+
+To sum up, we hope our findings and discussions presented in this paper will deliver possible insights to the community and encourage people to rethink the value of CE in the hybrid CNNs/ViTs network design.
+
+# 2 Related Work
+
+Convolutional neural networks. Since the breakthrough performance of AlexNet[32], the computer vision field has been dominated by CNNs for many years. In the past decade, we have witnessed a steady stream of new ideas being proposed to make CNNs more effective and efficient[45, 49, 25, 30, 29, 22, 27, 43, 69, 50, 51, 41]. One line of work focuses on improving the individual convolutional layer except for the architectural advances. For example, the depthwise convolution [62] is widely used due to its lower computational cost and smaller parameter numbers, and the deformable convolution [12] can adapt to shape, size, and other geometric deformations of different objects by adding displacement variables. The dilated convolution introduces a new parameter called "dilation rate" into the convolution layer, which can arbitrarily expand the receptive field without additional parameters cost. These CNNs architectures are still the primary backbones for computer vision tasks such as object detection[42], instance segmentation[24], semantic segmentation[37], and so on.
+
+Vision Transformers. Transformer [54] has become a prevalent model architecture in natural language processing (NLP) [17, 4] for years. Inspired by the success of NLP, increasing effort on adapting Transformer to computer vision
+
+tasks. Dosovitskiy et al. [19] is the pioneering work that proves pure Transformer-based architectures can attain very competitive results on image classification, shows strong potential of the Transformer architecture for handling computer vision tasks. The success of [19] further inspired the applications of Transformer to various vision tasks, such as image classification[52, 66, 63, 23, 59], object detection[5, 73, 71, 13] and semantic segmentation[55, 47]. Furthermore, some recent works [56, 67, 35] focusing on technique a general vision Transformer backbone for general-purpose vision tasks. They all follow a hierarchical architecture and develop different self-attention mechanisms. The hierarchical design can produce multi-scale features that are beneficial for dense prediction tasks. An efficient self-attention mechanism reduced the computation complexity and enhanced modeling ability.
+
+Integrated CNNs and Transformer. CNNs are good at capturing local features and have the advantages of shift, scale, and distortion invariance, while Transformer have the properties of dynamic attention, global receptive field, and large model capacity. Combining convolutional and Transformer layers can achieve better model generalization and efficiency. Many researchers are trying to integrate CNNs and Transformer. Some methods[57, 3, 28, 58, 46, 44] attempt to augment CNNs backbones with self-attention modules or replace part of convolution blocks with Transformer layers. In comparison, inspired by the success of ViT[19], recent trials attempt to leverage some appropriate convolution properties to enhance Transformer backbones. ConViT[15] introduce a parallel convolution branch to impose convolutional inductive biases into ViT[19]. Localvit [33] adding a depth-wise convolution in Feed-Forward Networks(FFN) component to extract the locality, and CvT[59] employs convolutional projection to calculate self-attention matrices to achieve additional modeling of local spatial context. Besides the "internal" fusion, some method[14, 60] focus on structural combinations of Transformer and CNNs.
+
+# 3 Hybrid CNNs/ViTs Network Design
+
+A general hierarchical ViTs model architecture is illustrated in Figure 2. The convolutional stem is applied for an input image to extract the low-level feature, followed typically four stages to extract diverse-scale deep representations gradually. Each stage consists of a convolutional embedding (CE) block and a set of ViTs blocks. More specifically, the CE block is located at the beginning of each stage and aims to adjust the dimension, change the number, and reduce the resolution of input tokens. For two adjacent stages, the reduction factor is set to 2. After that, those tokens are fed to the following ViTs blocks to generate a global context. To sum up, the proposed network contains five stages $(S0,S1,S2,S3,S4)$ , where $S0$ is the convolutional stem.
+
+The original hierarchical ViTs architecture [35] is following the traditional design of the CNNs network, VGG [45], targeting giving the tokens the ability to represent increasingly complex visual patterns over increasingly larger spatial
+
+
+Fig. 2. Left: the overall architecture of a general hierarchical ViTs network, which consists of two main parts: Stem and Stages. Each stage contains a convolutional embedding and a set of ViTs blocks. Right: an example of a standard ViTs block[19]
+
+footprints. Our goal is to impose the desirable inductive bias for ViTs blocks of the hierarchical architecture. Thus, our explorations are directed to two paths with pure CNNs structure: Macro Design and Micro Design.
+
+# 3.1 Macro Design
+
+Convolutional Stem. In ViTs-based network design, the Stem is concerned to extract the right inductive bias to following global attention modules. It is necessary that maintain enough effective receptive field (ERF) of CE to extract rich visual features at the early stage [60]. In consideration of parameter numbers and FLOPs budget, as well as we notice that $S0$ can be merged with the CE of $S1$ , our final Stem consists of 4 Fused-MBCnvs [21] layers and 1 regular convolutional layer. Specifically, $S0$ contains 2 Fused-MBCnvs with stride 2 and stride 1, respectively. The CE of $S1$ is consists of the same as $S0$ and followed by one $1 \times 1$ convolution at the end to match the channels and normalized by a layer normalization [1]. Another reason that we choose Fused-MBCnvs to compose Stem is that EfficientNetV2 [51] shows that Fused-MBCnvs is surprisingly effective in achieving better generalization and capacity as well as makes training convergence rate faster [60]. Besides, like EfficientNetV2, the hidden state's expand ratios of Fused-MBCnvs and MBCnvs [43] are arranged to 1 or 2. Such a setting allows the convolutional Stem to have fewer parameters and FLOPs without the loss of accuracy. Please refer to the supplementary materials for more details about Fused-MBCnvs and MBCnvs.
+
+Convolutional Embedding. In the following stages, $S2$ , $S3$ , and $S4$ , each stage contains a CE block and a set of ViTs blocks. The CE block captures diverse deep representation with a convolutional inductive bias for subsequent attention modules. It is worth noting that EarlyConv [60] and CoAtNet [14] point out stacking convolutional structure may enhance the ViTs in early stage. However, as we show in Table 8, we argue that CNNs is also able to represent the same, if not better, deep feature as ViTs in the deep layer of a network. Meanwhile, maintaining the CNNs design of the embedding layer naturally introduces proper inductive bias to following ViTs and retains the sample-efficient learning
+
+property. For the same computation resource constraint consideration, the CE adopts only effective and efficient convolutions. The CE of $S2$ , $S3$ , and $S4$ adopts MBConv as the basic unit.
+
+# 3.2 Micro Design
+
+Locally Enhanced Window Self-Attention. Previous work [35] restricts the attention calculation with a local window to reduce computational complexity from quadratic to linear. Meanwhile, to some extent, the local window injects some inductive bias into ViTs. Concurrently, a set of works [59, 56] attempt to directly integrate CNNs into ViTs to bring in convolutional inductive bias, yet their computational complexity is still quadratic. We present a simple Locally Enhanced Window Self-Attention (LEWin) to take advantage of fast attention calculating and locality inductive bias. Inspired by CvT, we performed a convolutional projection on input tokens in a local shift window. The convolutional projection is implemented by a depth-wise separable convolution with kernel size $3 \times 3$ , stride 1, and padding 1. The LEWin can be formulated as:
+
+$$
+\boldsymbol {x} ^ {i - 1} = \text {F l a t t e n} \left(\operatorname {C o n v 2 D} \left(\operatorname {R e s h a p e} \left(\boldsymbol {z} ^ {i - 1}\right)\right)\right), \tag {1}
+$$
+
+$$
+\hat {\boldsymbol {z}} ^ {i} = \operatorname {W H M S A} \left(\ln \left(\boldsymbol {x} ^ {i - 1}\right)\right) + \boldsymbol {x} ^ {i - 1}, \tag {2}
+$$
+
+$$
+\boldsymbol {z} ^ {i} = \operatorname {M L P} \left(\ln \left(\hat {\boldsymbol {z}} ^ {i}\right)\right) + \hat {\boldsymbol {z}} ^ {i}, \tag {3}
+$$
+
+$$
+\boldsymbol {x} ^ {i} = \operatorname {F l a t t e n} \left(\operatorname {C o n v 2 D} \left(\operatorname {R e s h a p e} \left(\boldsymbol {z} ^ {i}\right)\right)\right), \tag {4}
+$$
+
+$$
+\hat {z} ^ {i + 1} = \operatorname {S W M S A} \left(\ln \left(\boldsymbol {x} ^ {i}\right)\right) + \boldsymbol {x} ^ {i}, \tag {5}
+$$
+
+$$
+z ^ {i + 1} = \operatorname {M L P} \left(\ln \left(\hat {z} ^ {i + 1}\right)\right) + \hat {z} ^ {i + 1} \tag {6}
+$$
+
+where $\pmb{x}^i$ is the unperturbed token in local window prior to the convolutional projection, $\hat{\pmb{z}}^i$ and $\pmb{z}^i$ denote the output features of the WMSA or S-WMSA module and the MLP module for the $i - th$ block, respectively. W-MSA and SW-MSA define window-based multi-head self-attention based on the regular and shifted windows from Swin [35], respectively.
+
+# 3.3 CETNet Variants
+
+We consider three different network configurations for CETNet to compare with other ViTs backbones under similar model size and computation complexity conditions. By changing the base channel dimension and the number of ViTs blocks of each stage, we build three variants, tiny, small, and base models, namely CETNet-T, CETNet-S, and CETNet-B. For more detailed configurations, please refer to our supplementary materials.
+
+# 4 Experiments
+
+To verify the ability of our CETNet as a general vision backbone. We conduct experiments on ImageNet-1K classification[16], COCO object detection[34], and ADE20K semantic segmentation[72]. In addition, comprehensive ablation studies are performed to validate the design of the proposed architecture.
+
+Table 1. Comparison of image classification on ImageNet-1K for different models. The models are grouped based on the similar model size and computation complexity
+
+| ImageNet-1K 2242 trained model |
| Model | Params FLOPs Top-1(%) | Model | Params FLOPs Top-1(%) | Model | Params FLOPs Top-1(%) |
| ResNet-50[25] | 25M | 4.1G | 76.2 | ResNet-101[25] | 45M | 7.9G | 77.4 | ResNet-152[25] | 60M | 11.0G | 78.3 |
| RegNetY-4G[41] | 21M | 4.0G | 80.0 | RegNetY-8G[41] | 39M | 8.0G | 81.7 | RegNetY-16G[41] | 84M | 16.0G | 82.9 |
| DeiT-S[52] | 22M | 4.6G | 79.8 | PVT-M[56] | 44M | 6.7G | 81.2 | DeiT-B[52] | 87M | 17.5G | 81.8 |
| PVT-S[56] | 25M | 3.8G | 79.8 | T2T-19[66] | 39M | 8.9G | 81.5 | PiT-B[26] | 74M | 12.5G | 82.0 |
| T2T-14[66] | 22M | 5.2G | 81.5 | T2Tt-19[66] | 39M | 9.8G | 82.2 | T2T-24[66] | 64M | 14.1G | 82.3 |
| ViL-S[67] | 25M | 4.9G | 82.0 | ViL-M[67] | 40M | 8.7G | 83.3 | T2Tt-24[66] | 64M | 15.0G | 82.6 |
| TNT-S[23] | 24M | 5.2G | 81.3 | MVIT-B[20] | 37M | 7.8G | 81.0 | CPVT-B[9] | 88M | 17.6G | 82.3 |
| CViT-15[6] | 27M | 5.6G | 81.0 | CViT-18[6] | 43M | 9.0G | 82.5 | TNT-B[23] | 66M | 14.1G | 82.8 |
| LViT-S[33] | 22M | 4.6G | 80.8 | CViTc-18[6] | 44M | 9.5G | 82.8 | ViL-B[67] | 56M | 13.4G | 83.2 |
| CPVT-S[9] | 23M | 4.6G | 81.9 | Twins-B[8] | 56M | 8.3G | 83.2 | Twins-L[8] | 99M | 14.8G | 83.7 |
| Swin-T[35] | 29M | 4.5G | 81.3 | Swin-S[35] | 50M | 8.7G | 83.0 | Swin-B[35] | 88M | 15.4G | 83.5 |
| CvT-13[59] | 20M | 4.5G | 81.6 | CvT-21[59] | 32M | 7.1G | 82.5 | CETNet-B | 75M | 15.1G | 83.8 |
| CETNet-T | 23M | 4.3G | 82.7 | CETNet-S | 34M | 6.8G | 83.4 | | | | |
| ImageNet-1K 3842 finetuned model |
| CvT-13[59] | 25M | 16.3G | 83.0 | CvT-21[59] | 32M | 24.9G | 83.3 | ViT-B/16[19] | 86M | 49.3G | 77.9 |
| T2T-14[66] | 22M | 17.1G | 83.3 | CViTc-18[6] | 45M | 32.4G | 83.9 | DeiT-B[52] | 86M | 55.4.3G | 83.1 |
| CViTc-15[6] | 28M | 21.4G | 83.5 | CETNet-S | 34M | 19.9G | 84.6 | Swin-B[35] | 88M | 47.0G | 84.5 |
| CETNet-T | 24M | 12.5G | 84.2 | | | | | CETNet-B | 75M | 44.50G | 84.9 |
+
+# 4.1 Image Classification
+
+Settings For Image classification, we compare different methods on ImageNet-1K[16], with about 1.3M images and 1K classes, the training set, and the validation set containing 1.28M images and 50K images respectively. The top 1 accuracy on the validation set is reported to show the capacity of our CETNet. For a fair comparison, the experiment setting follows the training strategy in [35]. All model variants are trained for 300 epochs with a batch size of 1024 or 2048 and using a cosine decay learning rate scheduler with 20 epochs of linear warm-up. We adopt an AdamW[31] optimizer with an initial learning rate of 0.001, and a weight decay of 0.05 is used. We use the same data augmentation methods, and regularization strategies used in [35] for training. All models are trained with $224 \times 224$ input size, while a center crop is used during evaluation on the validation set. When fine-tuning on $384 \times 384$ input, we train the models for 30 epochs with a learning rate of 2e-5, batch size of 512, and no center crop for evaluation.
+
+Results Table 1 presents comparisons to other models on the image classification task, and the models are split into three groups based on the similar model size (Params) and computation complexity (FLOPs). It can be seen from the table, our models consistently exceed other methods by large margins. More specifically, CETNet-T achieves $82.7\%$ Top-1 accuracy with only 23M parameters and 4.3G FLOPs, surpassing CvT-13, Swin-T, and DeiT-S by $1.1\%$ , $1.4\%$ and $2.9\%$ separately. For small and base models, our CETNet-S and CETNet-B still achieve better performance with comparable Params and FLOPs. Compared with the state-of-the-art CNNs RegNet[41] which also trained with input size $224 \times 224$ with out extra data, our CETNet achieves better accuracy. On the $384 \times 384$ input, Our CETNet's performance is still better than other
+
+Backbone, achieve $84.2\%$ , $84.6\%$ and $84.9\%$ respectively, well demonstrates the powerful learning capacity of our CETNet. As a result, we can conclude that an effective combination of CNNs and ViTs can optimize well in small(or middle) scale datasets.
+
+Table 2. Object detection and instance segmentation performance on COCO 2017 validation set with the Mask R-CNN framework. The FLOPs are measured at a resolution of $800 \times 1280$ , and the backbones are pre-trained on the ImageNet-1K
+
+| Mask R-CNN 1× schedule | Mask R-CNN 3× schedule |
| Backbone | Params | FLOPs | \(AP^b\) | \(AP_{50}^b\) | \(AP_{75}^b\) | \(AP^m\) | \(AP_{50}^m\) | \(AP_{75}^m\) | \(AP^b\) | \(AP_{50}^b\) | \(AP_{75}^b\) | \(AP^m\) | \(AP_{50}^m\) | \(AP_{70}^m\) | | |
| Res50[25] | 44M | 260G | 38 | 58.6 | 41.4 | 34.4 | 55.1 | 36.7 | 41 | 61.7 | 44.9 | 37.1 | 58.4 | 40.1 | | |
| PVT-S[56] | 44M | 245G | 40.4 | 62.9 | 43.8 | 37.8 | 60.1 | 40.3 | 43 | 65.3 | 46.9 | 39.9 | 62.5 | 42.8 | | |
| ViL-S[67] | 45M | 218G | 44.9 | 67.1 | 49.3 | 41.0 | 64.2 | 44.1 | 47.1 | 68.7 | 51.5 | 42.7 | 65.9 | 46.2 | | |
| TwinsP-S[8] | 44M | 245G | 42.9 | 65.8 | 47.1 | 40.0 | 62.7 | 42.9 | 46.8 | 69.3 | 51.8 | 42.6 | 66.3 | 46 | | |
| Twins-S[8] | 44M | 228G | 43.4 | 66.0 | 47.3 | 40.3 | 63.2 | 43.4 | 46.8 | 69.2 | 51.2 | 42.6 | 66.3 | 45.8 | | |
| Swin-T[35] | 48M | 264G | 43.7 | 64.6 | 46.2 | 39.1 | 61.6 | 42.0 | 46 | 68.2 | 50.2 | 41.6 | 65.1 | 44.8 | | |
| CETNet-T | 43M | 261G | 45.5 | 67.7 | 50.0 | 40.7 | 64.4 | 43.7 | 46.9 | 67.9 | 51.5 | 41.6 | 65 | 44.7 | | |
| Res101[25] | 63M | 336G | 40.4 | 61.1 | 44.2 | 36.4 | 57.7 | 38.8 | 42.8 | 63.2 | 47.1 | 38.5 | 60.1 | 41.3 | | |
| X101-32[62] | 63M | 340G | 41.9 | 62.5 | 45.9 | 37.5 | 59.4 | 40.2 | 42.8 | 63.2 | 47.1 | 38.5 | 60.1 | 41.3 | | |
| PVT-M[56] | 64M | 302G | 42.0 | 64.4 | 45.6 | 39.0 | 61.6 | 42.1 | 42.8 | 63.2 | 47.1 | 38.5 | 60.1 | 41.3 | | |
| ViL-M[67] | 60M | 261G | 43.4 | - | - | 39.7 | - | - | 44.6 | 66.3 | 48.5 | 40.7 | 63.8 | 43.7 | | |
| TwinsP-B[8] | 64M | 302G | 44.6 | 66.7 | 48.9 | 40.9 | 63.8 | 44.2 | 47.9 | 70.1 | 52.5 | 43.2 | 67.2 | 46.3 | | |
| Twins-B[8] | 76M | 340G | 45.2 | 67.6 | 49.3 | 41.5 | 64.5 | 44.8 | 48 | 69.5 | 52.7 | 43 | 66.8 | 46.6 | | |
| Swin-S[35] | 69M | 354G | 44.8 | 66.6 | 48.9 | 40.9 | 63.4 | 44.2 | 48.5 | 70.2 | 53.5 | 43.3 | 67.3 | 46.6 | | |
| CETNet-S | 53M | 315G | 46.6 | 68.7 | 51.4 | 41.6 | 65.4 | 44.8 | 48.6 | 69.8 | 53.5 | 43 | 66.9 | 46 | | |
| X101-64[62] | 101M | 493G | 42.8 | 63.8 | 47.3 | 38.4 | 60.6 | 41.3 | 44.4 | 64.9 | 48.8 | 39.7 | 61.9 | 42.6 | | |
| PVT-L[56] | 81M | 364G | 42.9 | 65.0 | 46.6 | 39.5 | 61.9 | 42.5 | 44.5 | 66.0 | 48.3 | 40.7 | 63.4 | 43.7 | | |
| ViL-B[67] | 76M | 365G | 45.1 | - | - | 41.0 | - | - | 45.7 | 67.2 | 49.9 | 41.3 | 64.4 | 44.5 | | |
| TwinsP-L[8] | 81M | 364G | 45.4 | - | - | 41.6 | - | - | - | - | - | - | - | - | | |
| Twins-L[8] | 111M | 474G | 45.9 | - | - | 41.6 | - | - | - | - | - | - | - | - | | |
| Swin-B[35] | 107M | 496G | 46.9 | - | - | 42.3 | - | - | 48.5 | 69.8 | 53.2 | 43.4 | 66.8 | 46.9 | | |
| CETNet-B | 94M | 495G | 47.9 | 70.3 | 53.0 | 42.5 | 67.2 | 45.6 | 48.6 | 69.5 | 53.7 | 43.1 | 66.9 | 46.4 | | |
+
+# 4.2 Object Detection and Instance Segmentation
+
+Settings For object detection and instance segmentation experiments, we evaluate our CETNet with the Mask R-CNN[24] framework on COCO 2017, which contains over 200K images with 80 classes. The models pre-trained on the ImageNet-1K dataset are used as visual backbones. We follow the standard to use two training schedules, $1 \times$ schedule(12 epochs with the learning rate decayed by $10 \times$ at epochs 8 and 11) and $3 \times$ schedule(36 epochs with the learning rate decayed by $10 \times$ at epochs 27 and 33). We utilize the multi-scale training strategy[5], resizing the input that the shorter side is between 480 and 800 while the longer side is no more than 1333. AdamW[31] optimizer with initial learning rate of 0.0001, weight decay of 0.05. All models are trained on the 118K training
+
+images with a batch size of 16, and the results are reported on 5K images in COCO 2017 validation set.
+
+Results As shown in Table 2, the results of the Mask R-CNN framework show that our CETNet variants clearly outperform all counterparts with $1 \times$ schedule. In detail, our CETNet-T outperforms Swin-T by $+1.8$ box AP, $+1.6$ mask AP. On the small and base configurations, the performance gain can also be achieved with $+1.8$ box AP, $+0.7$ mask AP and $+1.0$ box AP, $+0.2$ mask AP respectively. For $3 \times$ schedule, our model, CETNet-S and CETNet-B, can achieve competitive results with lower Params and FLOPs than the current state-of-the-art ViTs methods in small and base scenarios. However, like Swin, CETNet-T can't beat the
+
+Table 3. Comparison of semantic segmentation on ADE20K with the Upernet framework, both single and multi-scale evaluations are reported in the last two columns. FLOPs are calculated with a resolution of $512\times 2048$ , and the backbones are pretrained on the ImageNet-1K
+
+| Upernet 160k trained models |
| Backbone | Params | FLOPs | mIoU(%) | MS mIoU(%) |
| TwinsP-S[8] | 54.6M | 919G | 46.2 | 47.5 |
| Twins-S[8] | 54.4M | 901G | 46.2 | 47.1 |
| Swin-T[35] | 59.9M | 945G | 44.5 | 45.8 |
| CETNet-T | 53.2M | 935G | 46.5 | 47.9 |
| Res101[25] | 86.0M | 1029G | - | 44.9 |
| TwinsP-B[8] | 74.3M | 977G | 47.1 | 48.4 |
| Twins-B[8] | 88.5M | 1020G | 47.7 | 48.9 |
| Swin-S[35] | 81.3M | 1038G | 47.6 | 49.5 |
| CETNet-S | 63.4M | 990G | 48.9 | 50.6 |
| TwinsP-L[8] | 91.5M | 1041G | 48.6 | 49.8 |
| Twins-L[8] | 133.0M | 1164G | 48.8 | 50.2 |
| Swin-B[35] | 121.0M | 1188G | 48.1 | 49.7 |
| CETNet-B | 106.3M | 1176G | 50.2 | 51.6 |
+
+SOTA performance. Also, in the small and base configurations, we notice the variants of our CETNet and SWin do not improve the performance. We conjecture such inferior performance may be because of insufficient data.
+
+# 4.3 Semantic Segmentation
+
+Settings We further use the pre-trained models as the backbone to investigate the capability of our models for Semantic Segmentation on the ADE20K[72] dataset. ADE20K is a widely-used semantic segmentation dataset that contains 150 fine-grained semantic categories, with 20,210, 2,000, and 3,352 images for training, validation, and testing, respectively. We follow previous works[35] to employ UperNet[61] as the basic framework and follow the same setting for a fair comparison. In the training stage, we employ the AdamW[31] optimizer and set the initial learning rate to 6e-5 and use a polynomial learning rate decay, and the weight decay is set to 0.01 and train Upernet 160k iterations with batch size of 16. The data augmentations adopt the default setting in mmsegmentation of random horizontal flipping, random re-scaling within ratio range [0.5, 2.0], and random photometric distortion. Both single and multi-scale inference are used for evaluation.
+
+Results In Table 3, we list the results of Upernet $160\mathrm{k}$ trained model on ADE20K. It can be seen that our CETNet models significantly outperform previous state-of-the-arts under different configurations. In details, CETNet-T achieves $46.5\mathrm{mIoU}$ and $47.9$ multi-scale tested mIoU, $+2.0$ and $+2.1$ higher
+
+than Swin-T with similar computation cost. On the small and base configurations, CETNet-S and CETNet-B still achieve $+1.3$ and $+2.1$ higher mIOU and $+1.1$ and $+1.9$ multi-scale tested mIoU than the Swin counterparts. The performance gain is promising and demonstrates the effectiveness of our CETNet design.
+
+# 4.4 Ablation Study
+
+In this section, we ablate the critical elements of the proposed CETNet backbone using ImageNet-1K image classification. The experimental settings are the same as the settings in Sec. 4.1. For the attention mechanism, when replacing the micro design LEWin self-attention with the origin shifted window self-attention, the performance dropped $0.2\%$ , demonstrating the effectiveness of our micro design. Furthermore, we find the "deep-narrow" architecture is better than the "shallow-wide" counterpart. Specifically, the deep-narrow model with [2,2,18,2] Transformer blocks for four stages with the base channel dimensions $D = 64$ and the shallow-wide model with [2,2,6,2] blocks for four stages with $D = 96$ . As we can see from the 1st and 3rd rows, even with larger Params and FLOPs, the shallow-wide model performs worse than the deep-narrow design. The CE module is the key element in our models. To verify the effectiveness CE module, we compare it with the existing method used in hierarchical ViTs backbones, including the patch embedding and patch merging modules in Swin [35] and convolutional token embedding modules described in CvT [59]. For a fair comparison, we use the shallow-wide design mentioned above and apply these three methods in all these models with all other factors kept the same. As shown in the last three rows of Table 4, our CE module performs better than other existing methods.
+
+Table 4. Ablation study of CETNet's key elements. 'Without LEAtten' denotes replacing the micro design LEWin self-attention with the shifted window self-attention in SWin [35]. The 'D' and 'S' represents the deep-narrow and the shallow-wide model, respectively. The 1st and 3rd rows are the baseline 'D' and 'S' models.
+
+| Models | Param | FLOPs | Top-1(%) |
| CETNet-T (D with CE) | 23.4M | 4.3G | 82.7 |
| Without LEAtten (D with CE) | 23.3M | 4.2G | 82.5 |
| Shallow-wide (S with CE) | 29M | 4.6G | 82.5 |
| Patch embedding+patch merging [35] (S) | 27M | 4.6G | 81.5 |
| Convolutional token embedding [59] (S) | 27M | 4.6G | 82.0 |
+
+# 5 Investigating the role of Convolutional Embedding
+
+This section systematically understands how the hybrid CNNs/ViTs network benefits from the CE. As we need carefully make the trade-off among the computation budget, the model generalization, and the model capacity, the CE, two
+
+design choices are mainly explored in this work: the number of CNNs layers of CE and the basic unit of CE. Besides, we show the superiority of CE via integrate CE into 4 popular hierarchical ViTs models. Finally, we further investigate the role of CNNs in hybrid CNNs/ViTs network design. Except for specific declaration, all configuration is follow the Image Classification setting as section 4.
+
+# 5.1 Effect of the Stacking Number
+
+We first explore how large effective receptive field (ERF) affect the computation budget and the performance of the network. As we mentioned in section 3.1, the $S0$ and the CE of $S1$ are combined as one whole CNNs stem. We refer it as the first CE $(\mathrm{CE}^{1st})$ in rest of this section, $\mathrm{CE}^{2nd}$ , $\mathrm{CE}^{3rd}$ , and $\mathrm{CE}^{4th}$ represent the CE of $S2$ , $S3$ , $S4$ , respectively. To explore the effect of the stacking number of the basic unit,
+
+we slightly modify the SWin-Tiny [35] model by replacing its patch embedding and patch merging modules with pure CNNs. We choose MBConv as the basic unit of CE and gradually increase the layer number of CE from 1 to 3, 5, and 7. As shown in Table 5, as the CE contains more MBConv, the Param and FLOPs grow, and the performance increases from $81.8\%$ to $82.6\%$ . The 3-layer CE model has slightly higher FLOPs than the 1-layer CE (4.48G vs. 4.55G) with near the same Param (28.13M vs. 28.11M). Besides, it is worth noticing that the performance grows negligibly from 5-layer CE to 7-layer CE. Thus, we employ 5-layer setting, offering large ERF [64, 51], as CETNet's final configuration.
+
+Table 5. Performance of model with different layer numbers of CE. The baseline is slightly modified from SWin-Tiny [35]
+
+| Models | Param | FLOPs | Top-1(%) |
| Swin-T[35] | 29M | 4.5G | 81.3 |
| 1-layer CE | 28.1M | 4.5G | 81.8 |
| 3-layer CE | 28.1M | 4.6G | 82.2 |
| 5-layer CE | 29.1M | 4.9G | 82.4 |
| 7-layer CE | 30.1M | 5.4G | 82.6 |
+
+# 5.2 Effect of Different CNNs Blocks
+
+We next explore how well convolutional inductive bias inject by different CNNs architectures. The CE layers aim to offer rich features for later attention modules. CNNs' effective receptive field (ERF) determines the information it can cover and process. As Luo et al. mentioned, stacking more layers, subsampling, and CNNs with large ERF, such as dilated convolution [64] can enlarge the ERF of CNNs networks. For find an efficient basic unit for CE, we use the CETNet-Tiny (CETNet-T) model as a baseline and
+
+Table 6. Transfer some popular CNNs blocks to CETNet-T, including the DenseNet block, ShuffleNet block, ResNet block, SeresNet block, and GhostNet block. PureMBCov represents to use MBCov block to replace the Fused-MBCov block in the early stage of CETNet-T
+
+| CNNs type | Params | FLOPs | Top-1(%) |
| CETNet-T | 23.4M | 4.3G | 82.7 |
| PureMBCoNs[43] | 23.4M | 4.2G | 82.6 |
| GhostNetConvs[22] | 24.6M | 4.3G | 82.6 |
| DenseNetConvs[30] | 22.3M | 4.4G | 82.5 |
| ShuffleNetConvs[69] | 23.4M | 4.3G | 82.4 |
| ResNetConvs[25] | 23.8M | 4.3G | 82.0 |
| SeresNetConvs[29] | 24.0M | 4.3G | 82.0 |
+
+replace the CE with some recent CNNs building blocks, such as MBConv [43], DenseNet [30], ShuffleNet [69], ResNetConvs[25], SeresNetConvs [29], and GhostNetConvs [22]. All candidate convolutions layers stack to 5 layers based on previous finding. For a fair comparison, all model variants are constructed to have similar parameter numbers and FLOPs. As we can see from Table 6, when replaced the Fused-MBConv in the early stage of CETNet-T by MBConv, the top-1 accuracy increased $0.1\%$ , and we observed a 12 percent decrease in training speed. Also, CETNet-T and PureMB model achieve higher performance than other candidate convolutions. We argue that may be the internal relation between depthwise convolution and ViTs as pointed out by CoAtNet [14], which is further verified by the GhostNet and shuffleNet model, which archive $82.6\%$ and $82.4\%$ top-1 accuracy. Besides, we noticed that under that CNNs help ViTs see better perspective, in CE case, dense connections in convolutions may not necessarily hurt performance. Since the result shows that our DenseNet model can also archive $82.5\%$ top-1 accuracy, which is comparable with the performance of CETNet-T, PureMB, GhostNet, and shuffleNet model. However, ResNet and SeresNet show inferior performance. We conjecture that the basic units have different ERF with the same stacking number.
+
+# 5.3 Generalization of CE
+
+Then, we attempt to generalize the CE design to more ViTs backbones of CV. Here, we apply our CE design, 5-layer Fused-MBConv of $\mathrm{CE}^{1st}$ , and 5-layer MBConv of $\mathrm{CE}^{2nd}$ , $\mathrm{CE}^{3rd}$ , and $\mathrm{CE}^{4th}$ respectively, to 4 prevalent backbones, CvT [59], PVT[56], SWin [35], and CSWin [18]. For a fair comparison, we slightly change the structure, removing some ViTs blocks, of 4 models to keeps their parameter numbers and FLOPs maintaining the similar level as their original version. Also, we modify the small-scale model variant CvT-13 and PVT-S of CvT and PVT. As shown in Table 7, those modified models outperform the orig
+
+Table 7. Generalize the CE module to 4 ViT backbones. All models are trained on ImageNet-1K dataset and compared with the original model under the same training scheme. Depths indicate the number of Transformer layers of each stage. FLOPs are calculated with a resolution of $224 \times 224$
+
+| Framework | Models | Channels | Depths | Param FLOPs | Top-1 |
| CvT[59] | CvT-13 | 64 | [1, 2, 10] | 20.0M | 4.5G |
| CE-CvT-13 | 64 | [1, 2, 10] | 20.0M | 4.4G |
| PVT[56] | PVT-S | 64 | [3, 4, 6, 3] | 24.5M | 3.8G |
| CE-PVT-S | 64 | [3, 4, 4, 3] | 22.6M | 3.7G |
| SWin[35] | Swin-T | 96 | [2, 2, 6, 2] | 28.3M | 4.5G |
| CE-Swin-T | 96 | [2, 2, 4, 2] | 23.4M | 4.3G |
| Swin-S | 96 | [2, 2, 18, 2] | 50.0M | 8.7G |
| CE-Swin-S | 96 | [2, 2, 16, 2] | 48.2M | 8.8G |
| Swin-B | 128 | [2, 2, 18, 2] | 88.0M | 15.4G |
| CE-Swin-B | 128 | [2, 2, 16, 2] | 85.2M | 15.5G |
| CSWin[18] | CSWin-T | 64 | [1, 2, 21, 1] | 23.0M | 4.3G |
| CE-CSWin-T | 64 | [1, 2, 20, 1] | 21.6M | 4.2G |
| CSWin-S | 64 | [2, 4, 32, 2] | 35.0M | 6.9G |
| CE-CSWin-S | 64 | [2, 4, 31, 2] | 33.9M | 6.6G |
| CSWin-B | 96 | [2, 4, 32, 2] | 78.0M | 15.0G |
| CE-CSWin-B | 96 | [2, 4, 31, 2] | 75.8M | 14.7G |
+
+inal model $0.5\%$ and $1.3\%$ separately. Furthermore, when introducing our design into Swin and CSWin, the top-1 accuracy of all counterparts is improved even under lower parameter numbers and FLOPs scenarios. For details, the modified models of Swin counterparts gain $1.2\%$ , $0.6\%$ and $0.7\%$ , and the CSwin counterparts gain $0.9\%$ , $0.5\%$ and $0.5\%$ respectively. Those results demonstrated that CE could be easily integrated with other ViT models and significantly improve the performance of those ViT models.
+
+# 5.4 Understanding the Role of CNNs in Hybrid CNNs/ViTs Design
+
+Finally, we explore how well CNNs in the deep layer of the hybrid CNNs/ViTs network improves ViTs. Previous works [60, 14, 39] show the shallow CNNs structure is enough to bring the convolutional inductive bias to all following ViTs blocks. However, one may notice that the $\mathrm{CE}^{2nd}$ , $\mathrm{CE}^{3rd}$ , and $\mathrm{CE}^{4th}$ are not located the shallow layer of network. To fully understand: 1) whether CNNs in the deep layer enhances the inductive bias for subsequent ViTs blocks; 2) how hybrid CNNs/ViTs design affects the final performance of the network. We conduct the following experiments. From macro view, CETNet can be view as 'C-T-C-T-C-T-C-T', where C and T denote CE and ViTs blocks respectively, where $\mathrm{CE}^{1st}$ is Fused-MBConv, $\mathrm{CE}^{2nd}$ , $\mathrm{CE}^{3rd}$ , and $\mathrm{CE}^{4th}$ are MBConv. We conduct three main experiments: CNNs to ViTs, ViTs to CNNs, and Others. In CNNs to ViTs group, we gradually replace the convolutions with transformers. In ViTs to CNNs group, we do the reverse. As we can see, only adopting CNNs in early stage is not optimal. In addition, all hybrid models outperform the pure ViTs model in CNNs to ViTs. Besides, in comparison with ViTs to CNNs, one may notice that in deep layer architecture with more ViTs is superior to more CNNs. In addition, we have: hybrid CNNs/ViTs $\geq$ pure ViT $\geq$ pure CNNs, in deep layer of network. In Others group, we further list some variants' experiment results to the audience and hope that any possible insights may raise a rethinking of the hybrid CNNs/ViTs network design.
+
+Table 8. Comparison of different hybrid CNNs/ViTs designs. 'Arch' represents architecture for short. C represents MBConvs(Fused-MBCnvs in the early stage), and T represents the ViTs block mentioned in section 3.2
+
+| CNNs to ViTs | ViTs to CNNs | Others |
| Arch | Param FLOPs | Top-1 | Arch | Param FLOPs | Top-1 | Arch | Param FLOPs | Top-1 | | |
| C-T-C-T-C-T-C-T | 23.4M | 4.3G | 82.7 | C-T-C-T-C-T-C-T | 23.4M | 4.3G | 82.7 | C-T-C-T-C-T-C-T | 23.4M | 4.3G |
| C-T-C-T-C-T-T-T | 24.0M | 4.2G | 82.8 | C-T-C-T-C-T-C-C | 23.7M | 4.2G | 82.0 | C-C-C-T-C-T-C-T | 23.5M | 4.3G |
| C-T-C-T-T-T-T-T | 24.1M | 4.2G | 82.5 | C-T-C-T-C-C-C-C | 24.4M | 4.2G | 79.6 | C-C-C-C-T-T-T-T | 25.5M | 4.4G |
| C-T-T-T-T-T-T-T | 24.1M | 4.4G | 82.3 | C-T-C-C-C-C-C-C | 24.3M | 4.2G | 79.2 | T-T-T-T-C-C-C-C | 23.4M | 4.8G |
| T-T-T-T-T-T-T | 24.3M | 4.2G | 80.1 | C-C-C-C-C-C-C-C | 24.6M | 5.1G | 79.0 | T-C-T-C-T-C-T-C | 24.5M | 4.2G |
+
+# 6 Conclusions
+
+This paper proposes a principled way to produce a hybrid CNNs/ViT's architecture. With the idea of injecting desirable inductive bias in ViTs, we present 1) a conceptual understanding of combining CNNs/ViT's into a single architecture, based on using a convolutional embedding and its effect on the inductive bias of the architecture. 2) a conceptual framework of micro and macro detail of an hybrid architecture, where different design decisions are made at the small and large levels of detail to impose an inductive bias into the architecture. Besides, we deliver a family of models, dubbed CETNets, which serve as a generic vision backbone and achieve the SOTA performance on various vision tasks under constrained data size. We hope that what we found could raise a rethinking of the network design and extend the limitation of the hybrid CNNs/ViT's network.
+
+# References
+
+1. Ba, J.L., Kiros, J.R., Hinton, G.E.: Layer normalization. arXiv preprint arXiv:1607.06450 (2016)
+2. Battaglia, P.W., Hamrick, J.B., Bapst, V., Sanchez-Gonzalez, A., Zambaldi, V., Malinowski, M., Tacchetti, A., Raposo, D., Santoro, A., Faulkner, R., et al.: Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261 (2018)
+3. Bello, I., Zoph, B., Vaswani, A., Shlens, J., Le, Q.V.: Attention augmented convolutional networks. In: Proceedings of the IEEE/CVF international conference on computer vision. pp. 3286-3295 (2019)
+4. Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al.: Language models are few-shot learners. arXiv preprint arXiv:2005.14165 (2020)
+5. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European Conference on Computer Vision. pp. 213-229. Springer (2020)
+6. Chen, C.F., Fan, Q., Panda, R.: Crossvit: Cross-attention multi-scale vision transformer for image classification. arXiv preprint arXiv:2103.14899 (2021)
+7. Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K., Yuille, A.L.: Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence 40(4), 834-848 (2017)
+8. Chu, X., Tian, Z., Wang, Y., Zhang, B., Ren, H., Wei, X., Xia, H., Shen, C.: Twins: Revisiting spatial attention design in vision transformers. arXiv preprint arXiv:2104.13840 (2021)
+9. Chu, X., Tian, Z., Zhang, B., Wang, X., Wei, X., Xia, H., Shen, C.: Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882 (2021)
+10. Cordonnier, J.B., Loukas, A., Jaggi, M.: On the relationship between self-attention and convolutional layers. arXiv preprint arXiv:1911.03584 (2019)
+1. Dai, J., Li, Y., He, K., Sun, J.: R-fcn: Object detection via region-based fully convolutional networks. Advances in neural information processing systems 29 (2016)
+2. Dai, J., Qi, H., Xiong, Y., Li, Y., Zhang, G., Hu, H., Wei, Y.: Deformable convolutional networks. In: Proceedings of the IEEE international conference on computer vision. pp. 764-773 (2017)
+3. Dai, Z., Cai, B., Lin, Y., Chen, J.: Up-detr: Unsupervised pre-training for object detection with transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1601-1610 (2021)
+4. Dai, Z., Liu, H., Le, Q.V., Tan, M.: Coatnet: Marrying convolution and attention for all data sizes. arXiv preprint arXiv:2106.04803 (2021)
+5. d'Ascoli, S., Touvron, H., Leavitt, M., Morcos, A., Biroli, G., Sagun, L.: Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697 (2021)
+6. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition (CVPR). pp. 248-255. IEEE (2009)
+7. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)
+
+18. Dong, X., Bao, J., Chen, D., Zhang, W., Yu, N., Yuan, L., Chen, D., Guo, B.: Cswin transformer: A general vision transformer backbone with cross-shaped windows. arXiv preprint arXiv:2107.00652 (2021)
+19. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+20. Fan, H., Xiong, B., Mangalam, K., Li, Y., Yan, Z., Malik, J., Feichtenhofer, C.: Multiscale vision transformers. arXiv preprint arXiv:2104.11227 (2021)
+21. Gupta, S., Tan, M.: Efficientnet-edgetpu: Creating accelerator-optimized neural networks with automl. Google AI Blog 2, 1 (2019)
+22. Han, K., Wang, Y., Tian, Q., Guo, J., Xu, C., Xu, C.: Ghostnet: More features from cheap operations. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1580-1589 (2020)
+23. Han, K., Xiao, A., Wu, E., Guo, J., Xu, C., Wang, Y.: Transformer in transformer. arXiv preprint arXiv:2103.00112 (2021)
+24. He, K., Gkioxari, G., Dólar, P., Girshick, R.: Mask r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 2961-2969 (2017)
+25. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+26. Heo, B., Yun, S., Han, D., Chun, S., Choe, J., Oh, S.J.: Rethinking spatial dimensions of vision transformers. arXiv preprint arXiv:2103.16302 (2021)
+27. Howard, A.G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., Adam, H.: Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861 (2017)
+28. Hu, H., Zhang, Z., Xie, Z., Lin, S.: Local relation networks for image recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3464-3473 (2019)
+29. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7132-7141 (2018)
+30. Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q.: Densely connected convolutional networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4700-4708 (2017)
+31. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+32. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25, 1097-1105 (2012)
+33. Li, Y., Zhang, K., Cao, J., Timofte, R., Van Gool, L.: Localvit: Bringing locality to vision transformers. arXiv preprint arXiv:2104.05707 (2021)
+34. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision. pp. 740-755. Springer (2014)
+35. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021)
+36. Liu, Z., Mao, H., Wu, C.Y., Feichtenhofer, C., Darrell, T., Xie, S.: A convnet for the 2020s. arXiv preprint arXiv:2201.03545 (2022)
+
+37. Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3431-3440 (2015)
+38. Luo, W., Li, Y., Urtasun, R., Zemel, R.: Understanding the effective receptive field in deep convolutional neural networks. Advances in neural information processing systems 29 (2016)
+39. Marquardt, T.P., Jacks, A., Davis, B.L.: Token-to-token variability in developmental apraxia of speech: Three longitudinal case studies. Clinical Linguistics & Phonetics 18(2), 127-144 (2004)
+40. Radford, A., Narasimhan, K., Salimans, T., Sutskever, I.: Improving language understanding by generative pre-training (2018)
+41. Radosavovic, I., Kosaraju, R.P., Girshick, R., He, K., Dólar, P.: Designing network design spaces. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10428-10436 (2020)
+42. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems 28, 91-99 (2015)
+43. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.C.: Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4510-4520 (2018)
+44. Shen, Z., Zhang, M., Zhao, H., Yi, S., Li, H.: Efficient attention: Attention with linear complexities. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 3531-3539 (2021)
+45. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+46. Srinivas, A., Lin, T.Y., Parmar, N., Shlens, J., Abbeel, P., Vaswani, A.: Bottleneck transformers for visual recognition. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 16519-16529 (2021)
+47. Strudel, R., Garcia, R., Laptev, I., Schmid, C.: Segmenter: Transformer for semantic segmentation. arXiv preprint arXiv:2105.05633 (2021)
+48. Sun, C., Shrivastava, A., Singh, S., Gupta, A.: Revisiting unreasonable effectiveness of data in deep learning era. In: Proceedings of the IEEE international conference on computer vision. pp. 843-852 (2017)
+49. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., Rabinovich, A.: Going deeper with convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1-9 (2015)
+50. Tan, M., Le, Q.: Efficientnet: Rethinking model scaling for convolutional neural networks. In: International Conference on Machine Learning. pp. 6105-6114. PMLR (2019)
+51. Tan, M., Le, Q.V.: Efficientnetv2: Smaller models and faster training. arXiv preprint arXiv:2104.00298 (2021)
+52. Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., Jégou, H.: Training data-efficient image transformers & distillation through attention. In: International Conference on Machine Learning. pp. 10347-10357. PMLR (2021)
+53. Vaswani, A., Ramachandran, P., Srinivas, A., Parmar, N., Hechtman, B., Shlens, J.: Scaling local self-attention for parameter efficient visual backbones. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12894-12904 (2021)
+54. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+
+55. Wang, H., Zhu, Y., Adam, H., Yuille, A., Chen, L.C.: Max-deeplab: End-to-end panoptic segmentation with mask transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5463-5474 (2021)
+56. Wang, W., Xie, E., Li, X., Fan, D.P., Song, K., Liang, D., Lu, T., Luo, P., Shao, L.: Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122 (2021)
+57. Wang, X., Girshick, R., Gupta, A., He, K.: Non-local neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7794-7803 (2018)
+58. Wu, B., Xu, C., Dai, X., Wan, A., Zhang, P., Yan, Z., Tomizuka, M., Gonzalez, J., Keutzer, K., Vajda, P.: Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677 (2020)
+59. Wu, H., Xiao, B., Codella, N., Liu, M., Dai, X., Yuan, L., Zhang, L.: Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808 (2021)
+60. Xiao, T., Dollar, P., Singh, M., Mintun, E., Darrell, T., Girshick, R.: Early convolutions help transformers see better. Advances in Neural Information Processing Systems 34 (2021)
+61. Xiao, T., Liu, Y., Zhou, B., Jiang, Y., Sun, J.: Unified perceptual parsing for scene understanding. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 418-434 (2018)
+62. Xie, S., Girshick, R., Dólár, P., Tu, Z., He, K.: Aggregated residual transformations for deep neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1492-1500 (2017)
+63. Xu, W., Xu, Y., Chang, T., Tu, Z.: Co-scale conv-attentional image transformers. arXiv preprint arXiv:2104.06399 (2021)
+64. Yu, F., Koltun, V.: Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122 (2015)
+65. Yuan, K., Guo, S., Liu, Z., Zhou, A., Yu, F., Wu, W.: Incorporating convolution designs into visual transformers. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 579-588 (2021)
+66. Yuan, L., Chen, Y., Wang, T., Yu, W., Shi, Y., Jiang, Z., Tay, F.E., Feng, J., Yan, S.: Tokens-to-token vit: Training vision transformers from scratch onImagenet. arXiv preprint arXiv:2101.11986 (2021)
+67. Zhang, P., Dai, X., Yang, J., Xiao, B., Yuan, L., Zhang, L., Gao, J.: Multi-scale vision longformer: A new vision transformer for high-resolution image encoding. arXiv preprint arXiv:2103.15358 (2021)
+68. Zhang, Q., Yang, Y.: Rest: An efficient transformer for visual recognition (2021)
+69. Zhang, X., Zhou, X., Lin, M., Sun, J.: Shufflenet: An extremely efficient convolutional neural network for mobile devices. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 6848-6856 (2018)
+70. Zhang, X., Xu, H., Mo, H., Tan, J., Yang, C., Wang, L., Ren, W.: Dcnas: Densely connected neural architecture search for semantic image segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13956-13967 (2021)
+71. Zheng, M., Gao, P., Zhang, R., Li, K., Wang, X., Li, H., Dong, H.: End-to-end object detection with adaptive clustering transformer. arXiv preprint arXiv:2011.09315 (2020)
+72. Zhou, B., Zhao, H., Puig, X., Xiao, T., Fidler, S., Barriuso, A., Torralba, A.: Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision 127(3), 302-321 (2019)
+
+73. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J.: Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159 (2020)
\ No newline at end of file
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/images.zip b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cbf551990e153579b28c1ce4713da2d89037c132
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67583f24b7fdc85004c92b90323ce321cc61c97c230d65edfd03001797c787be
+size 547737
diff --git a/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/layout.json b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d562f508f062d7e6beea40626733a00cbd511a32
--- /dev/null
+++ b/convolutionalembeddingmakeshierarchicalvisiontransformerstronger/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d32e66dd709a5be86ff4d3e6254046365fb4d770a7328c9bcf775524722c69cd
+size 433254
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_content_list.json b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..90b266090cb5d59b6160e45826016279b9a36579
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af82eb91f5baccb3766954e4400e3aa39ccda8b453232e891224f3c3e96e7ef9
+size 79070
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_model.json b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..6ccc3484cce3818a8b42e79fbc40472ca9e63f5c
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:454d3e356fb6d5477ad2f60b8eeaf0fe193d067b19b995bbddee5e9426f832fe
+size 95627
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_origin.pdf b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0d5af71517eb5add9edb38cf3b6cdd1f97b2ec00
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/9ce7eb5b-8f45-43a7-ba51-d630d39df0da_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4d82a012576a39c53cc5f835447be1a5cc1ef5e05c857ee39fee113310a286c
+size 2258270
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/full.md b/cornerformerpurifyinginstancesforcornerbaseddetectors/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8f31da4e90b391a545c9a85afcf1f627ea1fbfe7
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/full.md
@@ -0,0 +1,285 @@
+# Cornerformer: Purifying Instances for Corner-based Detectors
+
+Haoran Wei $^{1,\star}$ , Xin Chen $^{2}$ , Lingxi Xie $^{2}$ , and Qi Tian $^{2}$
+
+1 University of Chinese Academy of Sciences
+2 Huawei Inc.
+weihaoran18@mails.ucas.ac.cn
+{chenxin061,198808xc}@gmail.com
+tian.qi1@huawei.com
+
+Abstract. Corner-based object detectors enjoy the potential of detecting arbitrarily-sized instances, yet the performance is mainly harmed by the accuracy of instance construction. Specifically, there are three factors, namely, 1) the corner keypoints are prone to false-positives; 2) incorrect matches emerge upon corner keypoint pull-push embeddings; and 3) the heuristic NMS cannot adjust the corners pull-push mechanism. Accordingly, this paper presents an elegant framework named Cornerformer that is composed of two factors. First, we build a Corner Transformer Encoder (CTE, a self-attention module) in a 2D-form to enhance the information aggregated by corner keypoints, offering stronger features for the pullpush loss to distinguish instances from each other. Second, we design an Attenuation-Auto-Adjusted NMS (A $^3$ -NMS) to maximally leverage the semantic outputs and avoid true objects from being removed. Experiments on object detection and human pose estimation show the superior performance of Cornerformer in terms of accuracy and inference speed.
+
+Keywords: Object detection, Corner-based, Corner Transformer encoder, Attenuation-Auto-Adjusted NMS
+
+# 1 Introduction
+
+Object detection, which aims to localize and classify objects of interest in an image, is an active and fundamental research direction in computer vision. Current state-of-the-art detectors can be roughly classified into two categories, i.e., anchor-based [13,14,3,26,31,23] and anchor-free. Recently, anchor-free detectors [20,43,11,9,37,42] have become a research hotspot due to its flexibility and efficiency, among which, corner-based detector (e.g., CornerNet [20] and its variants [11,9]) is one of the most popular flowchats.
+
+One key factor of corner-based detectors is how to construct instances from corner points. CornerNet [20] proposed a corner pooling module using a serial operation of maximize-and-merge operations to enhance corner features, and applied a grouping method upon pull-push loss [28,20] to formulate corner points
+
+
+Fig. 1. Three problems of instance construction in corner-based detectors. (a) Boundries of nearby objects may coincide with each other, resulting in high-score false positives that belong to no object (red “×” upon the top-left corner). (b) The pull-push mechanism is prone to confusing highly similar keypoints that belongs to different objects, so as to produce predictions across objects (red and yellow bounding boxes). Here we show an extreme case that objects are identical. (c) The commonly used Soft-NMS improperly decays lower-scored bounding box of two overlapped objects to be removed in visualization (lower than 0.5-score).
+
+into instances (bounding boxes), which minimize embedding distances of corner keypoints that belong to the same object and maximize those of different ones. To further enhance the correctness of corner grouping, CenterNet [11] introduced center points to filter false matched bounding boxes, while CentripetalNet [9] abandoned the 1D pull-push embeddings and presented a centripetal grouping method with a 2D-embedding form to better group paired corners.
+
+As mentioned above, the correctness of corner grouping is one of the key factors in corner-based detectors. Although great progress has been made by previous methods [20,11,9] in corner matching, it is still an urgent demand to further improve the correctness and accuracy of instance construction of corner-based detectors. We believe the key factors that obstruct better instance construction lie in the following three aspects: 1) Corner keypoints are prone to false-positives due to boundary confusion that may largely disturb subsequent steps in the pipeline and produce inferior results (Figure 1(a)). 2) Incorrect matches emerge upon corner keypoint pull-push embeddings, resulting in irregular detection boxes, e.g., boxes containing multiple objects (Figure 1(b)). 3) The heuristic NMS cannot adjust the corners pull-push mechanism due to its fixed decay factor setting and thus falsely discarding overlapped instances (Figure 1(c)).
+
+Accordingly, we propose a Cornerformer framework that composed of two main modules, i.e., a Corner Transformer Encoder (CTE, a self-attention module) and an Attenuation-Auto-Adjusted NMS (A $^3$ -NMS), to efficiently address above stated drawbacks of corner-based detectors. Specifically, the CTE module is designed to be a 2D-Transformer, which can better capture nearby boundary information of a corner location with the help of self-attention mechanism, so as to effectively alleviate the boundary confusion problem and decrease false
+
+positive keypoints. Additionally, we implant multiple positional encodings into CTE, which makes CTE position-sensitive and dramatically enhance the distinguishing ability on similar keypoints from different objects. An $\mathrm{A}^3$ -NMS is a hyper-parameter-free Soft-NMS that can dynamically adjust attenuation weights of boxes to maximally leverage the semantic outputs and avoid true objects from being removed. Thus, the $\mathrm{A}^3$ -NMS is more suitable for the scenario of the corner pull-push mechanism than a vanilla Soft-NMS [2] that has a fixed decay weight.
+
+Experimental results on MS-COCO [24] object detection, and both MS-COCO and CrowdPose [22] human pose estimation show that after equipping with the proposed Cornerformer, state-of-the-art corner-based detectors enjoy a consistent performance improvement in terms of accuracy and inference speed. Taking the classic CornerNet baseline as an example, after replacing corner pooling and Soft-NMS with CTE and $\mathrm{A}^3$ -NMS in Cornerformer, we obtain a satisfactory accuracy boosting of $3.0\%$ in terms of AP and an inference speed lifting of 2.5 FPS.
+
+# 2 Related work
+
+The success of deep neural networks (DNNs) [21,19] has largely promoted the development of object detection. Modern DNNs-based detectors can be simple divided into two categories: anchor-based [13,14,3,26,31,23] and anchor-free [20,43,11,9,37,42].
+
+# 2.1 Anchor-based Detector
+
+The anchor box is used to match a ground truth box and acts as a guidance for detectors to regress object bounding box. In Faster R-CNN [33], the design of anchor-based RPN made detectors end-to-end trainable. Later, anchor boxes were widely used in RPN-based two-stage detectors [13,33,41,14,3,27]. To further explore the efficiency of models, some anchor-based one-stage detectors [34,26,31,36,23,32] also appeared. They remove the RPN-stage and directly regress and classify anchor boxes. Despite the great success of the anchor mechanism, it also brings some drawbacks, e.g., excessively many hyper-parameters, unstable IoU-based ( $>0.7$ ) positives selection strategy, and complex network structure. These drawbacks drive the community to study anchor-free detection methods.
+
+# 2.2 Anchor-free Detector
+
+Anchor-free object detection is a very active research field in recent years. CornerNet [20] was the first keypoint-based approach, which predicted keypoints via generating and parsing heatmaps, and detected objects by predicting and grouping pairs of corner points. CenterNet [11] added a prediction branch of center points based on CornerNet settings, transforming corner matching into triplet matching. Upon CornerNet, CentripetalNet [9] proposed a new centripetal
+
+grouping algorithm and achieved state-of-the-art performance. Besides, FCOS [37] proposed a dense regression anchor-free detector. It treats lots of pixels in bounding boxes as positive samples and directly regresses bounding boxes. Compared with anchor-based approaches, anchor-free methods enjoy flexibility and efficiency. However, the limitations of local modeling in CNN hinder its development.
+
+Transformer is first proposed in natural language processing [38]. Compared with CNN, Transformer in plants self-attention mechanism into its basic operator, which is more suitable for capturing long-range contexts than convolution. Due to its superb ability, Transformers were introduced into computer vision [10,5,44,25] and soon leveraged in object detection. DETR [5] introduced Transformer [38] into object detection task for the first time, which eliminated many hand-craft modules (e.g., anchor, NMS, and proposals) in previous detectors, and achieved on-par performance compared to classical CNN-based Faster R-CNN. Based on DETR, WB-DETR [25] replaced the ResNet [15] backbone with ViT [10] (a Transformer-based recognition system) to obtain a pure-Transformer detection system, making the detection pipeline neater.
+
+Inspired by DETR, we explore how to integrate Transformer into keypoint-based detectors to improve the quality of instance construction.
+
+# 3 Preliminary: The CornerNet Baseline
+
+CornerNet utilizes heatmaps generated by the backbone to estimate corner keypoints and uses the pull-push loss to group embedding pairs. To refine corner coordinates extracted from heatmaps, CornerNet predict extra offsets. The pipeline of CornerNet is similar to the pipeline shown in Figure 2, with a corner pooling module replacing the CTE module, and a Soft-NMS module replacing the A $^3$ -NMS module.
+
+CornerNet applies a modified pixel-level focal loss [23] as the training objective for heatmaps of paired corners. The backbone with output stride brings about discretization error in the process of remapping corner locations. To address this problem, CornerNet additionally regress offsets to refine corner coordinates.
+
+The Associative Embedding [28] method is applied for paired corner matching. More specifically, the "pull" loss is leveraged to group paired corners and the "push" loss to separate irrelevant corners:
+
+$$
+\mathcal {L} _ {p u l l} = \frac {1}{N} \sum_ {k = 1} ^ {N} \left[ \left(e _ {t _ {k}} - e _ {k}\right) ^ {2} + \left(e _ {b _ {k}} - e _ {k}\right) ^ {2} \right], \tag {1}
+$$
+
+$$
+\mathcal {L} _ {p u s h} = \frac {1}{N (N - 1)} \sum_ {k = 1} ^ {N} \sum_ {\substack {j = 1 \\ j \neq k}} ^ {N} \max \left(0, \Delta - | e _ {k} - e _ {j} |\right), \tag{2}
+$$
+
+where $e_k$ is the average of $e_{t_k}$ and $e_{b_k}$ and $\Delta$ is set to be 1. Pull-push loss is only applied at ground-truth corner locations [20].
+
+
+Fig. 2. The architecture of Cornerformer. A Cornerformer, composed of a CTE (Corner Transformer Encoder) module, keypoint grouping components, and an $\mathrm{A}^3$ -NMS module, takes image features extracted by the backbone as input, and generates predicted bounding boxes (paired corner keypoints) as output. The CTE, as a replacement of corner pooling module in CornerNet, captures contextual information and predicts corner keypoints (embeddings) more precisely from input feature maps. $\mathrm{A}^3$ -NMS is an improved NMS, which can maximally avoid true objects from being removed and is no longer restricted by manually set hyper-parameters.
+
+Our Cornerformer is built upon the CornerNet baseline (or its variants, i.e., CenterNet and CentripetalNet). In the rest of this paper, we apply the same settings used in corresponding baselines unless otherwise specified. For more details, please refer to the original papers [20,11,9].
+
+# 4 Cornerformer
+
+# 4.1 Towards Better Instance Construction
+
+As stated in Section 1, there are three critical factors that hinder a better instance construction in corner-based object detection. Here we carry out a case analysis incorporating with Figure 1 to further dissect them. 1) Corner keypoints are prone to false-positives due to boundary confusion. As shown in Figure 1 (a). The top-most boundary of "teddy bear 2" and the left-most boundary of "teddy bear 1" coincides with each other, which will result in a high-score false estimation that neither belongs to "teddy bear 1" nor "teddy bear 2". Such needless keypoints will largely affect subsequent procedures and produce deteriorative predictions. 2) Incorrect matches emerge upon corner keypoints pull-push embeddings. The pull-push mechanism naturally lacks ability of distinguishing highly similar keypoints that belong to different objects, so that corner keypoints of different objects with similar appearances may be mistakenly grouped together. We show an extreme example that the input is generated by copy-and-paste the same image in Figure 1 (b). The pre
+
+dicted bounding boxes (red and yellow) are unnaturally composed of two different instances. 3) The heuristic NMS cannot adjust the corners pull-push mechanism. The commonly used Soft-NMS decays scores of overlapped bounding boxes with a fixed value, which may cause true detection boxes of overlapped objects being removed in visualization, as shown in Figure 1 (c).
+
+Accordingly, we propose Cornerformer to address above stated problems of corner-based detectors in instance construction. As shown in Figure 2, Cornerformer is built upon a corner-based detector as baseline, e.g., CornerNet [20] or CenterNet [11]. A Cornerformer consists of two main components, i.e., a Corner Transformer Encoder (CTE) used to provide better corner features and lift the quality of pull-push embeddings, and an Attenuation-Auto-Adjusted NMS (A $^3$ -NMS) used to maximally leverage the semantic outputs and avoid true objects from being removed. In the following, we delve into each part of Cornerformer and show how it helps a better instance construction.
+
+# 4.2 Corner Transformer Encoder
+
+Overview of the CTE. Corner Transformer Encoder (CTE) runs as a corner features enhancing module in Cornerformer. Corners often lay outside an object without explicit existent evidence, which needs feature enhancement via boundary contexts (the top-most, bottom-most, left-most, and right-most of an object). The CornerNet baseline applies a corner pooling module to enhance the visual reasoning of corners. However, corner pooling uses a serial operation of maximize-and-merge to extend corner information, suffering inefficient context around corner keypoints. As a special case, when a spatial location has similar boundary conditions, it is likely to be a high-score false corner estimation due to boundary confusion, as shown in Figure 1 (a). In addition, there is no optimization for pull-push embeddings in corner pooling, so that the pull-push mechanism may gather wrong corner pairs that have highly similar corner embeddings, as shown in Figure 1 (b). To this end, we propose CTE to better estimate and group target corners.
+
+Position-aware Criss-Cross attention. To capture rich boundary contexts, the corner estimation module needs to look over information around potential corner keypoints, i.e., horizontal and vertical possible spatial locations related to boundaries. Thus, we naturally adopt the self-attention mechanism to capture rich information around potential corners. More specifically, for one query element $q$ in image features, the corresponding keys $(k)$ are sampled in the same row and column. It is notable that convolution can also capture information from a nearby area, but handling a larger area corresponding to a large object requires to stack more convolutional layers, which brings potential computational burdens.
+
+As shown in Figure 2, we adopt the Position-aware Criss-Cross Attention (PCCA) as the self-attention module, which is designed upon CCA [16] and enhanced with positional encoding. Vanilla CCA is used only to capture contextual information in horizontal and vertical directions for using light-weight computation and memory, which we find suitable for capturing boundary contextual
+
+
+Fig. 3. Comparison of NMS, Soft-NMS, and $\mathrm{A}^3$ -NMS. Soft-NMS uses a fixed decay weight value $(\sigma)$ in both the scenario of decaying redundant boxes, where $\sigma$ should be as large as possible to remove redundant boxes, and the scenario of overlapped objects, where $\sigma$ should be as small as possible to retain bounding boxes of different objects. In contrast, our $\mathrm{A}^3$ -NMS accomplishes an adaptive decay ratio upon embeddings to effectively address such scenarios.
+
+
+
+information for corner keypoints. To further alleviate the false-positive problem of similar features, we equip a positional encoding [5] in "Q" and "K" of the original CCA to create a new Position-aware CCA. The positional encoding is as follows:
+
+$$
+\left\{ \begin{array}{l} \mathrm {P E} (p o s, 2 i) = \sin (p o s / 1 0 0 0 0 ^ {2 i / d}) \\ \mathrm {P E} (p o s, 2 i + 1) = \cos (p o s / 1 0 0 0 0 ^ {2 i / d}), \end{array} \right. \tag {3}
+$$
+
+where $pos$ means the position, $i$ indicates the channel ID, and $d$ is 128 representing the total number of dimensions.
+
+Settings of Transformer blocks. One Transformer block in CTE is composed of a PCCA (as the self-attention module) and a $1 \times 1$ convolutional layer (as the feed forward network, FFN). Different from the vanilla 1D-Transformer block [5] that expects a sequence as input, the CTE is a 2D-form Transformer which can take 2D image features as input directly. We also find that multiple Transformer blocks in series can generate more robust features for corner estimation.
+
+Optimizing pull-push embeddings. We use the pull-push loss to group corner pairs, as mentioned in Section 3. The pull-push loss utilizes a self-supervised way to "pull" embeddings of corresponding corners and "push" irrelevant ones upon object features. When there are more than one objects with similar appearance in an image, as shown in Figure 1 (b), the pull-push loss fails to distinguish different instances effectively. Thus, except for richer contexts embedded in corner keypoints, we further insert a global positional encoding after Transformer blocks to make CTE position-sensitive, so that the pull-push loss can better distinguish if a pair of corners that have similar feature responses belong to the same instance.
+
+# 4.3 Attenuation-Auto-Adjusted NMS
+
+Overview of the $\mathbf{A}^3$ -NMS. The heuristic Non-Maximum Suppression (NMS) has become the de-facto standard applied to suppress and filter out false-positives for detectors. The original NMS cannot solve the problem of largely overlapped objects. Soft-NMS addresses such problem by softening the suppression process with a score decay mechanism. The most commonly used decay function is as follows:
+
+$$
+W _ {i o u (M, b _ {i})} = \exp \left(- \frac {i o u (M , b _ {i}) ^ {2}}{\sigma}\right) \tag {4}
+$$
+
+where $M$ is the highest score of box, $b_{i}$ indicates the current box. $\sigma$ is a hyperparameter often set to be 0.5.
+
+However, Soft-NMS still lacks flexibility because of its fixed $\sigma$ value. As long as the IoU of two bounding boxes is the same, Soft-NMS decays the lower-scored one to the same score, whatever the scenario is overlapped instances or duplicated bounding boxes. To address such a limitation, we design the A $^3$ -NMS that introduces adjustable attenuation and relies on no manually set hyperparameters to flexibly handle both cases of duplicated boxes and overlapped instances.
+
+Adjust attenuation upon embeddings. To address the above problem, $\mathrm{A}^3$ -NMS applies a dynamic adjusted decay function as following:
+
+$$
+W _ {i o u (M, b _ {i})} = \exp (- \frac {i o u (M , b _ {i}) ^ {2}}{f (| e _ {M} - e _ {i} |)}) \tag {5}
+$$
+
+where $e_M$ and $e_i$ are embeddings of corresponding boxes. $M$ represents the max-score box. $f$ is a function to smooth embedding distance between $e_M$ and $e_i$ , and in this case we use the tanh function. We take mean value of paired corner embeddings as box embedding, i.e., $e_M$ or $e_i$ . Thus, we can easily obtain distance of bounding boxes by calculating vector distance of their box embeddings. Since paired corners or boxes are grouped via the pull-push mechanism in corner-based detectors, the distance of box embeddings should be small if two boxes belong to the same instance, while it should be large if two boxes belong to different objects. The fixed $\sigma$ in Eqn. (4) becomes a dynamic value learned by the network in Eqn. (5) so that the adjusted attenuation factor can well fit each situation. We plot curves of the decay function of different versions of NMS in Figure 3, from which we can easily find that $A^3$ -NMS can efficiently handle such scenarios.
+
+More specifically, $\mathrm{A}^3$ -NMS runs in post-processing, and $(e_M, e_i)$ are a pair of self-adjusted embeddings for the corresponding boxes, which belong to the side outputs of corner-based detectors. They contain useful information that measures the closeness of two detection boxes. That said, the smaller $f(|e_M - e_i|)$ is, the more similar $b_i$ and $b_M$ are, and thus the heavier $b_i$ is suppressed. Compared to Soft-NMS that relies on a fixed factor $\sigma$ , such a mechanism is more flexible and accurate.
+
+Table 1. Performance comparison (\%) with state-of-the-art detectors on MS COCO test-dev. DR and KB are abbreviations of dense regression and keypoint-based, respectively. $\times 2$ means that two Corner Transformer Encoders without parameters sharing are used for the top-left and bottom-right corners, respectively. Blue up-arrows indicate the improved values compared with baselines. * indicates multi-scale testing. Input resolution represents training input size.
+
+| Method | Backbone | Input Size | \(AP_{50}\) | \(AP_{75}\) | \(AP_S\) | \(AP_M\) | \(AP_L\) | AP | FPS |
| Two-stage: |
| Cascade R-CNN [3] | ResNet-101 | 1333 × 800 | 62.1 | 46.3 | 23.7 | 45.5 | 55.2 | 42.8 | - |
| Sparse R-CNN [35] | ResNeXt-101 | 1333 × 800 | 66.3 | 51.2 | 28.6 | 49.2 | 58.7 | 46.9 | - |
| CPN [12] | Hourglass-104 | 1333 × 800 | 65.0 | 51.0 | 26.5 | 50.2 | 60.7 | 47.0 | 5.2 |
| One-stage, anchor-based: |
| RetinaNet [23] | ResNeXt-101 | 1333 × 800 | 61.1 | 44.1 | 24.1 | 44.2 | 51.2 | 40.8 | 5.4 |
| YOLOv4 [1] | CSPDarkNet-53 | 608 × 608 | 65.7 | 47.3 | 26.7 | 46.7 | 53.3 | 43.5 | - |
| ATSS [40] w/ DCN [8] | ResNet-101 | 1333 × 800 | 64.7 | 50.4 | 27.7 | 49.8 | 58.4 | 46.3 | 8.4 |
| One-stage, anchor-free (DR) |
| FoveaBox [18] | ResNeXt-101 | 1333 × 800 | 61.9 | 45.2 | 24.9 | 46.8 | 55.6 | 42.1 | 5.1 |
| FCOS [37] | ResNeXt-101 | 1333 × 800 | 62.1 | 45.2 | 25.6 | 44.9 | 52.0 | 42.1 | 7.3 |
| Reppoints [39] w/ DCN | ResNet-101 | 1333 × 800 | 66.1 | 49.0 | 26.6 | 48.6 | 57.5 | 45.0 | 8.7 |
| One-stage, anchor-free (KB) |
| ExtremeNet [43] | Hourglass-104 | 511 × 511 | 55.5 | 43.2 | 20.4 | 43.2 | 53.1 | 40.2 | 3.1 |
| CenterNet [42] | Hourglass-104 | 512 × 512 | 61.1 | 45.9 | 24.1 | 45.5 | 52.8 | 42.1 | 7.8 |
| CornerNet [20] | Hourglass-104 | 511 × 511 | 56.5 | 43.1 | 19.4 | 42.7 | 53.9 | 40.5 | 4.1 |
| CornerNet w/ Cornerformer | Hourglass-104 | 511 × 511 | 61.2 | 46.2 | 21.5 | 44.8 | 56.5 | 42.6 ↑ 2.1 | 7.4 |
| CornerNet w/ Cornerformer×2 | Hourglass-104 | 511 × 511 | 61.7 | 46.8 | 22.3 | 45.6 | 57.1 | 43.5 ↑ 3.0 | 5.6 |
| CenterNet [11] | Hourglass-104 | 511 × 511 | 62.4 | 48.1 | 25.6 | 47.4 | 57.4 | 44.9 | 3.3 |
| CenterNet w/ Cornerformer | Hourglass-104 | 511 × 511 | 63.0 | 49.7 | 26.0 | 48.6 | 59.3 | 46.1 ↑ 1.2 | 5.9 |
| CenterNet w/ Cornerformer×2 | Hourglass-104 | 511 × 511 | 64.3 | 50.2 | 27.1 | 49.5 | 59.2 | 46.8 ↑ 1.9 | 4.8 |
| CenterNet w/ Cornerformer×2* | Hourglass-104 | 511 × 511 | 64.9 | 51.4 | 28.8 | 50.1 | 59.5 | 47.7 | - |
| CentripetalNet [9] | Hourglass-104 | 511 × 511 | 63.1 | 49.7 | 25.3 | 48.7 | 59.2 | 46.1 | 3.4 |
| CentripetalNet w/ Cornerformer | Hourglass-104 | 511 × 511 | 64.5 | 50.3 | 26.2 | 49.4 | 59.6 | 47.1 ↑ 1.0 | 6.5 |
| CentripetalNet w/ Cornerformer×2 | Hourglass-104 | 511 × 511 | 64.6 | 50.6 | 26.7 | 49.5 | 59.9 | 47.4 ↑ 1.3 | 5.0 |
| CentripetalNet w/ Cornerformer×2* | Hourglass-104 | 511 × 511 | 65.4 | 51.8 | 28.9 | 50.8 | 60.2 | 48.5 | - |
+
+# 5 Experiments
+
+# 5.1 Datasets, Metrics, and Implementation Details
+
+Object detection. We evaluate the effectiveness of the proposed Cornerformer on COCO [24] dataset. COCO is a large-scale and challenging benchmark in object detection, which contains 80 categories and more than 1.5 million object instances. We train all models on the train2017 and carry out all ablations with val2017. We compare with other state-of-the-art methods using the test-dev. Besides, there are few heavily occluded objects in MS-COCO.
+
+Besides, to better support our claim, we conduct additional ablation experiments on Citypersons [7] (a pedestrian detection dataset). Citypersons contains six different labels, i.e., ignore regions, pedestrians, riders, sitting persons, other persons with unusual postures, and group of people. We keep and merge the labels of pedestrians and riders that accounts a large proportion in vanilla data. There are 18204 persons in 2471 images on our processed training set. We show
+
+the performance of the proposed Cornerformer on the validation set that contains 439 images and 3666 persons.
+
+Human pose estimation. To further test the generalization ability of the proposed CTE, we integrate it into the bottom-to-up human pose estimation model, HigherHRNet [6]. We evaluate the effectiveness of the CTE module on both COCO dataset, which contains $250k$ person instances labeled with 17 keypoints, and Crowdpose dataset [22], which contains more crowded scenes.
+
+Metrics. We use the AP (average precision) metric to measure performance of both object detection and human pose estimation. AP in object detection (COCO) is computed over ten different IoU thresholds (i.e., 0.5:0.05:0.95) and all categories, which is considered as the most important metric on the object detection task. For Citypersons, since the annotation (bounding box) is not as precise as COCO, the AP under a high IoU is meaningless, so we only test the AP with 0.5 IoU. Instead of IoU, the AP used in human pose estimation task is computed upon Object Keypoint Similarity (OKS): OKS = $\frac{\sum_{i} \exp(-d_{i}^{2} / 2s^{2}k_{i}^{2})\delta(v_{i} > 0)}{\sum_{i}\delta(v_{i} > 0)}$
+
+Here, $d_{i}$ represents the Euclidean distance between a detected keypoint and its corresponding ground truth, $v_{i}$ is the visibility flag of the ground truth, $s$ is the object scale, and $k_{i}$ is a per-keypoint constant that controls falloff [6].
+
+Training details. We follow settings of corner-based models to train new detector equipped with the proposed Cornerformer on 16 NVIDIA RTX 3090 GPUs. Standard cropping, horizontal flipping, and color jittering are employed as data augmentation. All models are fine-tuned from the pre-trained Hourglass [20] backbone with randomly initialized Cornerformer layers for $250k$ iterations with a batch size of 64. The learning rate is set to $2.5e-4$ and dropped $10\times$ at $200k$ iteration. An Adam [17] optimizer is applied to optimize model parameters. For human pose estimation task, we choose the HigherHRNet [6] as baseline and follow its training settings.
+
+Inference details. We test inference speed of baseline models and their Cornerformer variants on a workstation with an NVIDIA Titan XP GPU. To guarantee a fair comparison with baselines, We strictly follow test settings of corresponding baselines.
+
+# 5.2 Object Detection Results
+
+We implant the proposed Cornerformer into several classical corner-based detectors, e.g., CenterNet [20], CenterNet [11], and CentripetalNet [9], and evaluate the effectiveness of our design via performance comparisons, in terms of accuracy and inference speed.
+
+Comparison on accuracy. As shown in Table 1, CornerNet [20] with Cornerformer improved by $2.1\%$ on AP (from $40.5\%$ to $42.6\%$ ), which shows the advantage of the proposed Cornerformer on better construct instances. For large objects, $\mathrm{AP_L}$ increases from $53.9\%$ to $56.5\%$ , which is arguably owing to the feasibility of CTE to well capture long-range contexts. As shown in Figure 4, the corners estimated by Cornerformer are more precise. For CenterNet [11] baseline, Cornerformer also brings it a decent promotion of $1.2\%$ on AP. For
+
+
+
+
+
+
+CornerNet w/ corner pooling
+
+
+Fig. 4. Corner estimation visualized comparison of corner pooling and the proposed Corner Transformer Encoder. Compared with corner pooling, CTE can reduce false-positive points which have confused boundary visual appearances.
+
+
+
+
+
+
+CornerNet w/ CTE
+
+
+
+CentripetalNet [9] which does not use pull-push embeddings, we add a branch to obtain pull-push embeddings to apply the whole Cornerformer and harvest an improvement of $1.0\%$ , proving our Cornerformer is very solid.
+
+A single CTE in Cornerformer can capture both horizontal and vertical boundary information to enhance both top-left and bottom-right corners features. Under this setting, top-left and bottom-right corners share the same set of learned parameters, which may limit the representative power. To better distinguish different type of corners (top-left and bottom-right), we use two individual CTEs (represented as Cornerformer $(\times 2)$ ) to further test its ability. As we can see in Table 1, Cornerformer $(\times 2)$ , obtains improvements of $3.0\%$ , $1.9\%$ , and $1.3\%$ upon CornerNet, CenterNet, and CentripetalNet baselines, respectively, further demonstrating the effectiveness of the proposed Cornerformer.
+
+Comparison on inference speed. We also compare the inference speed of our method with baselines. As illustrated in Table 1, the inference speed of CornerNet with Cornerformer is 7.4 FPS, which is 3.3 FPS faster than the vanilla CornerNet using corner pooling. Besides, CenterNet with Cornerformer as well as CentripetalNet with Cornerformer is also more efficient than its baseline. It's worth noting that even if equipped with two CTEs, the inference speed is still faster than those corner pooling counterparts. The major speedup is brought by replacing corner pooling (a serial operation that requires a for loop) with CTE that is computed in parallel.
+
+# 5.3 Pose Estimation Results
+
+A Cornerformer is consisted of CTE and A $^3$ -NMS, where CTE is used to enhance the corner features and improve the pull-push grouping as mentioned in Section 4.2. CTE is made up of multiple Transformer blocks and when stacking multiple blocks, a CTE is able to capture global contexts. Besides, CTE is
+
+
+HigherHRNet
+
+
+HigherHRNet w/ CTE
+Fig. 5. Effectiveness of CTE in human pose estimation. Here we apply an extreme case - copy-and-paste the same object. HigherHRNet with CTE (right column) can distinguish local responses with similar visual appearances in different locations, making the pull-push grouping more reasonable, while the original HigherHRNet failed.
+
+Table 2. Performance comparison of bottom-to-up human keypoint estimators on COCO test-dev. The CTE brings an improvement of $0.8\%$ in terms of AP upon the HigherHRNet baseline.
+
+| Method | AP | \( AP_{50} \) | \( AP_{75} \) | \( AP_M \) | \( AP_L \) |
| OpenPose [4] | 61.8 | 84.9 | 67.5 | 57.1 | 68.2 |
| Hourglass [28] | 65.5 | 86.8 | 72.3 | 60.6 | 72.6 |
| SPM [29] | 66.9 | 88.5 | 72.9 | 62.6 | 73.1 |
| PersonLab [30] | 68.7 | 89.0 | 75.4 | 64.1 | 75.5 |
| HigherHRNet [6] | 70.5 | 89.3 | 77.2 | 66.6 | 75.8 |
| HigherHRNet w/ CTE | 71.3 | 90.1 | 78.0 | 67.2 | 76.9 |
+
+designed to be position-sensitive and pull-push-enhanced, so that it can better distinguish between similar appearances from different locations. Accordingly, we apply CTE to bottom-to-up human keypoints estimator. To test this conjecture, we take HigherHRNet [6] as the baseline. As shown in Table 2 and 3, HigherHRNet with Cornerformer gains an improvement of $0.8\%$ and $1.3\%$ on COCO and Crowdpose, respectively. Such improvements show that Cornerformer is effective not only for the corner-based detectors, but also for human pose estimation tasks. As shown in Figure 5, we copy-and-paste an image to visualize the effectiveness of Cornerformer on improving pull-push grouping. We can see that HigherHRNet cannot distinguish objects that have the same characteristics in different locations. CTE can overcome such problems, making the pull-push grouping more reasonable, further proving the position-sensitive CTE can make more accurate keypoint estimation.
+
+# 5.4 Ablation Study
+
+In this section, we conduct ablation analyses on COCO val2017 mainly for object detection and partially for human pose estimation. We mainly utilize CornerNet [20] as the baseline and use a single CTE for Cornerformer.
+
+Table 3. Comparison on Crowdpose test dataset. Superscripts E, M, and H of AP stand for easy, medium and hard. The CTE brings an improvement of $1.3\%$ in terms of AP upon the HigherHRNet.
+
+| Method | AP | AP50 | AP75 | APE | APM | APH |
| HigherHRNet [6] | 67.6 | 87.4 | 72.6 | 75.8 | 68.1 | 58.9 |
| HigherHRNet [6] w/ CTE | 68.9 | 88.9 | 73.5 | 77.2 | 69.6 | 60.3 |
+
+Table 4. Effectiveness of Cornerformer. We compare the performance of CTE and $\mathrm{A}^3$ -NMS with the original corner pooling and Soft-NMS on COCO val split and Citypersons to validate the effectiveness of the proposed Cornerformer. CP represents corner pooling. $\mathrm{AP}_{\mathrm{c}}$ means the AP gained on Citypersons.
+
+| CTE | CP | A3-NMS | Soft-NMS | AP | AP50 | AP75 | APc |
| × | × | × | ✓ | 36.9 | 52.2 | 38.9 | - |
| × | ✓ | × | ✓ | 39.1 | 54.4 | 40.1 | 29.1 |
| ✓ | × | × | ✓ | 40.8 | 56.5 | 43.6 | 40.3 |
| ✓ | × | ✓ | × | 41.3 | 57.2 | 44.1 | 45.4 |
+
+Effectiveness of the Cornerformer. In this part, we compare CTE and $\mathrm{A}^3$ -NMS with corner pooling (presented as CP in Table 4) and Soft-NMS, respectively, to validate the effectiveness of components in Cornerformer. As shown in Table 4, CTE achieves a $1.7\%$ improvement compared to corner pooling. Compared with corner pooling, CTE can distinguish different corner positions with similar boundary visual appearances, while corner pooling fails. When we utilize $\mathrm{A}^3$ -NMS to replace Soft-NMS, a consistent improvement of $0.5\%$ on AP is obtained on COCO and $5.1\%$ AP gains on Citypersons, which validates the effectiveness of $\mathrm{A}^3$ -NMS on preventing overlapped object boxes from being falsely decayed. Compared with the baseline ( $36.9\%$ on COCO and $29.1\%$ on Citypersons), the Cornerformer ( $\mathrm{CTE + A}^3$ -NMS) counterpart improves detection performance by $4.4\%$ and $16.3\%$ respectively. Besides, for Citypersons, compared with commonly used benchmarks, e.g., Faster-RCNN ( $25.0\%$ on AP) and RetinaNet ( $27.9\%$ on AP), CornerNet equipped with Cornerformer can obtain a large improvement ( $45.4\%$ on AP), further demonstrating the effectiveness of the proposed Cornerformer firmly.
+
+Positional encoding in CTE. We embed positional encoding in self-attention module of CTE to help a model better distinguish corners with similar boundary features in the same row or column. Besides, to help the model "pull" or "push" corners better, we embed an additional positional encoding of full image in the output of CTE, as shown in Figure 2. We conduct experiments to test if these designs are resultful. As shown in Table 5, PCCA (with a positional encoding upon CCA) is $0.8\%$ higher than CCA. Further embedding an additional positional encoding (represented as PE) in the output of CTE brings another
+
+Table 5. Effectiveness of positional encoding. CCA is the original Criss-Cross attention [16]. PCCA is the proposed position-aware CCA. PE represents the positional encoding embedded in the output of Corner Transformer Encoder. All results are obtained with COCO val split.
+
+| CCA | PCCA | PE | AP | \( AP_{50} \) | \( AP_{75} \) | \( AP_S \) | \( AP_M \) | \( AP_L \) |
| ✓ | × | × | 39.3 | 54.9 | 40.0 | 19.1 | 40.9 | 52.7 |
| × | ✓ | × | 40.1 | 55.6 | 42.9 | 19.4 | 41.5 | 53.0 |
| × | ✓ | ✓ | 40.8 | 56.5 | 43.6 | 19.6 | 42.1 | 53.4 |
+
+0.7% performance gain. The above results prove the significance of positional encoding for corner predicting and grouping.
+
+Table 6. Effects on number of CTE blocks. We verify that how many blocks of CTE are reasonable for different tasks on COCO val split.
+
+| Number of CTE Blocks | 0 | 1 | 2 | 3 | 4 |
| CornerNet [20] w/ CTE (AP) | 36.9 | 38.7 | 39.9 | 40.8 | 40.4 |
| HigherHRNet [6] w/ CTE (AP) | 67.1 | 67.5 | 68.2 | 67.7 | - |
+
+Number of CTE blocks. To validate the influence of the number of CTE blocks, we conduct experiments to test performance with different number of CTE blocks. As shown in Table 6, three CTE blocks is the best for object detection [20]. The reason that 4 CTE blocks brings slight performance drop compared to 3 may lie in insufficient training duration or data samples.
+
+Besides, we further observe the performance on human pose estimation with respect to the number of CTE blocks. As shown in Table 6, two is the best choice for this task [6]. Three blocks CTE causes an AP drop, mainly because an odd number of blocks leads to a focus on boundaries, which is ineffective for tasks with keypoints inside objects.
+
+# 6 Conclusion
+
+In this paper, we propose Cornerformer to address potential problems of corner-based detectors in instance construction. In Cornerformer, we design a 2D Corner Transformer Encoder to optimize corner estimation and pull-push grouping. Besides, upon the pull-push embeddings, we present an Attenuation-Auto-Adjusted NMS to further break limits of the heuristic NMS. Our research reveals that much room is left in constructing objects from mid-level visual cues. We hope that the simple and efficient design of Cornerformer will attract more attention to instance construction in corner-based detectors.
+
+# References
+
+1. Bochkovskiy, A., Wang, C.Y., Liao, H.Y.M.: Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934 (2020)
+2. Bodla, N., Singh, B., Chellappa, R., Davis, L.S.: Soft-nms-improving object detection with one line of code. In: Proceedings of the IEEE international conference on computer vision. pp. 5561-5569 (2017)
+3. Cai, Z., Vasconcelos, N.: Cascade r-cnn: Delving into high quality object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 6154-6162 (2018)
+4. Cao, Z., Simon, T., Wei, S.E., Sheikh, Y.: Realtime multi-person 2d pose estimation using part affinity fields. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7291-7299 (2017)
+5. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European Conference on Computer Vision. pp. 213-229. Springer (2020)
+6. Cheng, B., Xiao, B., Wang, J., Shi, H., Huang, T.S., Zhang, L.: Higherhrnet: Scale-aware representation learning for bottom-up human pose estimation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5386-5395 (2020)
+7. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3213-3223 (2016)
+8. Dai, J., Qi, H., Xiong, Y., Li, Y., Zhang, G., Hu, H., Wei, Y.: Deformable convolutional networks. In: Proceedings of the IEEE international conference on computer vision. pp. 764-773 (2017)
+9. Dong, Z., Li, G., Liao, Y., Wang, F., Ren, P., Qian, C.: Centripetalnet: Pursuing high-quality keypoint pairs for object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10519-10528 (2020)
+10. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+11. Duan, K., Bai, S., Xie, L., Qi, H., Huang, Q., Tian, Q.: Centernet: Keypoint triplets for object detection. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 6569-6578 (2019)
+12. Duan, K., Xie, L., Qi, H., Bai, S., Huang, Q., Tian, Q.: Corner proposal network for anchor-free, two-stage object detection. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part III 16. pp. 399-416. Springer (2020)
+13. Girshick, R.: Fast r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 1440-1448 (2015)
+14. He, K., Gkioxari, G., Dollár, P., Girshick, R.: Mask r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 2961-2969 (2017)
+15. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+16. Huang, Z., Wang, X., Huang, L., Huang, C., Wei, Y., Liu, W.: Ccnet: Criss-cross attention for semantic segmentation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 603-612 (2019)
+
+17. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+18. Kong, T., Sun, F., Liu, H., Jiang, Y., Li, L., Shi, J.: Foveabox: Beyound anchor-based object detection. IEEE Transactions on Image Processing 29, 7389-7398 (2020)
+19. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. In: Advances in neural information processing systems. pp. 1097-1105 (2012)
+20. Law, H., Deng, J.: Cornernet: Detecting objects as paired keypoints. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 734-750 (2018)
+21. LeCun, Y., Bottou, L., Bengio, Y., Haffner, P., et al.: Gradient-based learning applied to document recognition. Proceedings of the IEEE 86(11), 2278-2324 (1998)
+22. Li, J., Wang, C., Zhu, H., Mao, Y., Fang, H.S., Lu, C.: Crowdpose: Efficient crowded scenes pose estimation and a new benchmark. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10863-10872 (2019)
+23. Lin, T.Y., Goyal, P., Girshick, R., He, K., Dollar, P.: Focal loss for dense object detection. In: Proceedings of the IEEE international conference on computer vision. pp. 2980-2988 (2017)
+24. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dólar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision. pp. 740-755. Springer (2014)
+25. Liu, F., Wei, H., Zhao, W., Li, G., Peng, J., Li, Z.: Wb-detr: Transformer-based detector without backbone. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 2979-2987 (2021)
+26. Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.Y., Berg, A.C.: Ssd: Single shot multibox detector. In: European conference on computer vision. pp. 21-37. Springer (2016)
+27. Lu, X., Li, B., Yue, Y., Li, Q., Yan, J.: Grid r-cnn. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7363-7372 (2019)
+28. Newell, A., Huang, Z., Deng, J.: Associative embedding: End-to-end learning for joint detection and grouping. In: Advances in neural information processing systems. pp. 2277-2287 (2017)
+29. Nie, X., Feng, J., Zhang, J., Yan, S.: Single-stage multi-person pose machines. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 6951-6960 (2019)
+30. Papandreou, G., Zhu, T., Chen, L.C., Gidaris, S., Tompson, J., Murphy, K.: Personlab: Person pose estimation and instance segmentation with a bottom-up, part-based, geometric embedding model. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 269-286 (2018)
+31. Redmon, J., Farhadi, A.: Yolo9000: better, faster, stronger. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7263-7271 (2017)
+32. Redmon, J., Farhadi, A.: Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767 (2018)
+33. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. In: Advances in neural information processing systems. pp. 91-99 (2015)
+34. Sermanet, P., Eigen, D., Zhang, X., Mathieu, M., Fergus, R., LeCun, Y.: Overfeat: Integrated recognition, localization and detection using convolutional networks. arXiv preprint arXiv:1312.6229 (2013)
+
+35. Sun, P., Zhang, R., Jiang, Y., Kong, T., Xu, C., Zhan, W., Tomizuka, M., Li, L., Yuan, Z., Wang, C., et al.: 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)
+36. Tan, M., Pang, R., Le, Q.V.: Efficientdet: Scalable and efficient object detection. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 10781-10790 (2020)
+37. Tian, Z., Shen, C., Chen, H., He, T.: Fcos: Fully convolutional one-stage object detection. In: Proceedings of the IEEE international conference on computer vision. pp. 9627-9636 (2019)
+38. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. arXiv preprint arXiv:1706.03762 (2017)
+39. Yang, Z., Liu, S., Hu, H., Wang, L., Lin, S.: Reppoints: Point set representation for object detection. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 9657-9666 (2019)
+40. Zhang, S., Chi, C., Yao, Y., Lei, Z., Li, S.Z.: Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9759-9768 (2020)
+41. Zhang, X., Wan, F., Liu, C., Ji, R., Ye, Q.: Freeanchor: Learning to match anchors for visual object detection. arXiv preprint arXiv:1909.02466 (2019)
+42. Zhou, X., Wang, D., Krähenbuhl, P.: Objects as points. arXiv preprint arXiv:1904.07850 (2019)
+43. Zhou, X., Zhuo, J., Krahenbuhl, P.: Bottom-up object detection by grouping extreme and center points. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 850-859 (2019)
+44. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J.: Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159 (2020)
\ No newline at end of file
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/images.zip b/cornerformerpurifyinginstancesforcornerbaseddetectors/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..376919f90175be47ca323e827711e5f57d30e0b1
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ffb3b2cf22fe0674735c33a6a8dffc41fa1d8b4bc80d39758392d259771e597f
+size 601693
diff --git a/cornerformerpurifyinginstancesforcornerbaseddetectors/layout.json b/cornerformerpurifyinginstancesforcornerbaseddetectors/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..6d47ab15a3fc5e14ca7ea5b22f9291da91c41c16
--- /dev/null
+++ b/cornerformerpurifyinginstancesforcornerbaseddetectors/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae292c879ffb12922ebf59c0cb0bca44014edb9ff560face0646b1cce8c92af4
+size 393216
diff --git a/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_content_list.json b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..dbea3597b2f08f80f5bcfe1abd19020483c7db2b
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f163da5263d8ec3694c25edb851532435e1500734e7ac65dff633bd800cdbf1c
+size 81868
diff --git a/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_model.json b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..eacfab4de2c9eeddb3e756a52a5298441b806a64
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:421b52a1961de6f0358fb99a2fd00c9cfe6a1af48df48f5e589fb1f8290e7d30
+size 97052
diff --git a/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_origin.pdf b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..e0f6787428db851cd38a1c8110d1d911c9241cbb
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/c3175211-6aa7-4a0e-804a-f32f925e69ad_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f78371e186b9e95451a0b00f466ac8283e72ee288a0a56383fa01b4cafdae4ac
+size 1248936
diff --git a/correspondencereweightedtranslationaveraging/full.md b/correspondencereweightedtranslationaveraging/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..811d6bfb8094eea46aa8a83a215fde89d60f5364
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/full.md
@@ -0,0 +1,257 @@
+# Correspondence Reweighted Translation Averaging
+
+Lalit Manam and Venu Madhav Govindu
+
+Indian Institute of Science, Bengaluru, India - 560012 {lalitmanam,venug}@iisc.ac.in
+
+Abstract. Translation averaging methods use the consistency of input translation directions to solve for camera translations. However, translation directions obtained using epipolar geometry are error-prone. This paper argues that the improved accuracy of translation averaging should be leveraged to mitigate the errors in the input translation direction estimates. To this end, we introduce weights for individual correspondences which are iteratively refined to yield improved translation directions. In turn, these refined translation directions are averaged to obtain camera translations. This results in an alternating approach to translation averaging. The modularity of our framework allows us to use existing translation averaging methods and improve their results. The efficacy of the scheme is demonstrated by comparing performance with state-of-the-art methods on a number of real-world datasets. We also show that our approach yields reasonably good 3D reconstructions with straightforward triangulation, i.e. without any bundle adjustment iterations.
+
+Keywords: Structure from Motion, Translation Averaging, Reweight-ing Correspondences
+
+# 1 Introduction
+
+In Structure-from-Motion (henceforth SfM) [16], given point correspondences across many images, we solve for the corresponding camera motions and 3D scene structure. Many SfM pipelines incrementally grow the solution by adding one camera at a time [27,30,35]. While they work well, incremental methods suffer from drift and have a significant computational load owing to the repeated use of Bundle Adjustment (henceforth BA) [32]. In contrast, batch or global methods [31] determine the absolute poses of the cameras simultaneously (also known as motion averaging [14,15]). Typically one solves for rotations, followed by translations using rotation and translation averaging respectively. Subsequently, we estimate 3D structure given the camera motions, often with a final BA refinement. In this paper, we address the problem of translation averaging.
+
+Using epipolar geometry, we can only recover the translation direction owing to an inherent scale ambiguity which has a number of serious implications. Firstly, it makes translation averaging a challenging problem since we need to
+
+
+Fig. 1: Schematic diagram of our framework for a viewgraph of camera-camera relationships. Each vertex represents a camera. The multiedges on the left indicate correspondences between camera-camera pairs whereas the edges on the right indicate a relative translation estimate between camera pairs. Weight estimation for point correspondences (resulting in refined translation directions) and translation averaging are alternately carried out in our framework
+
+use relative translation directions to solve for absolute camera translations. Existing methods [13,25,34,36] adopt a variety of approaches to tackle the scale estimation problem inherent to translation averaging. Secondly, in contrast to rotation averaging, determining the feasibility of solutions for a given translation averaging problem is related to the non-trivial issue of parallel rigidity [2,26]. Finally, translation directions recovered from point correspondences using epipolar geometry can be of poor quality owing to the presence of noise and outliers or when the baseline is narrow.
+
+All translation averaging methods solve for camera translations by exploiting consistency relationships the input translation directions should satisfy. In this paper, we argue that while this is useful, the poor quality of input translation directions obtained from epipolar geometry imposes limitations on the accuracy of translation averaging solutions. A key observation of our paper is that instead of using a single estimate of translation directions, we can refine them by introducing weights for individual correspondences. We schematically illustrate our approach in Fig. 1.
+
+Given an initial set of translation directions, we use averaging to obtain camera translations. The translation directions obtained from translation averaging estimates are superior to the original pairwise epipolar geometry based estimates as the averaged solution is based on global consistency. Hence we can use the estimates obtained from translation averaging to refine the weights ascribed to individual point correspondences between a camera pair (shown as multiedges in Fig. 1). Subsequently, the multiedges give us an estimate of translation directions (i.e. edges in a graph) which are averaged to obtain an improved translation estimate.
+
+We emphasize that our reweighting of individual correspondences is based on a global view of geometric consistency and not the standard approach of robustness based on a limited view of two camera epipolar geometry. Our approach is modular in nature and can use different translation averaging and weighting schemes. Thus, our method can take a translation averaging approach and improve it by refining the weighting of individual point correspondences.
+
+The paper is organized as follows: Sec. 2 reviews existing approaches. Sec. 3 presents the formulation and details of our proposed approach. Sec. 4 presents an extensive set of experiments to demonstrate the superiority of our approach compared to the state-of-the-art methods. We provide a discussion of some aspects of our method in Sec. 5 and a brief conclusion in Sec. 6.
+
+# 2 Related Work
+
+# 2.1 Rotation Averaging
+
+Translation averaging presumes the availability of rotation estimates, often obtained using rotation averaging which is a well studied problem. Intrinsic methods like [15] exploit the Lie group structure of $\mathbb{SO}_3$ . Robustness was incorporated in [4,5,17]. Extrinsic methods like [6,12,22] solve for a relaxed version of the problem. Readers are referred to [10,28,29] and the references therein for recent developments.
+
+# 2.2 Translation Averaging
+
+Most translation averaging approaches are based on the structure of the essential matrix and trifocal tensor [16]. Govindu [14] proposed to minimize the cross-product between the observed directions and the estimated relative camera translations. Arie-Nachimson et al. [1] set up a linear system of cross product constraints based on epipolar geometry. Moulon et al. [24] formulated a trifocal tensor with known rotations which converted the problem to aligning triplets instead of pairs.
+
+Jiang et al. [18] used camera triplets which converted pairwise constraints into constraints on a triangle. Wilson et al. [34] compared the observed and estimated heading directions. They added camera-to-point constraints to make the problem stable and relied on a pre-processing step to remove outliers. Tron et al. [33] compared squared relative displacements and used it in a distributed fashion. The Least Unsquared Deviations (LUD) method [25] proposed by Ozyesil et al. extended [33] by using $L_{1}$ loss for robustness and posed the problem as a convex program. Arrigoni et al. [3] proposed to minimize the squared error of the orthogonal projection of the estimated relative translations onto observed directions. In a similar spirit, Goldstein et al. [13] proposed ShapeFit/ShapeKick that minimized the orthogonal projection using ADMM but with an $L_{1}$ loss for
+
+robustness. Cui et al. [8] used feature tracks to construct a linear system and also solved the problem using ADMM. Cui et al. [7] used sin-length ratio constraints between cameras and points to estimate camera-to-camera scales and then solved a linear system. Although [7,8] used point correspondences in their method, all correspondences were treated equally. Moreover, multiple estimates of scales with different feature tracks were handled carefully to avoid the influence of outliers. Zhuang et al. [36] proposed a Bilinear Angle-based Translation Averaging (BATA) scheme comparing the estimated heading directions from camera translations to that of the observed directions relaxing the cost in [34].
+
+Other related approaches include similarity averaging [9], averaging of essential and fundamental matrices [19,20] and exploiting the structure of the matrix generated from pairwise camera displacements [11].
+
+# 3 Proposed Method
+
+In this section, we define some preliminaries and develop our proposed algorithm for translation averaging. Let $\mathcal{G} = (\mathcal{V},\mathcal{E})$ be a viewgraph, where $\mathcal{V}$ and $\mathcal{E}$ denotes the set of vertices and edges in $\mathcal{G}$ respectively. To each vertex $i$ , we assign a 3D rotation $\mathbf{R}_i\in \mathbb{SO}(3)$ and translation $\mathbf{T}_i\in \mathbb{R}^3$ that denotes its motion with respect to a global frame of reference. Each edge $(i,j)\in \mathcal{E}$ denotes the relative rotation and translation $(\mathbf{R}_{ij},\mathbf{T}_{ij})$ between camera vertices $i$ and $j$ . We note that owing to the scale ambiguity of epipolar geometry we can only recover the relative translation up to an unknown scale factor, i.e. the unit norm translation direction vectors $\mathbf{t}_{ij}\in \mathbb{S}^2$ , resulting in the relationships:
+
+$$
+\mathbf {R} _ {i j} = \mathbf {R} _ {j} \mathbf {R} _ {i} ^ {- 1},
+$$
+
+$$
+\mathbf {t} _ {i j} = \frac {\mathbf {R} _ {j} \left(\mathbf {T} _ {i} - \mathbf {T} _ {j}\right)}{\| \mathbf {R} _ {j} \left(\mathbf {T} _ {i} - \mathbf {T} _ {j}\right) \| _ {2}} \tag {1}
+$$
+
+$$
+\rightarrow \mathbf {v} _ {i j} = - \mathbf {R} _ {j} ^ {- 1} \mathbf {t} _ {i j} = \frac {\mathbf {T} _ {j} - \mathbf {T} _ {i}}{\| \mathbf {T} _ {j} - \mathbf {T} _ {i} \| _ {2}} \tag {2}
+$$
+
+where the unit vector $\mathbf{v}_{ij}$ is the translation direction represented in the global frame of reference and is defined for simplicity of notation. We assume that the rotations $\mathbf{R}_i$ for $i\in \mathcal{V}$ are either known or estimated using rotation averaging. Thus, the translation averaging problem of interest is one of recovering the absolute translations $\mathbf{T}_i$ for $i\in \mathcal{V}$ given the relative translation directions $\mathbf{t}_{ij}$ for $(i,j)\in \mathcal{E}$ . For each edge $(i,j)\in \mathcal{E}$ , we associate a number of point correspondences between cameras $i$ and $j$ . We denote these correspondences as $\{(p_i^k,q_j^k)|k\in \mathcal{I}_{ij}\}$ where $\mathbf{p}$ and $\mathbf{q}$ denote the homogeneous representation of correspondences in camera $i$ and $j$ respectively which are normalized to unit vectors, $\mathcal{I}_{ij}$ is the set of point indexes for the edge $(i,j)\in \mathcal{E}$ , and $k$ is the point index. We can now write the epipolar constraint between cameras $i$ and $j$ for the $k$ -th point correspondence as
+
+$$
+\left(\mathbf {q} _ {j} ^ {k}\right) ^ {T} \left(\mathbf {t} _ {i j} \times \mathbf {R} _ {i j} \mathbf {p} _ {i} ^ {k}\right) = 0 \tag {3}
+$$
+
+Denoting $\tilde{\mathbf{p}}_i^k = \mathbf{R}_i^{-1}\mathbf{p}_i^k$ and $\tilde{\mathbf{q}}_j^k = \mathbf{R}_j^{-1}\mathbf{q}_j^k$ , the epipolar constraint of Eqn. 3 can be rewritten as
+
+$$
+\begin{array}{l} \left(\mathbf {q} _ {j} ^ {k}\right) ^ {T} \left(\mathbf {t} _ {i j} \times \mathbf {R} _ {j} \mathbf {R} _ {i} ^ {- 1} \mathbf {p} _ {i} ^ {k}\right) = 0 \\ \Rightarrow \left(\mathbf {q} _ {j} ^ {k}\right) ^ {T} \mathbf {R} _ {j} \left(\mathbf {R} _ {j} ^ {- 1} \mathbf {t} _ {i j} \times \mathbf {R} _ {i} ^ {- 1} \mathbf {p} _ {i} ^ {k}\right) = 0 (4) \\ \Rightarrow \left(\mathbf {R} _ {j} ^ {- 1} \mathbf {q} _ {j} ^ {k}\right) ^ {T} \left(- \mathbf {v} _ {i j} \times \left(\mathbf {R} _ {i} ^ {- 1} \mathbf {p} _ {i} ^ {k}\right)\right) = 0 \\ \Rightarrow \left(\mathbf {m} _ {i j} ^ {k}\right) ^ {T} \mathbf {v} _ {i j} = 0 (5) \\ \end{array}
+$$
+
+where $\mathbf{m}_{ij}^{k} = \tilde{\mathbf{q}}_{j}^{k}\times \tilde{\mathbf{p}}_{i}^{k}$ . Eqn. 4 is obtained using the relationship $\mathbf{a}\times \mathbf{Sb} = \mathbf{S}^{-T}(\mathbf{S}^{-1}\mathbf{a}\times \mathbf{b})$ (upto scale) for any invertible matrix $\mathbf{S}\in \mathbb{R}^{3\times 3}$ and $\mathbf{a},\mathbf{b}\in \mathbb{R}^3$ (Appendix A4.2 in [16]). Collecting the relationships in Eqn. 5 for all $k\in \mathcal{I}_{ij}$ we get $\mathbf{M}_{ij}\mathbf{v}_{ij} = \mathbf{0}$ where the $k$ -th row of $\mathbf{M}_{ij}$ is $\mathbf{m}_{ij}^{kT}$ . Further, to account for our confidence in each observation, we assign a scalar weight $w_{ij}^{k}$ to every point correspondence $(\mathbf{p}_i^k,\mathbf{q}_j^k)$ . We normalize these weights for each edge $(i,j)\in \mathcal{E}$ such that $\sum_{k}w_{ij}^{k} = 1$ . We define a diagonal matrix $\mathbf{W}_{ij}$ where the $k$ -th entry on the diagonal is $w_{ij}^{k}$ . Finally, we denote the set of all the translations as $\mathbb{T} = \{\mathbf{T}_1,\dots ,\mathbf{T}_N\}$ where $N = |\mathcal{V}|$ is the number of cameras.
+
+# 3.1 Our Framework for Translation Averaging
+
+When Eqn. 5 is not exactly satisfied due to noise, the least squares solution for $\mathbf{v}_{ij}$ is the smallest right singular vector of the matrix $\mathbf{M}_{ij}$ . Analogously, the weighted least squares solution is the smallest right singular vector of $\mathbf{W}_{ij}\mathbf{M}_{ij}$ . While this holds for a single camera pair $(i,j)\in \mathcal{E}$ , in translation averaging, we seek a global solution that is most consistent with the observations on each individual edge. Thus we formulate our optimization problem as
+
+$$
+\min _ {\mathbb {T}} \sum_ {(i, j) \in \mathcal {E}} \| \mathbf {W} _ {i j} \mathbf {M} _ {i j} \mathbf {v} _ {i j} (\mathbb {T}) \| _ {2} ^ {2} \tag {6}
+$$
+
+where we denote $\mathbf{v}_{ij}(\mathbb{T})$ to emphasize that it is a function of the global camera translations $\mathbb{T}$ . $\mathcal{C}$ corresponds to the constraint set to fix origin and scale ambiguity in the problem. It will be immediately noted (from Eqn. 2) that Eqn. 6 is a highly non-linear problem and is challenging to solve for large-scale SfM datasets. When robust estimators are used, such as IRLS, the weights $w_{ij}^{k}$ are iteratively updated based on a robust loss minimization. In contrast, as stated earlier, we wish to refine our weights based on the global consistency of the translation directions. In our approach, after initialization, we solve for translation directions (given translations) and then solve translation averaging (given translation directions). This is repeated till convergence. We note that our alternating approach is akin to Expectation Maximization (EM) [23] where the weights for point correspondences play the role of latent or unobserved variables. Specifically, we have the following alternating steps:
+
+| Algorithm 1: Correspondence Reweighted Translation Averaging (CReTA) |
| 1 | Initialize global translations T |
| 2 | while not converged do |
| 3 | Update weights ∀(pi^k, q^k) |
| 4 | Estimate {vi_j | ∀(i, j) ∈ E} |
| 5 | Solve Translation Averaging using {vi_j} |
| 6 | end |
+
+- Weights Update: Given the current estimate of global translations $\mathbb{T}$ , for each point correspondence $(\mathbf{p}_i^k,\mathbf{q}_j^k)$ , we compute the residual error using Eqn. 5, i.e. $e_{ij}^{k} = \mathbf{m}_{ij}^{kT}\mathbf{v}_{ij}(\mathbb{T})$ . We map these errors $e_{ij}^{k}$ into weights $w_{ij}^{k}$ using a suitable function to denote our current confidence in that correspondence.
+- Translations Update: Given the weights defined above, the minimization problem in Eqn. 6 is completely defined. Directly minimizing Eqn. 6 is infeasible for large-scale datasets owing to the very large number of correspondences involved and the non-linear nature of the problem. Instead, we use a two-step procedure as follows: For each edge $(i,j) \in \mathcal{E}$ , we solve for the translation direction $\mathbf{v}_{ij}$ as the null space of $\mathbf{W}_{ij} \mathbf{M}_{ij}$ . As described below, we use these estimated $\mathbf{v}_{ij}$ as inputs for a translation averaging method to solve for the global translations $\mathbb{T}$ . As noted in [36], this is akin to functional lifting since we solve for $\mathbf{v}_{ij}$ for all edges and then average them in terms of the smaller number of camera translations. This approach makes our optimization using point correspondence weights tractable with lower computation requirements than directly solving Eqn. 6. We also note that the modular nature of our formulation allows us to use any translation averaging scheme.
+
+Choice of Translation Averaging Method: In an excellent discussion, [36] shows that the weakness of the LUD formulation of [25] is its use of an inequality constraint to remove scale ambiguity and prevent the collapse of camera translations to a point. They further show that this problem can be mitigated by revising the scale constraint, resulting in a Revised-LUD or RLUD method, which is shown to have a minimum identical to that of Shapefit/ShapeKick [13]. For the remainder of this paper, LUD refers to the original formulation in [25] and RLUD refers to the Revised-LUD modification given in [36]. We provide below the formulations for RLUD and BATA which we use in our experiments.
+
+# RLUD:
+
+$$
+\min _ {\mathbf {T} _ {i, i \in \mathcal {V}}, \lambda_ {i j, (i, j) \in \mathcal {E}}} \| \mathbf {T} _ {j} - \mathbf {T} _ {i} - \lambda_ {i j} \mathbf {v} _ {i j} \| _ {2} \tag {7}
+$$
+
+$$
+\mathrm {s . t .} \sum_ {i \in \mathcal {V}} \mathbf {T} _ {i} = \mathbf {0}, \sum_ {(i, j) \in \mathcal {E}} \langle \mathbf {T} _ {j} - \mathbf {T} _ {i}, \mathbf {v} _ {i j} \rangle = 1, \lambda_ {i j} \geq 0, \forall (i, j) \in \mathcal {E}
+$$
+
+# BATA:
+
+$$
+\min _ {\mathbf {T} _ {i, i \in \mathcal {V}}, \gamma_ {i j, (i, j) \in \mathcal {E}}} \rho \left(\left\| \left(\mathbf {T} _ {j} - \mathbf {T} _ {i}\right) \gamma_ {i j} - \mathbf {v} _ {i j} \right\| _ {2}\right) \tag {8}
+$$
+
+$$
+\text {s . t .} \sum_ {i \in \mathcal {V}} \mathbf {T} _ {i} = \mathbf {0}, \sum_ {(i, j) \in \mathcal {E}} \langle \mathbf {T} _ {j} - \mathbf {T} _ {i}, \mathbf {v} _ {i j} \rangle = 1, \gamma_ {i j} \geq 0, \forall (i, j) \in \mathcal {E}
+$$
+
+The zero centroid and dot product constraints in Eqns. 7 and 8 remove the inherent origin and scale ambiguity. $\rho$ denotes a robust loss function. $\lambda_{ij}$ and $\gamma_{ij}$ are non-negative variables that are ideally equal to baseline and inverse baseline for the edge $(i,j)$ respectively. It can be seen that RLUD compares the relative displacements (by also computing the translation scales $\lambda_{ij}$ ) while BATA compares the heading directions. In other words, RLUD and BATA are representative of the two approaches feasible for translation averaging, i.e. comparing directions or comparing translation vectors.
+
+Implementation details: We provide a high level description of our approach in Algorithm 1. In order to remove outlier or low quality correspondences, after the initial estimate of translations, for each edge $(i,j)$ , we compute the weights for each correspondence pair and remove the bottom $25\%$ of such correspondences. In every iteration, edges are pruned when the estimated $\mathbf{v}_{ij}$ deviates by more than $40^{\circ}$ from the equivalent derived from the global translations estimated in the previous iteration. In the Weights Update step, we use the function $w_{ij}^{k} = \frac{\alpha^{2}}{\alpha^{2} + e_{ij}^{k2}}$ , with $\alpha = 0.01$ . Other weighting functions are also feasible here. Estimation of $\mathbf{v}_{ij}$ involves resolving its sign ambiguity which can either be done using chirality constraint or comparing with the directions from the current estimate of global translations. The latter one is used in our implementation. In our experiments, we use RLUD and BATA for translation averaging and denote our corresponding methods as CReTA-RLUD and CReTA-BATA respectively. For CReTA-RLUD, we remove edges with negative scale factors $\lambda_{ij}$ in each iteration. Algorithm 1 is run till the absolute fractional change of the translation averaging cost function is less than $10^{-5}$ or mean change in translations is less than $10^{-6}$ or the maximum number of iterations $N_{max}$ is reached. For CReTA-RLUD and CReTA-BATA, $N_{max}$ equals 50 and 10 respectively1. In addition, both RLUD and BATA are themselves iterative methods run for 20 iterations each. Finally, for BATA, we use a Cauchy loss with scale $\beta = 0.1$ , as used by the authors in [36].
+
+# 4 Experiments
+
+In this section, we provide experimental comparisons of our method with state-of-the-art methods for translation averaging on synthetic and real datasets. For camera rotations, we use the rotation averaging solution obtained using the code
+
+provided by $[5]^2$ . For all experiments, the maximal parallel rigid component of the viewgraph is extracted based on [21]. We note that although the translation directions change for each iteration in our approach, we do not recompute parallel rigidity as the maximal component does not change significantly over the iterations. We use LUD implemented in Theia [31] and BATA's code provided by the authors3. Our method is implemented in MATLAB. To quantitatively evaluate the performance of different schemes, the estimated camera translations are robustly aligned to the ground truth using the code provided by $[34]^4$ . All experiments are performed on a PC with Intel Xeon Silver 4210 processor with 128 GB RAM. Finally, in each table, the best performing method for each dataset is highlighted in bold, $\mu$ and $\hat{\mu}$ imply mean and median errors respectively.
+
+# 4.1 Synthetic Data
+
+We carry out experiments with synthetic data to study the comparative behaviour of different methods in the presence of noise and outliers. To validate the usefulness of weighting every point correspondence based on global consistency, RLUD and BATA are compared to our methods, CReTA-RLUD and CReTA-BATA. For creating synthetic data as close to the real data as possible, we use the ground truth from two 1DSfM datasets [34], i.e. Montreal Notre Dame (450 nodes, 52340 edges) and Tower of London (467 nodes, 23777 edges). We chose these datasets as they have a similar number of cameras but a different number of edges. We refer to these synthetic datasets as $MND_{syn}$ and $TOL_{syn}$ . For these synthetic datasets, we create point correspondences by projecting the ground truth 3D points onto the cameras using the ground truth poses and then applying camera calibration as provided in the dataset. Only the point features within the image dimensions and with a positive depth in the camera coordinate frame are retained. For every edge, a maximum of 1000 correspondences generated in this fashion are retained. This creates a perfectly clean dataset with real-world camera motions and 3D structure. Now we perturb the image points with Gaussian noise $\mathcal{N}(0,\sigma^2)$ with $\sigma \in \{1,3\}$ pixels. 10 instances of both datasets are generated for the two noise levels. To generate outliers, $30\%$ of the correspondences in each edge are perturbed with Gaussian noise $\mathcal{N}(0,\sigma_o^2)$ with $\sigma_o = 10$ pixels. For every dataset, relative translations are computed in a RANSAC loop using epipolar geometry with rotations set to ground truth. This removes the effect of rotation errors from the problem. For these realizations, we extract the corresponding maximal parallel rigid graph, which are used as inputs in our experiments.
+
+To evaluate the accuracy of camera translations, we use the normalized root mean square error (NRMSE) as in [25] and [36]. Let $\mathbf{T}_i^{gt}$ be the set of ground truth camera translations and $\mathbf{T}_i^{avg}$ estimated from different methods, then
+
+Table 1: Camera translation errors (in meters) for synthetic datasets. The reported values are averaged over 10 instances each (wo: with outliers)
+
+| Dataset | RLUD | BATA | CReTA-RLUD | CReTA-BATA |
| μ | μ̂ | μ | μ̂ | μ | μ̂ | μ | μ̂ |
| MNDsyn, σ = 1 | 1.64 | 1.10 | 0.17 | 0.06 | 0.12 | 0.07 | 0.13 | 0.05 |
| MNDsyn, σ = 1, wo | 1.61 | 1.09 | 0.15 | 0.06 | 0.14 | 0.08 | 0.11 | 0.06 |
| MNDsyn, σ = 3 | 1.55 | 1.04 | 0.25 | 0.12 | 0.18 | 0.11 | 0.22 | 0.14 |
| MNDsyn, σ = 3, wo | 1.49 | 0.97 | 0.29 | 0.14 | 0.19 | 0.11 | 0.25 | 0.16 |
| TOLsyn, σ = 1 | 12.78 | 2.56 | 2.88 | 1.75 | 7.38 | 0.46 | 1.19 | 0.52 |
| TOLsyn, σ = 1, wo | 12.36 | 2.13 | 2.56 | 1.56 | 7.51 | 0.63 | 1.64 | 0.92 |
| TOLsyn, σ = 3 | 12.44 | 2.64 | 2.50 | 1.46 | 7.76 | 1.00 | 2.06 | 1.11 |
| TOLsyn, σ = 3, wo | 12.47 | 2.73 | 2.72 | 1.40 | 7.89 | 0.99 | 2.52 | 1.20 |
+
+Table 2: Comparison of input and output relative translation directions (in degrees) on synthetic data. The reported values are averaged over 10 instances each (RMS: root mean square error; wo: with outliers)
+
+| Dataset | Input | CReTA-RLUD | CReTA-BATA |
| μ | RMS | μ | RMS | μ | RMS |
| MNDsyn, σ = 1 | 0.33 | 3.80 | 0.17 | 1.45 | 0.23 | 1.45 |
| MNDsyn, σ = 1, wo | 0.52 | 5.35 | 0.18 | 1.20 | 0.22 | 1.20 |
| MNDsyn, σ = 3 | 1.50 | 8.17 | 0.72 | 3.03 | 0.89 | 3.00 |
| MNDsyn, σ = 3, wo | 2.00 | 10.34 | 0.77 | 3.12 | 0.94 | 3.09 |
| TOLsyn, σ = 1 | 0.79 | 7.13 | 0.37 | 1.55 | 0.30 | 1.53 |
| TOLsyn, σ = 1, wo | 1.27 | 9.55 | 0.44 | 2.48 | 0.34 | 2.46 |
| TOLsyn, σ = 3 | 2.74 | 13.56 | 1.00 | 3.95 | 1.00 | 3.89 |
| TOLsyn, σ = 3, wo | 3.60 | 16.15 | 1.05 | 3.92 | 1.07 | 3.88 |
+
+$NRMSE = \sqrt{\sum_{i\in\mathcal{V}}\|\mathbf{T}_i^{gt} - \mathbf{T}_i^{avg}\|_2^2}$ . Both $\mathbf{T}_i^{avg}$ and $\mathbf{T}_i^{gt}$ are normalized such that $\sum_{i\in \mathcal{V}}\mathbf{T}_i = 0$ and $\sum_{i\in \mathcal{V}}\|\mathbf{T}_i\|_2^2 = 1$ . The evaluation is also done in terms of mean and median errors of camera translations (after aligning the solutions to ground truth) and comparing the input and output relative translations.
+
+In Table 1, we show the translation errors for each datasets with differing scenarios $(\sigma = \{1,3\}$ , with and without outliers) averaged over 10 instances. As can be clearly seen, our CReTA methods are significantly better in accuracy compared to LUD and BATA. In Fig. 2, we show the distribution for NRMSE for different methods for the 10 instances when $\sigma = 3$ and with outliers. We show the results for only one setting of noise and outliers for visual clarity (other settings are shown in the supplementary material). The large leftward shift of the distributions for our methods clearly demonstrates a significant improvement in performance over the corresponding translation averaging methods used. Further, in Table 2, we compare the quality of input to that of output relative translations for different methods. It is seen that relative translation directions are substantially improved in our framework.
+
+
+
+
+(a) $MND_{syn}$ , $\sigma = 3$ with outliers
+
+
+
+
+(b) $TOL_{syn}$ , $\sigma = 3$ with outliers
+Fig.2: Comparison of the histograms of NRMSE in 10 instances for two synthetic datasets. The leftward shift for our methods clearly indicates a significant improvement in performance
+
+Table 3: Camera translation errors (in meters) on 1DSfM [34] datasets $(|\mathcal{V}|)$ : number of nodes, $|\pmb{\varepsilon}|$ : number of edges)
+
+| Dataset | |V| | |E| | LUD [25] | ShapeFit [13] | BATA [36] | CReTA-RLUD (Ours) | CReTA-BATA (Ours) |
| | | μ | μ̂ | μ | μ̂ | μ | μ̂ | μ | μ̂ | μ | μ̂ |
| Alamo (ALM) | 586 | 81437 | 2.7 | 0.5 | 0.9 | 0.5 | 2.0 | 0.6 | 2.0 | 0.5 | 2.0 | 0.5 |
| Ellis Island (ELS) | 229 | 14728 | 6.9 | 3.6 | 12 | 1.9 | 6.7 | 3.2 | 6.0 | 2.9 | 6.2 | 3.3 |
| Gendarmenkmart (GMM) | 686 | 27145 | 31.2 | 11.3 | - | - | 31.3 | 11.4 | 31.0 | 11.2 | 31.5 | 11.1 |
| Madrid Metropolis (MDR) | 325 | 11995 | 8.4 | 1.9 | 81 | 6.0 | 6.9 | 1.6 | 7.6 | 1.7 | 6.1 | 1.6 |
| Montreal Notre Dame (MND) | 461 | 45737 | 0.9 | 0.5 | 1.7 | 0.8 | 0.8 | 0.5 | 0.9 | 0.5 | 0.7 | 0.4 |
| Notre Dame (ND) | 552 | 80647 | 1.2 | 0.3 | 1.5 | 0.2 | 1.0 | 0.2 | 2.1 | 1.1 | 1.0 | 0.2 |
| NYC Library (NYC) | 337 | 14365 | 2.2 | 0.8 | 162 | 1.4 | 2.1 | 1.7 | 2.0 | 0.7 | 2.0 | 0.7 |
| Piazza del Popolo (PDP) | 334 | 20974 | 3.8 | 2.8 | 5.9 | 3.6 | 3.4 | 2.0 | 4.5 | 3.4 | 3.8 | 2.5 |
| Piccadilly (PIC) | 2362 | 201600 | 2.8 | 1.3 | 15 | 1.2 | 3.2 | 1.1 | 2.8 | 1.1 | 3.0 | 1.1 |
| Roman Forum (ROF) | 1069 | 54207 | 11.9 | 3.3 | 25 | 4.3 | 8.3 | 2.0 | 13.3 | 3.3 | 7.7 | 1.7 |
| Tower of London (TOL) | 474 | 19252 | 14.9 | 3.2 | 164 | 2.3 | 9.3 | 3.0 | 13.3 | 3.1 | 9.0 | 3.0 |
| Trafalgar (TFG) | 4900 | 542480 | 8.4 | 5.3 | - | - | 7.9 | 4.2 | 8.0 | 4.4 | 7.5 | 4.1 |
| Union Square (USQ) | 825 | 19899 | 10.6 | 6.1 | 47 | 8.9 | 10.2 | 5.6 | 10.6 | 5.4 | 10.5 | 4.9 |
| Vienna Cathedral (VNC) | 826 | 82793 | 5.1 | 2.1 | 11 | 1.9 | 12.0 | 2.1 | 6.5 | 2.2 | 6.7 | 1.9 |
| Yorkminster (YKM) | 430 | 22692 | 7.6 | 1.8 | - | - | 5.1 | 1.3 | 7.0 | 1.6 | 6.0 | 2.0 |
+
+# 4.2 Real World Data
+
+In this subsection, we present results on real unordered image datasets provided by the authors of 1DSfM [34]. These datasets are pre-processed in a manner similar to that suggested in [25]: Rotation averaging is performed and inconsistent edges with an error greater than $10^{\circ}$ are removed. Subsequently, the initial translation directions are estimated using the epipolar geometric relationship (Eqn. 5) in a RANSAC loop. The results for our methods CReTA-RLUD and CReTA-BATA are shown in Table 3 along with other state-of-the-art methods. Since ShapeFit provides multiple results, the overall best results are cited. It can be seen that CReTA has the best performance or is similar in quality to the best solution for most of the datasets. In particular, the improvement in mean errors is significant for many datasets when compared to the respective transla
+
+Table 4: Camera translation errors (in meters) on 1DSfM datasets using the initialization provided
+
+| Dataset | LUD | BATA | CReTA-RLUD | CReTA-BATA |
| μ | μ | μ | μ | μ | μ | μ | μ |
| ALM | 5.0 | 2.8 | 3.4 | 0.6 | 2.4 | 0.6 | 2.1 | 0.5 |
| ELS | 9.7 | 3.7 | 11.6 | 1.4 | 7.1 | 2.9 | 8.3 | 3.0 |
| GMM | 46.6 | 20.5 | 45.6 | 23.4 | 44.5 | 22.8 | 41.8 | 20.9 |
| MDR | 19.0 | 9.2 | 23.2 | 2.8 | 12.7 | 2.2 | 11.9 | 1.7 |
| MND | 1.6 | 0.9 | 1.3 | 0.6 | 2.6 | 1.4 | 1.5 | 0.7 |
| ND | 4.1 | 1.6 | 2.1 | 0.3 | 1.7 | 0.5 | 1.1 | 0.2 |
| NYC | 4.5 | 2.2 | 3.5 | 0.7 | 2.6 | 0.7 | 2.3 | 0.7 |
| PDP | 6.3 | 1.9 | 6.7 | 1.6 | 5.6 | 1.2 | 5.4 | 1.2 |
| PIC | 6.2 | 3.8 | 5.1 | 1.3 | 4.4 | 2.3 | 3.4 | 1.3 |
| ROF | 25.1 | 14.6 | 11.3 | 1.6 | 18.2 | 9.4 | 9.3 | 1.8 |
| TOL | 24.9 | 8.7 | 17.6 | 2.0 | 19.5 | 2.6 | 16.8 | 2.9 |
| TFG | 16.7 | 13.3 | 11.7 | 4.4 | 9.9 | 6.2 | 9.1 | 5.7 |
| USQ | 12.2 | 7.6 | 13.3 | 4.8 | 11.6 | 6.2 | 10.5 | 5.0 |
| VNC | 14.2 | 7.0 | 10.5 | 2.1 | 8.5 | 2.4 | 5.8 | 1.8 |
| YKM | 15.6 | 6.8 | 9.4 | 1.3 | 7.3 | 1.5 | 5.2 | 1.5 |
+
+
+(a) ELS
+
+
+(b) MDR
+
+
+(c) PIC
+Fig. 3: Cumulative error distributions (in degrees) for relative translation directions for inputs and CReTA estimates
+
+
+(d) VNC
+
+tion averaging scheme used, i.e. CReTA-RLUD vs. LUD and CReTA-BATA vs. BATA.
+
+The 1DSfM datasets [34] also provide an estimate of the translation directions $\mathbf{t}_{ij}$ which are of inferior quality compared to that estimated and used in the above experiment. To assess the performance of the methods with low quality inputs, we supply the translation directions given in the 1DSfM datasets [34] to different methods and compare the camera translation accuracies in Table 4. It can be seen that even when the initial input translation directions are of inferior quality, our CReTA approach is able to obtain better accuracies with considerable improvement in the mean errors when compared to the respective translation averaging scheme used. To further illustrate the improvement obtained, in Fig. 3, we compare the cumulative error distributions of the relative translation directions obtained using CReTA and the input translation directions. As can be seen, our approaches significantly improve upon the initial directions. These results suggest that weighting point correspondences with global consistency information can improve the performance of the translation averaging methods even with low quality input translation directions.
+
+Table 5: Reprojection errors (in pixels) and number of 3D points ( $N_p \times 10^3$ ) reconstructed after triangulation
+
+| Dataset | LUD | BATA | CReTA-RLUD | CReTA-BATA |
| μ | μ | Np | μ | μ | Np | μ | μ | Np | μ | μ | Np |
| ALM | 6.6 | 5.4 | 83 | 7.7 | 6.7 | 120 | 3.0 | 1.7 | 223 | 3.5 | 2.3 | 221 |
| ELS | 8.3 | 7.3 | 37 | 7.6 | 6.3 | 56 | 4.5 | 3.2 | 62 | 4.7 | 3.6 | 69 |
| GMM | 7.1 | 6.5 | 54 | 6.8 | 5.7 | 99 | 5.1 | 3.6 | 146 | 5.5 | 4.2 | 159 |
| MDR | 7.1 | 7.0 | 11 | 7.7 | 6.8 | 38 | 4.9 | 3.5 | 60 | 5.1 | 3.8 | 74 |
| MND | 8.2 | 7.1 | 87 | 7.3 | 5.9 | 123 | 3.6 | 2.3 | 178 | 3.8 | 2.5 | 184 |
| ND | 7.9 | 6.9 | 53 | 8.2 | 7.0 | 117 | 4.8 | 3.2 | 232 | 5.4 | 3.8 | 240 |
| NYC | 8.0 | 7.6 | 32 | 7.5 | 6.5 | 65 | 3.9 | 2.5 | 107 | 4.5 | 3.1 | 113 |
| PDP | 7.6 | 6.5 | 34 | 7.2 | 5.9 | 40 | 3.8 | 2.4 | 64 | 4.5 | 3.1 | 65 |
| PIC | 7.3 | 6.5 | 121 | 7.2 | 6.1 | 187 | 5.3 | 3.7 | 298 | 5.6 | 4.1 | 318 |
| ROF | 7.2 | 6.4 | 87 | 7.4 | 6.3 | 204 | 4.5 | 3.0 | 347 | 5.0 | 3.6 | 373 |
| TOL | 5.9 | 4.8 | 63 | 6.7 | 5.4 | 95 | 5.1 | 3.4 | 180 | 5.5 | 3.8 | 189 |
| TFG | 7.1 | 6.1 | 308 | 7.0 | 5.9 | 416 | 4.9 | 3.3 | 649 | 5.5 | 3.9 | 654 |
| USQ | 7.8 | 6.8 | 34 | 7.5 | 6.5 | 38 | 6.3 | 4.9 | 62 | 6.5 | 5.1 | 66 |
| VNC | 7.8 | 6.9 | 124 | 7.6 | 6.4 | 194 | 4.8 | 3.3 | 341 | 5.0 | 3.6 | 354 |
| YKM | 7.6 | 6.9 | 56 | 7.4 | 6.3 | 96 | 5.1 | 3.6 | 153 | 5.7 | 4.2 | 171 |
+
+Impact on 3D Reconstruction: In Tables 3 and 4, we compare the quality of translation estimates based on the available pseudo ground truth. But we believe that comparing the mean and median errors for translation estimates are inadequate since, in SfM, we are also interested in estimating 3D scene structure. In order to understand this aspect of camera motion estimation, we carry out the following experiment. For all datasets used, we extract a large number of correspondences using COLMAP [27]. We use the camera motions obtained in the experiment in Table 4 and carry out triangulation using Theia [31]. This allows us to assess the quality of the different translation solutions in terms of their impact on 3D reconstruction. The reprojection errors, shown after triangulation using the different translation solutions in Table 5, are independent of the pseudo ground truth and indicate the quality of reconstruction. As can be seen, our methods yield significantly lower reprojection errors. Specifically, CReTA-RLUD has the least mean and median reprojection errors followed by CReTA-BATA. The Theia package removes triangulated points with a reprojection error larger than 15 pixels. We note that our methods yield many more triangulated points with CReTA-BATA producing the highest number of 3D points for all datasets except ALM.
+
+In Fig. 4 we illustrate the quality of translation estimation using our reweighting scheme by visualizing the 3D reconstructions obtained. We show the reconstructions obtained by triangulation using our CReTA-RLUD solution, with additional reconstructions provided in the supplementary material. The corresponding point clouds obtained using full BA are shown for reference. As can be seen, we obtain reasonably good quality reconstructions by straightforward triangulation without having to carry out any bundle adjustment refinements. The high quality of our triangulations indicate that our translation estimates are consistent with the point correspondences.
+
+
+Fig. 4: Reconstructions obtained with triangulation using our CReTA-RLUD translation estimate (first row) compared to bundle adjustment (second row)
+
+# 5 Discussion
+
+As we have shown in Sec. 4, using our refined weighting of point correspondences improves the quality of the translation estimates. In this section, we briefly consider some other issues of significance.
+
+Ablation Study: As indicated earlier, in our implementation, we remove some of the point correspondences from each edge $(i,j) \in \mathcal{E}$ after the first translation averaging estimate. This is especially useful when the input relative translations are inferior as the translation averaging steps improve the overall solution, and correspondences with low weights indicate that they are low in quality with respect to the translation averaging solution. For this study, we do not prune edges to understand the effect of removing point correspondences exclusively. Table 6 shows that removing point correspondences in the first iteration results in an improvement in our CReTA results for almost all datasets, with significant improvements for ELS, MDR, USQ and VNC datasets.
+
+Computation Time: While RLUD and BATA are based on a single optimization, CReTA methods carry out repeated optimizations with refined input translation directions in each iteration increasing the computation load of CReTA as shown in Table 7. We believe that the additional computation time for our approach can be significantly reduced with a $\mathrm{C + + }$ implementation.
+
+Limitations: Finally, we note that our improvement on translation averaging leverages the image correspondences in the dataset. We may not get as significant an improvement in performance over the translation averaging method used if there are very few point correspondences or if they have high noise and outlier ratios. Further, our method cannot be used if only the translation direction estimates are available without access to the correspondences.
+
+Table 6: Impact of removing low quality correspondences in 1DSfM datasets after first iteration. Entries marked in bold shows improvement of a given method and not comparing all variants (woRC: without Removing Correspondences)
+
+| Dataset | CReTA-RLUD
+woRC | CReTA-RLUD | CReTA-BATA
+woRC | CReTA-BATA |
| μ | μ̂ | μ | μ̂ | μ | μ̂ | μ | μ̂ |
| ALM | 2.2 | 0.6 | 2.2 | 0.6 | 2.3 | 0.7 | 2.4 | 0.5 |
| ELS | 28.3 | 3.3 | 9.5 | 3.0 | 21.0 | 3.9 | 12.2 | 3.0 |
| GMM | 45.1 | 21.3 | 43.9 | 20.8 | 44.1 | 20.7 | 44.1 | 21.3 |
| MDR | 16.4 | 2.7 | 14.9 | 2.3 | 19.8 | 2.8 | 13.9 | 1.9 |
| MND | 2.3 | 1.2 | 1.9 | 1.0 | 1.2 | 0.6 | 0.8 | 0.4 |
| ND | 1.2 | 0.3 | 1.1 | 0.3 | 1.7 | 0.6 | 1.3 | 0.2 |
| NYC | 4.3 | 1.0 | 2.8 | 0.9 | 3.1 | 0.9 | 2.9 | 0.7 |
| PDP | 6.4 | 1.2 | 6.2 | 1.3 | 6.8 | 1.8 | 6.2 | 1.3 |
| PIC | 4.0 | 2.0 | 4.0 | 2.3 | 4.2 | 1.5 | 3.3 | 1.2 |
| ROF | 12.1 | 4.0 | 11.7 | 3.6 | 8.6 | 2.0 | 8.2 | 1.8 |
| TOL | 19.6 | 2.8 | 20.0 | 2.6 | 13.4 | 3.2 | 14.8 | 3.0 |
| TFG | 13.6 | 10.0 | 10.2 | 7.1 | 13.7 | 7.8 | 8.9 | 5.1 |
| USQ | 26.3 | 9.1 | 15.9 | 5.5 | 17.9 | 7.3 | 13.0 | 5.7 |
| VNC | 11.4 | 4.0 | 7.3 | 2.0 | 14.0 | 2.7 | 8.2 | 1.8 |
| YKM | 6.7 | 1.5 | 6.3 | 1.5 | 12.9 | 1.5 | 8.7 | 1.5 |
+
+Table 7: Computation time (in seconds) for different schemes
+
+| Dataset | RLUD | BATA | CReTA-RLUD | CReTA-BATA |
| ALM | 42 | 54 | 225 | 145 |
| ELS | 6 | 10 | 33 | 28 |
| GMM | 14 | 25 | 84 | 71 |
| MDR | 7 | 14 | 45 | 32 |
| MND | 9 | 29 | 128 | 83 |
| ND | 46 | 56 | 285 | 188 |
| NYC | 6 | 14 | 44 | 31 |
| PDP | 8 | 16 | 42 | 43 |
| PIC | 211 | 249 | 747 | 521 |
| ROF | 24 | 52 | 172 | 128 |
| TOL | 9 | 19 | 60 | 43 |
| TFG | 543 | 862 | 1996 | 1271 |
| USQ | 8 | 17 | 63 | 50 |
| VNC | 54 | 74 | 283 | 176 |
| YKM | 11 | 16 | 74 | 53 |
+
+# 6 Conclusion
+
+This paper presents CReTA, a modular framework that iteratively refines the input translation directions by weighting individual point correspondences. The modularity of our approach allows us to use a translation averaging method and improve upon its performance. This improvement is reflected in the quality metrics for comparing translation estimates. Also of significance is the fact that our approach yields reasonably good reconstructions with triangulation when compared with BA results.
+
+Acknowledgments: Lalit Manam is supported by a Prime Minister's Research Fellowship, Government of India. This research was supported in part by a Core Research Grant from Science and Engineering Research Board, Department of Science and Technology, Government of India.
+
+# References
+
+1. Arie-Nachimson, M., Kovalsky, S.Z., Kemelmacher-Shlizerman, I., Singer, A., Basri, R.: Global motion estimation from point matches. In: 2012 Second international conference on 3D imaging, modeling, processing, visualization & transmission. pp. 81-88. IEEE (2012)
+2. Arrigoni, F., Fusiello, A.: Bearing-based network localizability: a unifying view. IEEE transactions on pattern analysis and machine intelligence 41(9), 2049-2069 (2018)
+3. Arrigoni, F., Rossi, B., Fusiello, A.: Robust and efficient camera motion synchronization via matrix decomposition. In: International Conference on Image Analysis and Processing. pp. 444-455. Springer (2015)
+4. Chatterjee, A., Govindu, V.M.: Efficient and robust large-scale rotation averaging. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 521-528 (2013)
+5. Chatterjee, A., Govindu, V.M.: Robust relative rotation averaging. IEEE transactions on pattern analysis and machine intelligence 40(4), 958-972 (2017)
+6. Crandall, D., Owens, A., Snavely, N., Huttenlocher, D.: Discrete-continuous optimization for large-scale structure from motion. In: CVPR 2011. pp. 3001-3008. IEEE (2011)
+7. Cui, H., Shen, S., Hu, Z.: Robust global translation averaging with feature tracks. In: 2016 23rd International Conference on Pattern Recognition (ICPR). pp. 3727-3732. IEEE (2016)
+8. Cui, Z., Jiang, N., Tang, C., Tan, P.: Linear global translation estimation with feature tracks. In: Proc. ECCV. vol. 3, pp. 61-75 (2014)
+9. Cui, Z., Tan, P.: Global structure-from-motion by similarity averaging. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 864-872 (2015)
+0. Dellaert, F., Rosen, D.M., Wu, J., Mahony, R.E., Carlone, L.: Shonan rotation averaging: Global optimality by surfing $\mathrm{so}(\mathfrak{p})^{\mathfrak{n}}$ . In: ECCV (6). Lecture Notes in Computer Science, vol. 12351, pp. 292-308. Springer (2020)
+1. Dong, Q., Gao, X., Cui, H., Hu, Z.: Robust camera translation estimation via rank enforcement. IEEE transactions on cybernetics (2020)
+2. Eriksson, A., Olsson, C., Kahl, F., Chin, T.: Rotation averaging and strong duality. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 127-135 (2018)
+3. Goldstein, T., Hand, P., Lee, C., Voroninski, V., Soatto, S.: Shapefit and shapekick for robust, scalable structure from motion. In: European Conference on Computer Vision. pp. 289-304. Springer (2016)
+4. Govindu, V.M.: Combining two-view constraints for motion estimation. In: Proceedings of the 2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. CVPR 2001. vol. 2, pp. II-II. IEEE (2001)
+5. Govindu, V.M.: Lie-algebraic averaging for globally consistent motion estimation. In: Proceedings of the 2004 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2004. CVPR 2004. vol. 1, pp. I-I. IEEE (2004)
+6. Hartley, R.I., Zisserman, A.: Multiple View Geometry in Computer Vision. Cambridge University Press, ISBN: 0521540518, second edn. (2004)
+7. Hartley, R., Aftab, K., Trumpf, J.: L1 rotation averaging using the weiszfeld algorithm. In: CVPR 2011. pp. 3041-3048. IEEE (2011)
+
+18. Jiang, N., Cui, Z., Tan, P.: A global linear method for camera pose registration. In: Proceedings of the IEEE international conference on computer vision. pp. 481-488 (2013)
+19. Kasten, Y., Geifman, A., Galun, M., Basri, R.: Algebraic characterization of essential matrices and their averaging in multiview settings. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 5895-5903 (2019)
+20. Kasten, Y., Geifman, A., Galun, M., Basri, R.: Gpsfm: Global projective sfm using algebraic constraints on multi-view fundamental matrices. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3264-3272 (2019)
+21. Kennedy, R., Daniilidis, K., Naroditsky, O., Taylor, C.J.: Identifying maximal rigid components in bearing-based localization. In: 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems. pp. 194-201. IEEE (2012)
+22. Martinec, D., Pajdla, T.: Robust rotation and translation estimation in multiview reconstruction. In: 2007 IEEE Conference on Computer Vision and Pattern Recognition. pp. 1-8. IEEE (2007)
+23. McLachlan, G., Krishnan, T.: The EM algorithm and extensions. Wiley, 2. ed edn. (2008)
+24. Moulon, P., Monasse, P., Marlet, R.: Global fusion of relative motions for robust, accurate and scalable structure from motion. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 3248-3255 (2013)
+25. Ozyesil, O., Singer, A.: Robust camera location estimation by convex programming. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 2674-2683 (2015)
+26. Ozyesil, O., Singer, A., Basri, R.: Stable camera motion estimation using convex programming. SIAM Journal on Imaging Sciences 8(2), 1220-1262 (2015)
+27. Schonberger, J.L., Frahm, J.M.: Structure-from-motion revisited. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4104-4113 (2016)
+28. Shi, Y., Lerman, G.: Message passing least squares framework and its application to rotation synchronization. In: International Conference on Machine Learning. pp. 8796-8806. PMLR (2020)
+29. Sidhartha, C., Govindu, V.M.: It is all in the weights: Robust rotation averaging revisited. In: 2021 International Conference on 3D Vision (3DV). pp. 1134-1143. IEEE (2021)
+30. Snavely, N., Seitz, S.M., Szeliski, R.: Photo tourism: exploring photo collections in 3d. In: ACM siggraph 2006 papers, pp. 835-846 (2006)
+31. Sweeney, C., Hollerer, T., Turk, M.: Theia: A fast and scalable structure-from-motion library. In: Proceedings of the 23rd ACM international conference on Multimedia. pp. 693-696 (2015)
+32. Triggs, B., McLauchlan, P.F., Hartley, R.I., Fitzgibbon, A.W.: Bundle adjustment: A modern synthesis. In: International workshop on vision algorithms. pp. 298-372. Springer (1999)
+33. Tron, R., Vidal, R.: Distributed image-based 3-d localization of camera sensor networks. In: Proceedings of the 48h IEEE Conference on Decision and Control (CDC) held jointly with 2009 28th Chinese Control Conference. pp. 901-908. IEEE (2009)
+34. Wilson, K., Snavely, N.: Robust global translations with 1dsfm. In: European Conference on Computer Vision. pp. 61-75. Springer (2014)
+35. Wu, C., et al.: Visualsfm: A visual structure from motion system (2011)
+
+36. Zhuang, B., Cheong, L.F., Lee, G.H.: Baseline desensitizing in translation averaging. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4539-4547 (2018)
\ No newline at end of file
diff --git a/correspondencereweightedtranslationaveraging/images.zip b/correspondencereweightedtranslationaveraging/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..81e78dc016c6eecb07eafe4ac539d96595dad6d7
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:57c3cd89111581c2e6f6d917c0a4ea6749fba7df8daf677b65961e9061237be4
+size 514068
diff --git a/correspondencereweightedtranslationaveraging/layout.json b/correspondencereweightedtranslationaveraging/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..798f649a9732199e9c1758639c70176d228902f7
--- /dev/null
+++ b/correspondencereweightedtranslationaveraging/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb26e19c1a0e185d21db6138c45b34d544799eef791cf1051a7461a3ec78f536
+size 400605
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_content_list.json b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..da8d23d3080995998ff9ea9ab7109ad8f7c230ed
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:81bf678e71a84c31882f92ce0bef289fc215caf6ad43cb1a271e4ad1b5f4ab2d
+size 93478
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_model.json b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9ed4ac06bb57474fcfdaa1f8ac9f37e8490a2985
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:529a5c5695ffce02b342a744dfe7d77572bf29bdf7cf4d6a676d314c757cad52
+size 117974
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_origin.pdf b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8b5e33bcb2b189e3d4ede0bd02cbcfb92075d5c3
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/60c2db75-f41f-4a50-b690-856e6b389819_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f92128c9dbe90672b164e124f92c1120e27d00e192790ad6d8978f5ba94d1beb
+size 1727562
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/full.md b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f4847055feea28c116e0e0347dac2af7add4a638
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/full.md
@@ -0,0 +1,308 @@
+# Cost Aggregation with 4D Convolutional Swin Transformer for Few-Shot Segmentation
+
+Sunghwan Hong $^{1,\star}$ , Seokju Cho $^{1,\star}$ , Jisu Nam $^{1}$ , Stephen Lin $^{2}$ , and Seungryong Kim $^{1}$
+
+$^{1}$ Korea University, Seoul, Korea
+{sung_hwan, seokju_cho, 18wltnzzang, seungryong_kim} @korea.ac.kr
+
+2 Microsoft Research Asia, Beijing, China
+
+stevelin@microsoft.com
+
+Abstract. This paper presents a novel cost aggregation network, called Volumetric Aggregation with Transformers (VAT), for few-shot segmentation. The use of transformers can benefit correlation map aggregation through self-attention over a global receptive field. However, the tokenization of a correlation map for transformer processing can be detrimental, because the discontinuity at token boundaries reduces the local context available near the token edges and decreases inductive bias. To address this problem, we propose a 4D Convolutional Swin Transformer, where a high-dimensional Swin Transformer is preceded by a series of small-kernel convolutions that impart local context to all pixels and introduce convolutional inductive bias. We additionally boost aggregation performance by applying transformers within a pyramidal structure, where aggregation at a coarser level guides aggregation at a finer level. Noise in the transformer output is then filtered in the subsequent decoder with the help of the query's appearance embedding. With this model, a new state-of-the-art is set for all the standard benchmarks in few-shot segmentation. It is shown that VAT attains state-of-the-art performance for semantic correspondence as well, where cost aggregation also plays a central role. Code and trained models are available at https://seokju-cho.github.io/VAT/.
+
+# 1 Introduction
+
+Semantic segmentation is a fundamental computer vision task that aims to label each pixel in an image with its corresponding class. Substantial progress has been made in this direction with the help of deep neural networks and large-scale datasets containing ground-truth segmentation annotations [37, 46, 3, 4, 60]. Manual labeling of pixel-wise segmentation maps, however, requires considerable labor, making it difficult to add new classes. Towards reducing reliance on labeled data, attention has increasingly focused on few-shot segmentation [48, 54], where only a handful of support images and their associated masks are used in predicting the segmentation of a query image.
+
+
+Fig.1: Our VAT reformulates few-shot segmentation as semantic correspondence. VAT sets a new state-of-the-art in few-shot segmentation, and attains state-of-the-art performance for semantic correspondence as well.
+
+The key to few-shot segmentation is in making effective use of the few support samples. Many works attempt this by extracting a prototype model from the samples and using it for feature comparison with the query [57, 10, 35, 76]. However, such approaches disregard pixel-level pairwise relationships between support and query features or the spatial structure of features, which may lead to sub-optimal results.
+
+To account for such relationships, we observe that few-shot segmentation can be reformulated as semantic correspondence, which aims to find pixel-level correspondences across semantically similar images which may contain large intraclass appearance and geometric variations [13, 14, 43]. Recent semantic correspondence models [49, 25, 50, 52, 42, 44, 34, 64, 41] follow the classical matching pipeline [53, 47] of feature extraction, cost aggregation and flow estimation. The cost aggregation stage, where matching scores are refined to produce more reliable correspondence estimates, is of particular importance and has been the focus of much research [52, 42, 51, 22, 34, 29, 41, 6]. Recently, CATs [6] proposed to use vision transformers [11] for cost aggregation, but its quadratic complexity to the number of input tokens limits its applicability. It also disregards the spatial structure of matching costs, which may hurt its performance.
+
+In the area of few-shot segmentation, there also exist methods that attempt to leverage pairwise information by refining features through cross-attention [81] or graph attention [79, 67, 73]. However, they solely rely on raw correlation maps without aggregating the matching scores. As a result, their correspondence may suffer from ambiguities caused by repetitive patterns or background clutters [49, 25, 27, 64, 17]. To address this, HSNet [40] aggregates the matching scores with 4D convolutions, but its limited receptive fields prevent long-range context aggregation and it lacks an ability to adapt to the input content due to the use of fixed kernels.
+
+In this paper, we introduce a novel cost aggregation network, called Volumetric Aggregation with Transformers (VAT), that tackles the few-shot segmentation task through a proposed 4D Convolutional Swin Transformer. Specifically, we first extend Swin Transformer [36] and its patch embedding module to handle a high-dimensional correlation map. The patch embedding module is further extended by incorporating 4D convolutions that alleviate issues caused by patch
+
+embedding, i.e., limited local context near patch boundaries and low inductive bias. The high-dimensional patch embedding module is designed as a series of overlapping small-kernel convolutions, bringing local contextual information to each pixel and imparting convolutional inductive bias. To further boost performance, we compose our architecture with a pyramidal structure that takes the aggregated correlation maps at a coarser level as additional input at a finer level, providing hierarchical guidance. Our affinity-aware decoder then refines the aggregated matching scores in a manner that exploits the higher-resolution spatial structure given by the query's appearance embedding and finally outputs the segmentation mask prediction.
+
+We demonstrate the effectiveness of our method on several benchmarks [54, 31, 30]. Our work attains state-of-the-art performance on all the benchmarks for few-shot segmentation and even for semantic correspondence, highlighting the importance of cost aggregation for both tasks and showing its potential for general matching. We also include ablation studies to justify our design choices.
+
+# 2 Related Work
+
+Few-shot Segmentation. Inspired by the few-shot learning paradigm [48, 57], which learns to learn a model for a novel task with only a limited number of samples, few-shot segmentation has received considerable attention. Following the success of [54], prototypical networks [57] and numerous other works [10, 45, 55, 68, 35, 76, 33, 74, 77, 59, 82, 28] proposed to extract a prototype from support samples, which is used to identify foreground features in the query. In addition, inspired by [80] which observed that simply adding high-level features in feature processing leads to a performance drop, [62] proposed to instead utilize high-level features to compute a prior map that helps to identify targets in the query image. Many variants [59, 78] extended this idea of utilizing prior maps to act as additional information for aggregating feature maps.
+
+However, as methods based on prototypes or prior maps have apparent limitations, e.g., disregarding pairwise relationships between support and query features or spatial structure of feature maps, numerous recent works [79, 67, 40, 73, 32] utilize a correlation map to leverage the pairwise relationships between source and query features. Specifically, [79, 67, 73] use graph attention, HSNet [40] proposes 4D convolutions to exploit multi-level features, and [32] formulates the task as an optimal transport problem. However, these approaches do not provide a means to aggregate the matching scores, solely utilize convolutions for cost aggregation, or use a handcrafted method that is neither learnable nor robust to severe deformations.
+
+Recently, [81] utilized transformers and proposed to use a cycle-consistent attention mechanism to refine the feature maps to become more discriminative, without considering aggregation of matching scores. [59] propose a global and local enhancement module to refine the features using transformers and convolutions, respectively. [39] focuses solely on the transformer-based classifier by
+
+freezing the encoder and decoder. Unlike these works, we propose a 4D Convolutional Swin Transformer for an enhanced and efficient cost aggregation.
+
+Semantic Correspondence. The objective of semantic correspondence is to find correspondences between semantically similar images with additional challenges posed by large intra-class appearance and geometric variations [34, 6, 41]. This is highly similar to the few-shot segmentation setting in that few-shot segmentation also aims to label objects of the same class with large intra-class variation, and thus recent works on both tasks have taken similar approaches. The latest methods [52, 42, 51, 22, 34, 29, 41, 6] in semantic correspondence focus on the cost aggregation stage to find reliable correspondences and demonstrated its importance. Among them, [41] proposed to use 4D convolutions for cost aggregation, though exhibiting apparent limitations due to the limited receptive fields of convolutions and lack of adaptability. CATs [6] resolves this issue and sets a new state-of-the-art by leveraging transformers [65] to aggregate the cost volume. However, it disregards the spatial structure of correlation maps and imparts less inductive bias, i.e., translation equivariance, which limits its generalization power [36, 7, 8]. Moreover, its quadratic complexity may limit applicability when it is used to aggregate correlation maps on its own. In this paper, we propose to resolve the aforementioned issues.
+
+Vision Transformer. Recently, transformer [65], the standard architecture in Natural Language Processing (NLP), has been widely adopted in Computer Vision. Since the pioneering work on ViT [11], numerous works [39, 81, 59, 23, 71, 6, 36] have adopted transformers to replace CNNs or to be used together with CNNs in a hybrid manner. However, due to quadratic complexity to sequence length, transformers often suffer from large a computational burden. Efficient transformers [69, 24, 75, 70] aim to reduce the computational load via an approximated or simplified self-attention. Swin Transformer [36], a network we extend from, reduces computation by performing self-attention within pre-defined local windows. However, these works inherit the issues caused by patch embedding, which we alleviate by incorporating 4D convolutions.
+
+# 3 Methodology
+
+# 3.1 Problem Formulation
+
+The goal of few-shot segmentation is to segment objects from unseen classes in a query image given only a few annotated examples [66]. To mitigate the overfitting caused by insufficient training data, we follow the common protocol of episodic training [66]. Let us denote the training and test sets as $\mathcal{D}_{\mathrm{train}}$ and $\mathcal{D}_{\mathrm{test}}$ , respectively, where the object classes of both sets do not overlap. Under the $K$ -shot setting, multiple episodes are formed from both sets, each consisting of a support set $\mathcal{S} = \{(x_s^k,m_s^k)\}_{k = 1}^{\mathrm{K}}$ , where $(x_{s}^{k},m_{s}^{k})$ is $k$ -th support image and its corresponding mask pair, and a query sample $(x_{q},m_{q})$ , where $x_{q}$ is a query image and $m_q$ is its paired mask. During training, our model takes a sampled
+
+
+Fig. 2: Overall network architecture. Our network consists of feature extraction and cost computation, a pyramidal transformer encoder, and an affinity-aware transformer decoder.
+
+episode from $\mathcal{D}_{\mathrm{train}}$ and learns a mapping from $S$ and $x_{q}$ to a prediction $m_q$ . At inference, our model predicts $\hat{m}_q$ given randomly sampled $S$ and $x_{q}$ from $\mathcal{D}_{\mathrm{test}}$ .
+
+# 3.2 Motivation and Overview
+
+The key to few-shot segmentation is how to effectively utilize the support samples provided for a query image. While conventional methods [62, 59, 81, 77, 28] utilize global- or part-level prototypes extracted from support features, recent methods [79, 67, 40, 73, 32, 81] instead leverage pairwise matching relationships between query and support. However, exploring such relationships is notoriously challenging due to intra-class variations, background clutters, and repetitive patterns. One of the state-of-the-art methods, HSNet [40], aggregates the matching scores with 4D convolutions. However, solely utilizing convolutions may limit performance due to limited receptive fields or lack of adaptability for convolutional kernels. While there has been no approach to aggregate the matching scores with transformers in few-shot segmentation, CATs [6] proposes cost aggregation with transformers in semantic correspondence, demonstrating the effectiveness of transformers as a cost aggregator. On the other hand, the quadratic complexity of transformers with respect to the number of tokens may limit its utility for segmentation. The absence of operations that impart inductive bias, i.e., translation equivariance, may limit its performance as well. Also, CATs [6] defines the tokens of a correlation map in a way that disregards spatial structure, which is likely to be harmful.
+
+The proposed Volumetric Aggregation with Transformers (VAT) is designed to overcome these problems. In the following, we first describe its feature extraction and cost computation. We then present a general extension of Swin Transformer [36] for cost aggregation. Subsequently, we present 4D Convolutional Swin Transformer for resolving the aforementioned issues. Lastly, we introduce several additional techniques including Guided Pyramidal Processing (GPP) and Affinity-aware Transformer Decoder (ATD) to further boost performance, and combine them to complete the design.
+
+# 3.3 Feature Extraction and Cost Computation
+
+We extract features from query and support images and compute an initial cost between them following the conventional process [49, 58, 52, 51, 64, 17, 6]. Given query and support images, $x_{q}$ and $x_{s}$ , we use a CNN [16, 56] to produce a sequence of $L$ feature maps, $\{(F_q^l,F_s^l)\}_{l = 1}^L$ , where $F_{q}^{l}$ and $F_{s}^{l}$ denote query and support feature maps at the $l$ -th level. A support mask, $m_{s}$ , is used to encode segmentation information and filter out the background information as done in [28, 40, 78]. We obtain a masked support feature as $\hat{F}_s^l = F_s^l\odot \psi^l (m_s)$ , where $\odot$ denotes the Hadamard product and $\psi^l (\cdot)$ denotes a function that resizes the given tensor followed by expansion along the channel dimension of the $l$ -th layer.
+
+Given a pair of feature maps, $F_{q}^{l}$ and $F_{s}^{l}$ , we compute a correlation map using the inner product between $l-2$ normalized features such that
+
+$$
+\mathcal {C} ^ {l} (i, j) = \operatorname {R e L U} \left(\frac {F _ {q} ^ {l} (i) \cdot \hat {F} _ {s} ^ {l} (j)}{\| F _ {q} ^ {l} (i) \| \| \hat {F} _ {s} ^ {l} (j) \|}\right), \tag {1}
+$$
+
+where $i$ and $j$ denote 2D spatial positions of feature maps. As done in [40], we collect correlation maps computed from all the intermediate features of the same spatial size and stack them to obtain a stacked correlation map $\mathcal{C}^p \in \mathbb{R}^{h_q \times w_q \times h_s \times w_s \times |\mathcal{L}^p|}$ , where $(h_q, w_q)$ and $(h_s, w_s)$ are the height and width of the query and support feature maps, respectively, and $\mathcal{L}^p$ is a subset of CNN layer indices $\{1, \dots, L\}$ at pyramid layer $p$ , containing correlation maps of identical spatial size.
+
+# 3.4 Pyramidal Transformer Encoder
+
+In this section, we present 4D Convolutional Swin Transformer for aggregating the correlation maps and then incorporate it into a pyramidal architecture.
+
+Cost Aggregation with Transformers. For a transformer to process a correlation map, a means for token reduction is essential, since it would be infeasible for even an efficient transformer [69, 24, 75, 70, 36] to handle a correlation map otherwise. However, when one employs a transformer for cost aggregation, the problem of how to define the tokens for correlation maps, which differ in shape from images, text or features [65, 11], is non-trivial. The first attempt to process correlation maps is CATs [6], which reshapes the 4D correlation maps into 2D maps and performs self-attention in 2D. This disregards the spatial structure of correlation maps, i.e., over both support and query, which could limit its performance. To address this, one may treat all the spatial entries, e.g., $h_q \times w_q \times h_s \times w_s$ , as tokens and treat $\mathcal{L}^p$ as the feature dimension for tokens. However, this results in a substantial computational burden that increases with larger correlation maps. This prevents the use of standard transformers [65, 11] and encourages use of efficient versions as in [69, 24, 75, 70, 36]. However, the use of simplified (or approximated) self-attention may be sub-optimal for performance, as will be discussed in Section 4.4. Furthermore, as proven in the
+
+
+Fig. 3: Illustration of shifted 4D windows in VTM. It computes self-attention within the partitioned windows and considers inter-window interactions by shifting the windows.
+
+optical flow and semantic correspondence literature [58, 51], neighboring pixels tend to have similar correspondences. To preserve the spatial structure of correlation maps, we choose to use Swin Transformer [36] as it not only provides efficient self-attention computation, but also maintains the smoothness property of correlation maps while still providing sufficient long-range self-attention.
+
+To employ Swin Transformer [36] for cost aggregation, we need to extend it to process higher dimensional input, specifically a 4D correlation map. We first follow the conventional patch embedding procedure [11] to embed correlation maps, as they cannot be processed by transformers due to the large number of tokens. However, we extend the patch embedding module to a Volumetric Embedding Module (VEM) which handles higher dimensional inputs, such that $\mathcal{M}^p = \mathrm{VEM}(\mathcal{C}^p)$ . Following a procedure similar to patch embedding, we reshape the correlation map to a sequence of flattened 4D windows using a large convolutional kernel, e.g., $16\times 16\times 16\times 16$ . Then, we extend the self-attention computations, as shown in Fig. 3, by evenly partitioning the query and support spatial dimensions of $\mathcal{M}^p$ into non-overlapping sub-correlation maps $\mathcal{M}'^p\in \mathbb{R}^{n\times n\times n\times n\times D}$ . We compute self-attention within each partitioned sub-correlation map. Subsequently, we shift the windows by a displacement of $\left(\lfloor \frac{n}{2}\rfloor ,\lfloor \frac{n}{2}\rfloor ,\lfloor \frac{n}{2}\rfloor ,\lfloor \frac{n}{2}\rfloor\right)$ pixels from the previously partitioned windows, then perform self-attention within the newly created windows. Then as done in the original Swin Transformer [36], we simply roll the correlation map back to its original form. In computing self-attention, we use relative position bias and take the values from an expanded parameterized bias matrix, following [19, 20, 36]. We leave the other components of Swin Transformer blocks unchanged, e.g., Layer Normalization (LN) [1] and MLP layers. We call this extension the Volumetric Transformer Module (VTM). To summarize, the overall process is defined as:
+
+$$
+\mathcal {A} ^ {p} = \operatorname {V T M} \left(\mathcal {M} ^ {p}\right). \tag {2}
+$$
+
+4D Convolutional Swin Transformer. Although the proposed cost aggregation with transformers can solve the aforementioned issues of using CNNs and the high computational burden of using standard transformers, it may not avoid the issue that other transformers share [11, 69, 24, 75, 70]: lack of translation equivariance. This is primarily caused by utilizing non-overlapping operations prior to self-attention computation. Although Swin Transformer alleviates the issue to some extent by using relative positioning bias [36], it provides an insufficient approximation. We argue that the Volumetric Embedding Module is what needs to be addressed as it leads to several issues. First, the use of large
+
+
+Fig. 4: Overview of 4D Convolutional Swin Transformer. We replace the VEM with VCM and the output undergoes VTM for cost aggregation.
+
+non-overlapping convolution kernels only provides limited inductive bias. Relatively lower translation equivariance is achieved from non-overlapping operations compared to that which are overlapping. This limited inductive bias results in relatively lower generalization power and performance [72, 8, 7, 36]. Furthermore, we argue that for dense prediction tasks, disregarding window boundaries due to non-overlapping kernels hurts overall performance due to discontinuity.
+
+To address the above issues, we replace the Volumetric Embedding Module (VEM) with a module consisting of a series of overlapping convolutions, which we call the Volumetric Convolution Module (VCM). Concretely, we sequentially reduce spatial dimensions of the support and query by applying 4D spatial max-pooling, overlapping 4D convolutions, ReLU, and Group Normalization (GN), where we project the multi-level similarity vector at each 4D position, i.e., projecting a vector size of $|\mathcal{L}^p|$ , to an arbitrary fixed dimension denoted as $D$ . Considering receptive fields as a 4D window, i.e., $m \times m \times m \times m$ , we obtain a tensor $\mathcal{C}^p \in \mathbb{R}^{h_{q}^{\prime}, p \times w_{q}^{\prime}, p \times h_{s}^{\prime}, p \times w_{s}^{\prime}, p \times D}$ from $\mathcal{C}^p$ , where $h_{s}^{\prime}, w_{s}^{\prime}, h_{q}^{\prime}, p$ and $w_{q}^{\prime}, p$ are the processed sizes. Note that a different size of $m$ can be chosen for the support and query spatial dimensions. An overview of VCM is illustrated in Fig. 4. Overall, we define such a process as the following:
+
+$$
+\mathcal {M} ^ {p} = \operatorname {V C M} \left(\mathcal {C} ^ {p}\right). \tag {3}
+$$
+
+In this way, our model benefits from additional inductive bias as well as better handling at window boundaries.
+
+Moreover, to stabilize the learning, we propose an additional technique to enforce the networks to estimate residual matching scores as complementary details. We add residual connections in order to expedite the learning process [16, 6, 83], accounting for the fact that at the initial phase when the input $\mathcal{M}^p$ is fed, erroneous matching scores are inferred due to randomly-initialized parameters of transformers, which could complicate the learning process as the networks need to learn the complete matching details from random matching scores.
+
+Guided Pyramidal Processing. Following [40, 59], we also employ a coarse-to-fine approach through pyramidal processing as illustrated in Fig. 2. Motivated by numerous recent works [81, 41, 6, 40] in both semantic matching and few-shot
+
+segmentation which have demonstrated that leveraging multi-level features can boost performance by a large margin, we also use a pyramidal architecture.
+
+In our coarse-to-fine approach, which we refer to as Guided Pyramidal Processing (GPP), the aggregation of a finer-level correlation map $\mathcal{A}^p$ is guided by the aggregated correlation map of the previous (coarser) level $\mathcal{A}^{p + 1}$ . Concretely, an aggregated correlation map $\mathcal{A}^{p + 1}$ is up-sampled into a map $\mathrm{up}(\mathcal{A}^{p + 1})$ which is added to the next level's correlation map $\mathcal{A}^p$ to serve as guidance. This process is repeated until the finest-level aggregated map is computed and passed to the decoder. As shown in Table 4, GPP leads to appreciable performance gains.
+
+With GPP, the pyramidal transformer encoder is finally defined as:
+
+$$
+\mathcal {A} ^ {p} = \operatorname {V T M} \left(\operatorname {V C M} \left(\mathcal {C} ^ {p}\right) + \operatorname {u p} \left(\mathcal {A} ^ {p + 1}\right)\right), \tag {4}
+$$
+
+where $\mathrm{up}(\cdot)$ denotes bilinear upsampling.
+
+# 3.5 Affinity-Aware Transformer Decoder
+
+Given the aggregated correlation map produced by the pyramidal transformer encoder, a transformer-based decoder generates the final segmentation mask. To improve performance, we propose to conduct further aggregation within the decoder with the aid of the appearance embedding obtained from query feature maps. The query's appearance embedding can help in two ways. First, appearance affinity information is an effective guide for filtering noise in matching scores, as proven in the stereo matching literature, e.g., Cost Volume Filtering (CVF) [18, 58]. In addition, the higher-resolution spatial structure provided by an appearance embedding can be exploited to improve up-sampling quality, resulting in a highly accurate prediction mask $\hat{m}^q$ where fine details are preserved.
+
+For the design of our Affinity-aware Transformer Decoder (ATD), we take the average over the support image dimensions of $\mathcal{A}^p$ , concatenate it with the appearance embedding from query feature maps, and then aggregate by transformers [65, 69, 70, 36] with subsequent bilinear interpolation. The process is defined as the following:
+
+$$
+\hat {m} _ {q} = \operatorname {A T D} \left(\left[ \mathcal {A} ^ {\prime, p}, \mathcal {P} \left(F _ {q}\right) \right]\right), \tag {5}
+$$
+
+where $\mathcal{A}^{\prime,p} \in \mathbb{R}^{h_{q}^{\prime,p} \times w_{q}^{\prime,p} \times D}$ is extracted by average pooling on $\mathcal{A}^p$ over the spatial dimensions of the support image, $\mathcal{P}(\cdot)$ is a linear projection, $\mathcal{P}(F_q) \in \mathbb{R}^{h_{q}^{\prime,p} \times w_{q}^{\prime,p} \times c}$ , and $[\cdot, \cdot]$ denotes concatenation. We sequentially refine the output immediately after bilinear upsampling to recapture fine details and integrate appearance information.
+
+# 3.6 Extension to $K$ -Shot Setting
+
+Given $K$ pairs of support image and mask $\{(x_s^i, m_s^i)\}_{i=1}^K$ and a query image $x_q$ , our model forward-passes $K$ times to obtain $K$ different query masks $\hat{m}_q^k$ . We sum up all the $K$ predictions at each spatial location, and if the sum divided by $K$ exceeds a threshold $\tau$ , the location is predicted as foreground, and otherwise it is background.
+
+| Backbone network | Methods | 1-shot | 5-shot | #learnable
+params | | |
| 50 | 51 | 52 | 53 | mIoU | FB-IoU | mBA | 50 | 51 | 52 | 53 | mIoU | FB-IoU | mBA | |
| ResNet50 [16] | PANet [68] | 44.0 | 57.5 | 50.8 | 44.0 | 49.1 | - | - | 55.3 | 67.2 | 61.3 | 53.2 | 59.3 | - | - | 23.5M |
| PFENet [62] | 61.7 | 69.5 | 55.4 | 56.3 | 60.8 | 73.3 | - | 63.1 | 70.7 | 55.8 | 57.9 | 61.9 | 73.9 | - | 10.8M |
| ASGNet [28] | 58.8 | 67.9 | 56.8 | 53.7 | 59.3 | 69.2 | - | 63.4 | 70.6 | 64.2 | 57.4 | 63.9 | 74.2 | - | 10.4M |
| CWT [39] | 56.3 | 62.0 | 59.9 | 47.2 | 56.4 | - | - | 61.3 | 68.5 | 68.5 | 56.6 | 63.7 | - | - | - |
| RePRI [2] | 59.8 | 68.3 | 62.1 | 48.5 | 59.7 | - | 49.0 | 64.6 | 71.4 | 71.1 | 59.3 | 66.6 | - | 43.8 | - |
| HSNet [40] | 64.3 | 70.7 | 60.3 | 60.5 | 64.0 | 76.7 | 53.9 | 70.3 | 73.2 | 67.4 | 67.1 | 69.5 | 80.6 | 54.5 | 2.6M |
| CyCTR [81] | 65.7 | 71.0 | 59.5 | 59.7 | 64.0 | - | - | 69.3 | 73.5 | 63.8 | 63.5 | 67.5 | - | - | - |
| VAT (ours) | 67.6 | 72.0 | 62.3 | 60.1 | 65.5 | 77.8 | 54.4 | 72.4 | 73.6 | 68.6 | 65.7 | 70.1 | 80.9 | 54.8 | 3.2M |
| ResNet101 [16] | FWB [45] | 51.3 | 64.5 | 56.7 | 52.2 | 56.2 | - | - | 54.8 | 67.4 | 62.2 | 55.3 | 59.9 | - | - | 43.0M |
| DAN [67] | 54.7 | 68.6 | 57.8 | 51.6 | 58.2 | 71.9 | - | 57.9 | 69.0 | 60.1 | 54.9 | 60.5 | 72.3 | - | - |
| PFENet [62] | 60.5 | 69.4 | 54.4 | 55.9 | 60.1 | 72.9 | - | 62.8 | 70.4 | 54.9 | 57.6 | 61.4 | 73.5 | - | 10.8M |
| ASGNet [28] | 59.8 | 67.4 | 55.6 | 54.4 | 59.3 | 71.7 | - | 64.6 | 71.3 | 64.2 | 57.3 | 64.4 | 75.2 | - | 10.4M |
| CWT [39] | 56.9 | 65.2 | 61.2 | 48.8 | 58.0 | - | - | 62.6 | 70.2 | 68.8 | 57.2 | 64.7 | - | - | - |
| RePRI [2] | 59.6 | 68.6 | 62.2 | 47.2 | 59.4 | - | 45.1 | 66.2 | 71.4 | 67.0 | 57.7 | 65.6 | - | 42.0 | - |
| HSNet [40] | 67.3 | 72.3 | 62.0 | 63.1 | 66.2 | 77.6 | 53.9 | 71.8 | 74.4 | 67.0 | 68.3 | 70.4 | 80.6 | 54.4 | 2.6M |
| CyCTR [81] | 67.2 | 71.1 | 57.6 | 59.0 | 63.7 | 73.0 | - | 71.0 | 75.0 | 58.5 | 65.0 | 67.4 | 75.4 | - | - |
| VAT (ours) | 70.0 | 72.5 | 64.8 | 64.2 | 67.9 | 79.6 | 54.7 | 75.0 | 75.2 | 68.4 | 69.5 | 72.0 | 83.2 | 54.8 | 3.3M |
+
+Table 1: Performance comparison on PASCAL-5 $^i$ [54]. Best results in bold, and second best are underlined.
+
+| Backbone feature | Methods | 1-shot | 5-shot |
| 200 | 201 | 202 | 203 | mean | FB-IoU | mBA | 200 | 201 | 202 | 203 | mean | FB-IoU | mBA | |
| ResNet50 [16] | PMM [76] | 29.3 | 34.8 | 27.1 | 27.3 | 29.6 | - | - | 33.0 | 40.6 | 30.3 | 33.3 | 34.3 | - | - | |
| RPMM [76] | 29.5 | 36.8 | 28.9 | 27.0 | 30.6 | - | - | 33.8 | 42.0 | 33.0 | 33.3 | 35.5 | - | - | |
| PFENet [62] | 36.5 | 38.6 | 34.5 | 33.8 | 35.8 | - | - | 36.5 | 43.3 | 37.8 | 38.4 | 39.0 | - | - | |
| ASGNet [28] | - | - | - | - | 34.6 | 60.4 | - | - | - | - | 42.5 | 67.0 | - | | |
| RePRI [2] | 32.0 | 38.7 | 32.7 | 33.1 | 34.1 | - | 6.31 | 39.3 | 45.4 | 39.7 | 41.8 | 41.6 | - | 4.21 | |
| HSNet [40] | 36.3 | 43.1 | 38.7 | 38.7 | 39.2 | 68.2 | 53.0 | 43.3 | 51.3 | 48.2 | 45.0 | 46.9 | 70.7 | 53.8 | |
| CyCTR [81] | 38.9 | 43.0 | 39.6 | 39.8 | 40.3 | - | - | 41.1 | 48.9 | 45.2 | 47.0 | 45.6 | - | - | |
| VAT (ours) | 39.0 | 43.8 | 42.6 | 39.7 | 41.3 | 68.8 | 54.2 | 44.1 | 51.1 | 50.2 | 46.1 | 47.9 | 72.4 | 54.9 | |
+
+Table 2: Performance comparison on COCO- ${20}^{i}$ [31].
+
+# 4 Experiments
+
+# 4.1 Implementation Details
+
+We use ResNet50 and ResNet101 [16] pre-trained on ImageNet [9] and freeze the weights during training, following [40, 80]. No data augmentation is used for training, as explained in the supplementary material. We set the input image sizes to 417 or 473, following [28, 2]. The window size for Swin Transformer is set to 4. We use AdamW [38] with a learning rate of $5\mathrm{e} - 4$ . Feature maps from conv3_x $(p = 3)$ , conv4_x $(p = 4)$ and conv5_x $(p = 5)$ are taken for cost computation. The $K$ -shot threshold $\tau$ is set to 0.5 and the embedding dimension $D$ to 128. For appearance affinity, we take the last layers from conv2_x, conv3_x and conv4_x when training on FSS-1000 [30], and conv4_x is excluded when training on PASCAL-5 $^i$ [54] and COCO-20 $^i$ [31]. We set $c$ to 16, 32, and 64 for conv2_x, conv3_x, and conv4_x.
+
+# 4.2 Experimental Settings
+
+Datasets. We evaluate our approach on three standard few-shot segmentation datasets, PASCAL-5 $^i$ [54], COCO-20 $^i$ [31], and FSS-1000 [30]. PASCAL-5 $^i$ contains images from PASCAL VOC 2012 [12] with added mask annotations [15].
+
+| Backbone feature | Methods | mIoU | FB-IoU | mBA |
| 1-shot | 5-shot | 1-shot | 5-shot | 1-shot | 5-shot |
| ResNet50 [16] | FSOT [32] | 82.5 | 83.8 | - | - | - | - |
| HSNet [40] | 85.5 | 87.8 | 91.0 | 92.5 | 62.1 | 63.3 |
| VAT | 90.1 | 90.7 | 93.8 | 94.2 | 68.3 | 68.4 |
| ResNet101 [16] | DAN [67] | 85.2 | 88.1 | - | - | - | - |
| HSNet [40] | 86.5 | 88.5 | 91.6 | 92.9 | 62.4 | 63.6 |
| VAT | 90.3 | 90.8 | 94.0 | 94.4 | 68.0 | 68.6 |
+
+Table 3: Mean IoU comparison on FSS-1000 [30].
+
+It consists of 20 object classes, and as done in OSLSM [54], they are evenly divided into 4 folds $i \in \{0,1,2,3\}$ for cross-validation, where each fold contains 5 classes. COCO- $20^{i}$ contains 80 object classes, and as done for PASCAL- $5^{i}$ , the dataset is evenly divided into 4 folds of 20 classes each. FSS-1000 is a more diverse dataset consisting of 1000 object classes. Following [30], we divide the 1000 categories into 3 splits for training, validation and testing, which consist of 520, 240 and 240 classes, respectively. For PASCAL- $5^{i}$ and COCO- $20^{i}$ , we follow the common evaluation practice [40,62,35] and standard cross-validation protocol, where each fold $i$ is used for evaluation with the other folds used for training.
+
+Evaluation Metric. Following common practice [80, 62, 40, 81], we adopt mean intersection over union (mIoU) and foreground-background IoU (FB-IoU) as our evaluation metrics. The mIoU averages over all IoU values for all object classes such that $\mathrm{mIoU} = \frac{1}{C}\sum_{c=1}^{C}\mathrm{IoU}_c$ , where $C$ is the number of classes in each fold, e.g., $C = 20$ for COCO-20 $^i$ . FB-IoU disregards the object classes and instead averages over foreground and background IoU ( $\mathrm{IoU}_{\mathrm{F}}$ and $\mathrm{IoU}_{\mathrm{B}}$ ) such that $\mathrm{FB - IoU} = \frac{1}{2}(\mathrm{IoU}_{\mathrm{F}} + \mathrm{IoU}_{\mathrm{B}})$ . We additionally adopt Mean Boundary Accuracy (mBA) introduced in [5] to evaluate the model's ability to capture fine details. To measure mBA, we first sample 5 radii in $[3, \frac{w + h}{300}]$ at a uniform interval, where $w$ and $h$ are width and height of input image, and average the segmentation accuracy within each radius from the ground-truth boundary.
+
+# 4.3 Few-shot Segmentation Results
+
+Table 1 summarizes quantitative results on PASCAL-5 $^i$ [54]. The tests were conducted on two backbone networks, ResNet50 and ResNet101 [16]. The proposed method outperforms the others on almost all the folds in terms of both mIoU and FB-IoU. It surpasses the others, including HSNet [40], in mBA as well, since our ATD helps to improve up-sampling quality by providing higher-level spatial structure for reference. Consistent with this, VAT also attains state-of-the-art performance on COCO-20 $^i$ [31], as shown in Table 2. Interestingly, for the most recent dataset specifically created for few-shot segmentation, FSS-1000 [30], VAT outperforms HSNet [40] and FSOT [32] by a large margin, almost a $4.6\%$ increase in mIoU compared to HSNet with ResNet50 as shown in Table 3. VAT sets a new state-of-the-art for all of these benchmarks. We note that our method outperforms HSNet [40] despite having more learnable parameters, which is known
+
+to have an inverse relation to generalization power [61], a trend seen in Table 1. With the proposed method, i.e., 4D convolutional Swin Transformer, that is designed to address the issues like lack of inductive bias, VAT can have a larger number of learnable parameters than that of HSNet [40], yet VAT has greater generalization power as well.
+
+# 4.4 Ablation Study
+
+We conducted ablations on FSS-1000 [30], a large-scale dataset specifically constructed for few-shot segmentation.
+
+Effectiveness of each component in VAT. As the baseline model, we take the architecture composed of VEM and the 2D convolution decoder used in HSNet [40]. We then progressively add our components one-by-one as shown in Table 4. Note that we included (IV) and (V) to show the effectiveness of VCM alone and the performance of a model highly similar to HSNet [40], respectively.
+
+As summarized in Table 4, each component helps to boost performance. Starting from the baseline (I), adding Swin Transformer (II) brings a large gain, which indicates that Swin Transformer ef
+
+
+Fig.5: Convergence comparison. Although VAT starts at a lower mIoU, it quickly exceeds HSNet [40].
+
+fectively performs cost aggregation thanks to its approximated inductive bias and ability to consider spatial structure. When the VEM is replaced by VCM (III), we also observe a significant improvement, which confirms that the issues due to non-overlap are alleviated. We note that (IV) also highlights the importance of inductive bias. As (V) is approximately equivalent to HSNet [40], we first compare it with (III), which shows the superiority of the proposed 4D Convolutional Swin Transformer. By including the additional components in (VI) and (VII), the performance is further boosted. Moreover, we observe a large gain in mBA by adding ATD. This shows that the higher-resolution spatial structure provided by appearance embeddings help to refine the fine details. We additionally provide a visualization of convergence in comparison to HSNet [40] in Fig. 5. Thanks to the early convolutions [72], VAT quickly converges and exceeds HSNet [40] even though it starts at a lower mIOU.
+
+Base architecture of VTM. As summarized in Table 5, we provide an ablation study to evaluate the effectiveness of different aggregators for VTM. For cost aggregation, there exists a few learnable aggregators, including MLP-, convolution- and transformer-based aggregators, any of which could be used as a base architecture for VTM. It should be noted that the use of standard transformer [65] and MLP-mixer [63] is not feasible due to memory requirements. Specifically, we calculated the memory consumption of each and found
+
+| Components | FSS-1000 [30] |
| mIoU (%) | mBA (%) |
| 1-shot | 5-shot | 1-shot | 5-shot |
| (I) | Baseline | 80.0 | 81.8 | 56.7 | 56.9 |
| (II) | + Swin Trans. | 85.4 | 87.4 | 58.8 | 59.5 |
| (III) | + VCM | 87.0 | 88.6 | 60.1 | 61.3 |
| (IV) | only VCM | 86.4 | 88.0 | 59.6 | 60.1 |
| (V) | (IV) + 4D mix | 86.4 | 87.8 | 59.9 | 59.6 |
| (VI) | (III) + GPP | 87.3 | 88.8 | 60.7 | 61.4 |
| (VII) | + ATD | 90.3 | 90.8 | 68.0 | 68.6 |
+
+Table 4: Ablation study for VAT.
+
+| Different aggregators | FSS-1000 [30]mIoU (%)|mBA (%) | Memory(GB) | Run-time(ms) |
| Standard transformer [65] | OOM | OOM | 84 | N/A |
| MLP-Mixer [63] | OOM | OOM | OOM | N/A |
| Center-pivot 4D convolutions [40] | 88.1 | 66.5 | 3.5 | 52.7 |
| Linear transformer [24] | 87.7 | 66.5 | 3.5 | 56.8 |
| Fastformer [70] | 87.8 | 66.4 | 3.5 | 122.9 |
| 4D Conv. Swin transformer (Ours) | 90.3 | 68.0 | 3.8 | 57.3 |
+
+Table 5: Ablation study for VTM. OOM: Out of Memory.
+
+that using standard transformer requires approximately 84 GB per batch, while the memory for MLP-Mixer could not be measured as it is much greater than standard transformer. Also, we note that the architecture with center-pivot convolutions is equivalent to a deeper version of the architecture with VCM.
+
+For a fair comparison, we only replace VTM with another aggregator and leave all the other components in our architecture unchanged. We observe that our method outperforms the other aggregators by a large margin. Interestingly, although center-pivot 4D convolution [40] also focuses on locality as in Swin Transformer [36], the performance gap indicates that the ability to adaptively consider pixel-wise interactions is critical. Also, we conjecture that the SW-MSA operation helps to compensate for the lack of global aggregation, which center-pivot convolutions lack. Another interesting point is that Linear Transformer [24] and Fastformer [70], which benefit from the global receptive fields of transformers and approximate the self-attention computation, achieve similar performance.
+
+We additionally provide memory and run-time comparison to other aggregators in Table 5. The results are obtained using a single NVIDIA GeForce RTX 3090 GPU and Intel Core i7-10700 CPU. We observe that VAT is relatively slower and consumes more memory. However, 0.3 GB more memory consumption and 5 ms slower run time is a minor sacrifice for better performance.
+
+Can VAT also perform well on semantic correspondence? To tackle the few-shot segmentation task, we reformulated it as finding semantic correspondences under large intra-class variations and geometric deformations. This suggests that the proposed method could be effective for semantic correspondence as well. Here, we compare VAT to other state-of-the-art methods in semantic correspondence.
+
+In order to ensure a fair comparison, we note whether each method leverages multi-level features and fine-tunes the backbone networks. We additionally denote the types of cost aggregation. Note that the only difference we made for this experiment is the objective function for loss computation. Following the common protocol [42, 44, 83, 21, 41, 6], we use standard benchmarks for this task and our model was trained on the training split of PF-PASCAL [14] when evaluated on the test split of PF-PASCAL [14] and PF-WILLOW [13], and trained on SPair-71k [43] when evaluated on SPair-71k [43]. Experimental setting and implementation details can be found in supplementary material.
+
+As shown in Table 6, VAT either sets a new state-of-the-art [43, 13] or attains the second highest PCK [14], indicating the importance of cost aggregation in
+
+| Methods | F.T. Feat. | Data Aug. | Cost Aggregation | SPair-71k [43] | PF-PASCAL [14] | PF-WILLOW [13] |
| PCK @ αbbox | PCK @ αimg | PCK @ αbbox |
| 0.03 | 0.05 | 0.1 | 0.15 | 0.03 | 0.05 | 0.1 | 0.15 | 0.05 | 0.1 | 0.15 |
| NC-Net [52] | ✓ | X | 4D Conv. | - | - | 20.1 | - | 30.9 | 54.3 | 78.9 | 86.0 | 33.8 | 67.0 | 83.7 |
| SCOT [34] | - | X | OT-RHM | - | - | 35.6 | - | - | 63.1 | 85.4 | 92.7 | 47.8 | 76.0 | 87.1 |
| CHM [41]* | ✓ | X | 4D Conv. | 14.9 | 27.2 | 46.3 | 57.5 | 67.5 | 80.1 | 91.6 | 94.9 | 52.7 | 79.4 | 87.5 |
| MMNet [83] | ✓ | X | - | - | - | 40.9 | - | - | 77.6 | 89.1 | 94.3 | - | - | - |
| PMNC [26] | ✓ | X | 4D Conv. | - | - | 50.4 | - | 71.6 | 82.4 | 90.6 | - | - | - | - |
| DHPF [44]* | ✓ | X | RHM | 11.0 | 20.9 | 37.3 | 47.5 | 52.0 | 75.7 | 90.7 | 95.0 | 49.5 | 77.6 | 89.1 |
| ✓ | ✓ | RHM | - | - | 39.4 | - | - | - | - | - | - | - | - |
| CATs [6]* | ✓ | X | Transformer | 10.2 | 21.6 | 43.5 | 55.0 | 41.6 | 67.5 | 89.1 | 94.9 | 46.6 | 75.6 | 87.5 |
| ✓ | ✓ | Transformer | 13.8 | 27.7 | 49.9 | 61.7 | 49.9 | 75.4 | 92.6 | 96.4 | 50.3 | 79.2 | 90.3 |
| VAT | ✓ | X | Transformer | 14.9 | 28.3 | 48.4 | 59.1 | 54.6 | 72.9 | 91.1 | 95.6 | 46.0 | 78.8 | 91.3 |
| ✓ | ✓ | Transformer | 19.6 | 35.0 | 55.5 | 65.1 | 62.7 | 78.2 | 92.3 | 96.2 | 52.8 | 81.6 | 91.4 |
+
+Table 6: Quantitative results on SPair-71k [43], PF-PASCAL [14] and PF-WILLOW [13].*: The results are obtained using pretrained weights provided by authors or taken from papers.
+
+both few-shot segmentation and semantic correspondence. It also has the potential to benefit general-purpose matching networks as well. Furthermore, when data augmentation is used, we observe a relatively large performance gain compared to DHPF [44], showing that augmentation helps to address the heavy need for data and lack of inductive bias in transformers [11,6]. Although VAT is on par with state-of-the-art on PF-PASCAL [14], we argue that PF-PASCAL [14] is almost saturated, which makes a comparison difficult. Also, it should be noted that for performance on PF-WILLOW [13], VAT outperforms other methods by large margin, which clearly shows superior generalization power of the proposed 4D Convolutional Swin Transformer.
+
+# 5 Conclusion
+
+In this paper, we presented a novel cost aggregation network for few-shot segmentation. To address issues that arise from tokenization of a correlation map for transformer processing, we proposed a 4D Convolutional Swin Transformer, where a high-dimensional Swin Transformer is preceded by a series of small-kernel convolutions. To boost aggregation performance, we applied transformers within a pyramidal structure, and the output is then filtered and in the subsequent decoder with the help of image's appearance embedding. We have shown that the proposed method attains state-of-the-art performance for all the standard benchmarks for both few-shot segmentation and semantic correspondence, where cost aggregation plays a central role.
+
+Acknowledgements. This research was supported by the MSIT, Korea (IITP-2022-2020-0-01819, ICT Creative Consilience program), and National Research Foundation of Korea (NRF-2021R1C1C1006897).
+
+# References
+
+1. Ba, J.L., Kiros, J.R., Hinton, G.E.: Layer normalization. arXiv preprint arXiv:1607.06450 (2016)
+2. Boudiaf, M., Kervadec, H., Masud, Z.I., Piantanida, P., Ben Ayed, I., Dolz, J.: Few-shot segmentation without meta-learning: A good transductive inference is all you need? In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2021)
+3. Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K., Yuille, A.L.: Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence (2017)
+4. Chen, L.C., Zhu, Y., Papandreou, G., Schroff, F., Adam, H.: Encoder-decoder with atrous separable convolution for semantic image segmentation. In: Proceedings of the European conference on computer vision (ECCV) (2018)
+5. Cheng, H.K., Chung, J., Tai, Y.W., Tang, C.K.: CascadePSP: Toward class-agnostic and very high-resolution segmentation via global and local refinement. In: CVPR (2020)
+6. Cho, S., Hong, S., Jeon, S., Lee, Y., Sohn, K., Kim, S.: Cats: Cost aggregation transformers for visual correspondence. In: Thirty-Fifth Conference on Neural Information Processing Systems (2021)
+7. Dai, Z., Liu, H., Le, Q., Tan, M.: Coatnet: Marrying convolution and attention for all data sizes. Advances in Neural Information Processing Systems 34 (2021)
+8. d'Ascoli, S., Touvron, H., Leavitt, M., Morcos, A., Biroli, G., Sagun, L.: Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697 (2021)
+9. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition. IEEE (2009)
+0. Dong, N., Xing, E.P.: Few-shot semantic segmentation with prototype learning. In: BMVC (2018)
+1. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+2. Everingham, M., Van Gool, L., Williams, C.K., Winn, J., Zisserman, A.: The Pascal visual object classes (voc) challenge. International journal of computer vision (2010)
+3. Ham, B., Cho, M., Schmid, C., Ponce, J.: Proposal flow. In: CVPR (2016)
+4. Ham, B., Cho, M., Schmid, C., Ponce, J.: Proposal flow: Semantic correspondences from object proposals. IEEE transactions on pattern analysis and machine intelligence (2017)
+5. Hariharan, B., Arbeláez, P., Girshick, R., Malik, J.: Simultaneous detection and segmentation. In: European conference on computer vision. Springer (2014)
+6. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition (2016)
+7. Hong, S., Kim, S.: Deep matching prior: Test-time optimization for dense correspondence. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021)
+
+18. Hosni, A., Rhemann, C., Bleyer, M., Rother, C., Gelautz, M.: Fast cost-volume filtering for visual correspondence and beyond. PAMI (2012)
+19. Hu, H., Gu, J., Zhang, Z., Dai, J., Wei, Y.: Relation networks for object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3588-3597 (2018)
+20. Hu, H., Zhang, Z., Xie, Z., Lin, S.: Local relation networks for image recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3464-3473 (2019)
+21. Huang, S., Wang, Q., Zhang, S., Yan, S., He, X.: Dynamic context correspondence network for semantic alignment. In: ICCV (2019)
+22. Jeon, S., Min, D., Kim, S., Choe, J., Sohn, K.: Guided semantic flow. In: ECCV. Springer (2020)
+23. Jiang, W., Trulls, E., Hosang, J., Tagliasacchi, A., Yi, K.M.: Cotr: Correspondence transformer for matching across images. arXiv preprint arXiv:2103.14167 (2021)
+24. Katharopoulos, A., Vyas, A., Pappas, N., Fleuret, F.: Transformers are rnns: Fast autoregressive transformers with linear attention. In: International Conference on Machine Learning. pp. 5156-5165. PMLR (2020)
+25. Kim, S., Min, D., Ham, B., Jeon, S., Lin, S., Sohn, K.: Fcss: Fully convolutional self-similarity for dense semantic correspondence. In: CVPR (2017)
+26. Lee, J.Y., DeGol, J., Fragoso, V., Sinha, S.N.: Patchmatch-based neighborhood consensus for semantic correspondence. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)
+27. Lee, J., Kim, D., Ponce, J., Ham, B.: Sfnet: Learning object-aware semantic correspondence. In: CVPR (2019)
+28. Li, G., Jampani, V., Sevilla-Lara, L., Sun, D., Kim, J., Kim, J.: Adaptive prototype learning and allocation for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8334-8343 (2021)
+29. Li, S., Han, K., Costain, T.W., Howard-Jenkins, H., Prisacariu, V.: Correspondence networks with adaptive neighbourhood consensus. In: CVPR (2020)
+30. Li, X., Wei, T., Chen, Y.P., Tai, Y.W., Tang, C.K.: Fss-1000: A 1000-class dataset for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2020)
+31. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dólar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision (2014)
+32. Liu, W., Zhang, C., Ding, H., Hung, T.Y., Lin, G.: Few-shot segmentation with optimal transport matching and message flow. arXiv preprint arXiv:2108.08518 (2021)
+33. Liu, W., Zhang, C., Lin, G., Liu, F.: Crnet: Cross-reference networks for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2020)
+34. Liu, Y., Zhu, L., Yamada, M., Yang, Y.: Semantic correspondence as an optimal transport problem. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2020)
+35. Liu, Y., Zhang, X., Zhang, S., He, X.: Part-aware prototype network for few-shot semantic segmentation. In: European Conference on Computer Vision. pp. 142-158. Springer (2020)
+36. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030 (2021)
+
+37. Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition (2015)
+38. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 (2017)
+39. Lu, Z., He, S., Zhu, X., Zhang, L., Song, Y.Z., Xiang, T.: Simpler is better: Few-shot semantic segmentation with classifier weight transformer. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2021)
+40. Min, J., Kang, D., Cho, M.: Hypercorrelation squeeze for few-shot segmentation. arXiv preprint arXiv:2104.01538 (2021)
+41. Min, J., Kim, S., Cho, M.: Convolutional hough matching networks for robust and efficient visual correspondence. arXiv preprint arXiv:2109.05221 (2021)
+42. Min, J., Lee, J., Ponce, J., Cho, M.: Hyperpixel flow: Semantic correspondence with multi-layer neural features. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2019)
+43. Min, J., Lee, J., Ponce, J., Cho, M.: Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543 (2019)
+44. Min, J., Lee, J., Ponce, J., Cho, M.: Learning to compose hypercolumns for visual correspondence. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XV 16. Springer (2020)
+45. Nguyen, K., Todorovic, S.: Feature weighting and boosting for few-shot segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 622-631 (2019)
+46. Noh, H., Hong, S., Han, B.: Learning deconvolution network for semantic segmentation. In: Proceedings of the IEEE international conference on computer vision (2015)
+47. Philbin, J., Chum, O., Isard, M., Sivic, J., Zisserman, A.: Object retrieval with large vocabularies and fast spatial matching. In: CVPR. IEEE (2007)
+48. Ravi, S., Larochelle, H.: Optimization as a model for few-shot learning (2016)
+49. Rocco, I., Arandjelovic, R., Sivic, J.: Convolutional neural network architecture for geometric matching. In: CVPR (2017)
+50. Rocco, I., Arandjelović, R., Sivic, J.: End-to-end weakly-supervised semantic alignment. In: CVPR (2018)
+51. Rocco, I., Arandjelović, R., Sivic, J.: Efficient neighbourhood consensus networks via submanifold sparse convolutions. In: ECCV (2020)
+52. Rocco, I., Cimpoi, M., Arandjelović, R., Torii, A., Pajdla, T., Sivic, J.: Neighbourhood consensus networks. arXiv preprint arXiv:1810.10510 (2018)
+53. Scharstein, D., Szeliski, R.: A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision (2002)
+54. Shaban, A., Bansal, S., Liu, Z., Essa, I., Boots, B.: One-shot learning for semantic segmentation. arXiv preprint arXiv:1709.03410 (2017)
+55. Siam, M., Oreshkin, B., Jagersand, M.: Adaptive masked proxies for few-shot segmentation. arXiv preprint arXiv:1902.11123 (2019)
+56. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+57. Snell, J., Swersky, K., Zemel, R.S.: Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175 (2017)
+58. Sun, D., Yang, X., Liu, M.Y., Kautz, J.: Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In: CVPR (2018)
+59. Sun, G., Liu, Y., Liang, J., Van Gool, L.: Boosting few-shot semantic segmentation with transformers. arXiv preprint arXiv:2108.02266 (2021)
+
+60. Tao, A., Sapra, K., Catanzaro, B.: Hierarchical multi-scale attention for semantic segmentation. arXiv preprint arXiv:2005.10821 (2020)
+61. Tetko, I.V., Livingstone, D.J., Luik, A.I.: Neural network studies, 1. comparison of overfitting and overtraining. J. Chem. Inf. Comput. Sci. 35, 826-833 (1995)
+62. Tian, Z., Zhao, H., Shu, M., Yang, Z., Li, R., Jia, J.: Prior guided feature enrichment network for few-shot segmentation. IEEE Transactions on Pattern Analysis & Machine Intelligence (2020)
+63. Tolstikhin, I.O., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Steiner, A., Keysers, D., Uszkoreit, J., et al.: Mlp-mixer: An all-mlp architecture for vision. Advances in Neural Information Processing Systems 34 (2021)
+64. Truong, P., Danelljan, M., Timofte, R.: Glu-net: Global-local universal network for dense flow and correspondences. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 6258-6268 (2020)
+65. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems (2017)
+66. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. Advances in neural information processing systems (2016)
+67. Wang, H., Zhang, X., Hu, Y., Yang, Y., Cao, X., Zhen, X.: Few-shot semantic segmentation with democratic attention networks. In: European Conference on Computer Vision (2020)
+68. Wang, K., Liew, J.H., Zou, Y., Zhou, D., Feng, J.: Panet: Few-shot image semantic segmentation with prototype alignment. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2019)
+69. Wang, S., Li, B.Z., Khabsa, M., Fang, H., Ma, H.: Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768 (2020)
+70. Wu, C., Wu, F., Qi, T., Huang, Y., Xie, X.: Fastformer: Additive attention can be all you need. arXiv preprint arXiv:2108.09084 (2021)
+71. Wu, S., Wu, T., Lin, F., Tian, S., Guo, G.: Fully transformer networks for semantic image segmentation. arXiv preprint arXiv:2106.04108 (2021)
+72. Xiao, T., Singh, M., Mintun, E., Darrell, T., Dollár, P., Girshick, R.: Early convolutions help transformers see better. arXiv preprint arXiv:2106.14881 (2021)
+73. Xie, G.S., Liu, J., Xiong, H., Shao, L.: Scale-aware graph neural network for few-shot semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5475-5484 (2021)
+74. Xie, G.S., Xiong, H., Liu, J., Yao, Y., Shao, L.: Few-shot semantic segmentation with cyclic memory network. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2021)
+75. Xiong, Y., Zeng, Z., Chakraborty, R., Tan, M., Fung, G., Li, Y., Singh, V.: Nyströmformer: A nyström-based algorithm for approximating self-attention (2021)
+76. Yang, B., Liu, C., Li, B., Jiao, J., Ye, Q.: Prototype mixture models for few-shot semantic segmentation. In: European Conference on Computer Vision. Springer (2020)
+77. Yang, L., Zhuo, W., Qi, L., Shi, Y., Gao, Y.: Mining latent classes for few-shot segmentation. arXiv preprint arXiv:2103.15402 (2021)
+78. Zhang, B., Xiao, J., Qin, T.: Self-guided and cross-guided learning for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2021)
+
+79. Zhang, C., Lin, G., Liu, F., Guo, J., Wu, Q., Yao, R.: Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9587-9595 (2019)
+80. Zhang, C., Lin, G., Liu, F., Yao, R., Shen, C.: Canet: Class-agnostic segmentation networks with iterative refinement and attentive few-shot learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5217-5226 (2019)
+81. Zhang, G., Kang, G., Wei, Y., Yang, Y.: Few-shot segmentation via cycle-consistent transformer. arXiv preprint arXiv:2106.02320 (2021)
+82. Zhang, H., Ding, H.: Prototypical matching and open set rejection for zero-shot semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2021)
+83. Zhao, D., Song, Z., Ji, Z., Zhao, G., Ge, W., Yu, Y.: Multi-scale matching networks for semantic correspondence. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3354-3364 (2021)
\ No newline at end of file
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/images.zip b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..5a8890b1d42f8cf8fcbff08f94539ddf9c60ba93
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4faa980a324b36e6539a6ce33a6c32a4bacd264d432581d7efaa0d41f7db3723
+size 501536
diff --git a/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/layout.json b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a043e087c8fa8a704e03adedf2fab7e882143294
--- /dev/null
+++ b/costaggregationwith4dconvolutionalswintransformerforfewshotsegmentation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3203d41a99a12590728a66dbc63cf81e481205efc9447d95cf3f233028be2c38
+size 461918
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_content_list.json b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..27acc2a2c4e1028b855e89789fb3bb3618033b47
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cad1ecfe3092af1a9fcdf18a6c43c7f9517710e659b9aba767e5ea37cbef7363
+size 86660
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_model.json b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0dbdaf561ddef920ce163469781613e806c8a49e
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0a1c20035b75e46db441fe7f69e655143f56e8bbeae9af652d348baca3a2b307
+size 107762
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_origin.pdf b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9f6a8c79c623ec68b2c21fc04f37f0844eca82df
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/0f0a487b-0364-4076-8b0a-a119f111d580_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9fcf37d0a705c77f3392809cd3432863c5e379e5e05d065cac7f656087d89945
+size 9370653
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/full.md b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3af6c3fb5384f5225eea217950698dce0734a116
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/full.md
@@ -0,0 +1,350 @@
+# CostDCNet: Cost Volume based Depth Completion for a Single RGB-D Image
+
+Jaewon Kam, Jargon Kim, Soongjin Kim, Jaesik Park, and Seungyong Lee
+
+POSTECH
+{jwkam95, dungeonkim, kimsj0302, jaesik.park, leesy}@postech.ac.kr
+
+Abstract. Successful depth completion from a single RGB-D image requires both extracting plentiful 2D and 3D features and merging these heterogeneous features appropriately. We propose a novel depth completion framework, CostDCNet, based on the cost volume-based depth estimation approach that has been successfully employed for multi-view stereo (MVS). The key to high-quality depth map estimation in the approach is constructing an accurate cost volume. To produce a quality cost volume tailored to single-view depth completion, we present a simple but effective architecture that can fully exploit the 3D information, three options to make an RGB-D feature volume, and per-plane pixel shuffle for efficient volume upsampling. Our CostDCNet framework consists of lightweight deep neural networks ( $\sim$ 1.8M parameters), running in real time ( $\sim$ 30ms). Nevertheless, thanks to our simple but effective design, CostDCNet demonstrates depth completion results comparable to or better than the state-of-the-art methods.
+
+Keywords: Depth completion, cost volume, 3D convolution, single RGB-D image
+
+# 1 Introduction
+
+Recently, RGB-D cameras have been widely used in many applications that need 3D geometry information, such as augmented reality (AR), virtual reality (VR), autonomous driving, and robotics. However, various depth sensors, including LiDAR, Kinect, and RealSense, suffer from missing measurements. Depth completion is the task of filling missing areas in depth images obtained from sensors.
+
+Learning-based depth completion methods mainly employ 2D convolutions to extract RGB and depth feature maps from an input RGB-D image, regarding the depth image as a 2D image. Then, they fuse two heterogeneous 2D feature maps in the 2D feature space to infer a completed depth image [18, 2, 26, 31, 25, 33]. However, these 2D convolutions do not directly consider depth-axis information of 3D positions. To fully exploit the 3D geometry information, 3D convolutions could be an alternative, but naively applying standard 3D convolutions to input 3D points would be inappropriate due to their sparsity and irregularity.
+
+
+(a) Semi-dense DC
+
+
+
+
+(b) Sparse DC
+
+
+(c) Extremely sparse DC
+Fig. 1. Our results of depth completion for three different types of input depth. The top row visualizes the input RGB-D images and their colored point clouds, and the bottom row shows our completed depth images and their colored point clouds.
+
+Multi-view stereo (MVS) and stereo matching methods that use deep neural networks have taken a cost volume concept to infer depth by considering 3D spatial information [14, 13, 45, 37]. These methods have shown compelling depth estimation accuracy. In the methods, a cost volume is constructed in the multiple-depth-plane representation (Figure 3b), and is commonly regarded as containing matching costs between RGB images captured at different viewpoints. Inspired by MVS, some single-view depth completion methods using a cost volume have been proposed [22, 25]. They use 2D convolutional neural networks (CNNs) to directly predict the cost volume from a single RGB-D input. However, the predicted cost volume is produced only using cascaded 2D convolutions that cannot properly utilize 3D information from the input depth.
+
+In this paper, we propose a cost volume based depth completion network (CostDCNet) that can fully exploit 3D information by performing 3D convolutions of heterogeneous 2D and 3D features in the multiple-depth-plane representation. Our method is basically based on the cost volume-based depth estimation framework in the MVS domain. However, unlike aforementioned depth completion methods [22, 25] that use multiple depth planes to represent an inferred depth, our framework uses multiple depth planes as a representation for a volume to be convolved. This approach enables our framework to use 3D convolutions like existing MVS studies. To infer a cost volume, MVS methods need an input feature volume that is commonly constructed by aggregating 2D feature maps of RGB images at multiple viewpoints. Similarly, our framework also requires a feature volume to generate a cost volume. We present three viable options to construct the feature volume, called an RGB-D feature volume, from a single RGB-D image. We experimentally showed that a proper design choice of an RGB-D feature volume is vital to produce a quality cost volume, consequently resulting in the high-quality completed depth. Various methods, including MVS, that rely on 3D convolutions typically suffer from memory and computational
+
+complexity due to the volume data usage. To handle the problem, we adopt an approach to process low-resolution volumes and then to upsample them. For such volume upsampling, we use an adapted version of pixel shuffle [38], which we call per-plane pixel shuffle, that increases volume resolution by rearranging its feature values along spatial dimensions. The upsampling scheme performs only rearrangement operations, so it works in highly memory- and computation-efficient manner.
+
+Our CostDCNet framework consists of three parts: (1) construction of RGB-D feature volume from RGB-D image, (2) prediction of cost volume by a modified 3D UNet, (3) final completed depth regression. Due to our effective network design that can exploit 3D geometry and RGB information both fully and collectively, our CostDCNet, albeit using the small number of network parameters $(\sim 1.8\mathrm{M})$ , outperforms or is comparable to state-of-the-art (SOTA) methods on both semi-dense and sparse depth datasets. Our codes are publicly available1.
+
+To summarize, our key contributions are as follows:
+
+- We propose a single-view depth completion method that is based on but adapted from the cost volume-based depth estimation pipeline in the multiview stereo (MVS) field.
+- The proposed method can fully exploit heterogeneous 2D and 3D features of an input RGB-D image due to our scheme for producing RGB-D feature volume from a single RGB-D image, the multiple-depth-plane representation, and 3D convolution operation in the representation.
+- We propose the depth completion framework, CostDCNet, that is merely composed of lightweight CNNs ( $\sim$ 1.8M parameters) and our efficient volume upsampling module without any complex architecture.
+- Due to our highly effective and efficient network design, CostDCNet runs in real time ( $\sim 30\mathrm{ms}$ ) and achieves qualitative and quantitative results that are better than or comparable to SOTA methods in both semi-dense and sparse depth datasets.
+
+# 2 Related Work
+
+We review representative approaches that are closely related to the technical components in our framework.
+
+Depth completion We classify depth completion studies that use a single RGB-D image as input into two classes according to the sparsity of the input depth that they target: semi-dense depth completion and sparse depth completion. We firstly review studies on semi-dense depth completion.
+
+Zhang et al. [48] predicted surface normals and occlusion boundaries by using two 2D CNNs, then conducted global linear optimization to obtain completed depth. Using the surface normals and occlusion boundaries predicted by Zhang et al., Huang et al. [18] adopted a self-attention mechanism to conserve and
+
+sharpen structures in the inferred depth image. These methods train their models in a supervised manner by using rendered depth from 3D reconstructed scenes as ground truth (GT). However, the poor 3D reconstruction quality leads to inaccurate GT depth images. To avoid this problem, Cao et al. [2] introduced an adaptive sampling strategy for self-supervised training to simulate missing depths in the capturing process. They trained their model with self-supervision but showed comparable results to the supervised methods.
+
+Early sparse depth completion studies that use deep learning regarded a depth image as a 2D image and used 2D CNNs that took a typical encoder-decoder architecture with minor variations [31, 27]. A few advanced methods focused on effectively extracting and fusing multi-modal features from RGB-D image [49, 11, 41]. Several methods that use spatial propagation networks (SPN) [6, 5, 33] iteratively refine initial depth regression by using affinity kernels. These methods that use 2D CNNs show highly encouraging results, but they require a large number of network parameters and might rely on pretrained models from other tasks. Rather than regarding depth images as 2D images, some methods [4, 19] attempted to consider 3D geometry information explicitly, by consolidating 2D and 3D features. To extract 3D features from an input depth, they used point cloud convolutions [42, 1]. However, in their methods, 3D spatial information is not fully utilized because they applied 3D convolutions only to valid pixels in depth. In addition, the methods are not suitable for semi-dense or dense depth, because they search neighbors by using the $k$ -NN algorithm, which slows down as the number of input points increases.
+
+In this paper, our proposed method can process both semi-dense and sparse depth completion classes, and provides comparable or better results than SOTA methods in both classes. It can fully exploit 3D geometry and context information by aggregating 2D and 3D features in a volumetric manner.
+
+Cost volume based depth regression Multi-view depth estimation approaches, such as stereo matching and MVS, have been studied for inferring depth from two or multiple views. They usually build a cost volume, which contains the matching costs of all pixels computed for all possible disparities, to predict the depth. Various matching costs, such as sum of absolute difference (SAD), sum of squared difference (SSD), and normalized cross-correlation (NCC), have been used for building a cost volume. Matching costs have also been computed using deep neural networks [30, 46] due to the robustness. Recent methods [47, 37, 13, 14] aggregate the cost volume with a 3D CNN. However, since 3D convolution requires high amount of computation, it is not easy to operate in real time.
+
+Inspired by MVS works, some single-view depth completion methods attempted to borrow the cost volume concept to regress depth [22, 25]. However, they could not directly calculate cost volume, because no other view is available for matching. Therefore, they inferred the cost volume by using 2D CNNs without matching between multi-views. However, since their neural network still is based on only 2D convolutions, they cannot deal with 3D information appropriately and only generate cost maps rather than a cost volume in 3D space. In
+
+
+Fig.2. Overview of CostDCNet. Our framework consists of three components. (1) RGB-D feature volume construction, (2) Cost volume prediction, (3) Depth regression.
+
+contrast, we devise CostDCNet to effectively handle the 3D geometry information contained in the input depth using 3D convolution.
+
+# 3 Cost Volume based Depth Completion Network
+
+# 3.1 Overall Process and Network Design
+
+CostDCNet infers a completed depth from a single RGB-D frame by sequentially performing three steps (Figure 2): (1) RGB-D feature volume construction (Section 3.2), (2) Cost volume prediction and (3) Depth regression (Section 3.3). We outline these steps below.
+
+RGB-D feature volume construction To produce an RGB-D feature volume, first of all, we extract 2D and 3D feature maps from an input RGB-D image by using 2D and 3D encoders. Unlike the 2D encoder that directly uses an RGB-D image as input, the 3D encoder requires a depth image to be converted into a multiple-depth-plane representation (Figure 3c). We use 3D sparse convolution [8] to compute the 3D feature only for valid 3D points having non-zero depth. Both 2D and 3D encoders produce feature maps of the $p$ times-reduced width and height to avoid the high memory footprint and heavy computation amount of a 3D CNN. Finally, we consolidate the reduced 2D and 3D feature maps into a single 3D feature volume, which we call an RGB-D feature volume (Section 3.2).
+
+Cost volume prediction and depth regression We feed the produced RGB-D feature volume into our 3D CNN to obtain a cost volume. At this time, the 3D CNN has the architecture of a 3D UNet [9] and additionally adopts pseudo 3D convolutions [35] to relieve the computational overhead of standard 3D convolutions. Because the RGB-D feature volume has the width and height lower than the original image, the predicted cost volume also has a reduced resolution. To recover the reduced resolution to the original one, a naive option
+
+
+(a) View frustum
+
+
+(b) Cost volume
+Fig. 3. Multiple-depth-plane representation. (a) View frustum in 3D space. (b) and (C) show a cost volume of multi-view stereo and our RGB-D feature volume in the multiple-depth-plane representation, respectively.
+
+
+(c) RGB-D feature volume
+
+is to use 3D deconvolutions. However, feature volume upsampling by such 3D deconvolutions is computationally costly, so some multi-view depth estimation studies [20, 45, 37] commonly employ linear interpolation. We experimentally observed that the linear interpolation tends to cause blurry boundaries in the inferred depth image, as shown in Figure 7. Therefore, we instead opt for the shuffle scheme [38] to upsample the cost volume of reduced size.
+
+Our per-plane pixel shuffle rearranges features of the cost volume to increase its spatial resolution. For example, let the resolution of a target upsampled volume be $W \times H \times D$ , and the resolution of the reduced cost volume that the 3D UNet outputs be $\frac{W}{p} \times \frac{H}{p} \times D \times C$ . Then, by setting the feature dimension $C$ to $p^2$ and rearranging a $p^2$ -dimensional feature of a cell of the cost volume to width and height dimensions, we obtain an upsampled cost volume of the resolution $W \times H \times D \times 1$ . The method requires only feature vector rearrangement without heavy computation, and shows good visual quality while running fast (Section 4.3, Figure 7). Finally, we estimate the completed depth image by performing the soft-argmax based depth regression like [23] (Section 3.3).
+
+# 3.2 RGB-D Feature Volume
+
+An RGB-D feature volume is constructed by consolidating 2D and 3D features extracted from a single RGB-D frame, where the consolidation is performed in the multiple-depth-plane representation. In this section, we introduce the multiple-depth-plane representation, how to convert an input depth to the representation, and three different types of methods to merge 2D and 3D features in this representation.
+
+Depth to multiple depth planes A pixel position $\mathbf{u} = (x,y)$ in a depth image $D(\cdot)$ is related to a 3D position $\mathbf{x}\in \mathbb{R}^3$ within a view frustum of the image as $\mathbf{x} = D(\mathbf{u})\mathbb{K}^{-1}\tilde{\mathbf{u}}$ , where $\mathbb{K}$ is a $3\times 3$ matrix that includes depth camera intrinsic parameters, $\tilde{\mathbf{u}}$ is homogeneous coordinates $[\mathbf{u},1]^T$ of $\mathbf{u}$ , and $D(\mathbf{u})$ is the depth value at the pixel position $\mathbf{u}$ (Figure 3a). We can represent 3D position $\mathbf{x}$ as a 3D position in the multiple-depth-plane representation. Then, we quantize the
+
+3D positions in the representation into a voxel grid so that 3D convolutions can be performed (Figure 3c).
+
+To construct the voxel grid, we need to predefine only the number $K$ of uniformly-spaced depth planes $\{d_k\}_{k=1:K}$ because $x-$ and $y$ -axes resolution can be naturally determined to be the same as in the depth image. Maximum and minimum positions of the planes are determined by considering maximum and minimum depth values that a depth sensor can measure. The resolution of the voxel grid then becomes $W \times H \times K$ . The 3D position $\mathbf{x} = (x,y,D(x,y))$ of a depth image pixel in the representation is easily quantized to a cell $\mathbf{x}_c$ of the voxel grid as
+
+$$
+\mathbf {x} _ {c} = \left(x, y, k ^ {\prime}\right) \tag {1}
+$$
+
+$$
+k ^ {\prime} = \arg \min _ {k} | D (x, y) - d _ {k} |.
+$$
+
+By applying Eq. (1) to all valid pixels having non-zero depths, we obtain a set of valid cells $\{\mathbf{x}_c^n\}_{n = 1:N}$ in the voxel grid, where $N$ is the number of valid cells. Then, we construct an input geometry feature volume $f_{g}^{in}\in \mathbb{R}^{W\times H\times K\times M}$ on the voxel grid as
+
+$$
+f _ {g} ^ {i n} \left(\mathbf {x} ^ {\prime}\right) = \left\{ \begin{array}{l l} \mathbf {s} _ {n}, & \quad \mathbf {x} ^ {\prime} \in \left\{\mathbf {x} _ {c} ^ {n} \right\} _ {n = 1: N} \\ \vec {0}, & \quad \text {o t h e r w i s e} \end{array} , \right. \tag {2}
+$$
+
+where $\mathbf{x}'$ is a cell within $f_{g}^{in}$ . If $\mathbf{x}'$ corresponds to a valid depth pixel $\mathbf{x}_c^n$ , we store $\mathbf{s}_n$ in $\mathbf{x}'$ , where $\mathbf{s}_n$ is a $M$ -dimensional feature vector. Otherwise, a $M$ -dimensional zero vector is stored in $\mathbf{x}'$ . We set $M$ to one and $\mathbf{s}_n$ to $D(x,y) - d_{k'}$ , which is the residual of a depth pixel from the nearest predefined depth plane. Consequently, we can cover a view frustum using a regular voxel grid in the multiple-depth-plane representation, thereby enabling standard 3D convolution operations to be directly applied (Figure 3). Performing standard 3D convolutions on the voxel grid has the effect of adjusting spatial coverage of a 3D convolution kernel accordingly to the distance from a depth camera.
+
+Three types of RGB-D feature volume An RGB-D feature volume is a feature volume in the multiple-depth-plane representation, which is defined as element-wise concatenation of a geometric feature volume $f_{g}$ and an image feature volume $f_{I}$ . To obtain $f_{g}$ , we first convert a depth image to the input geometry feature volume, and then feed it to our 3D encoder (Figure 2). To obtain $f_{I}$ , we first extract a 2D feature map from the input RGB-D image using our 2D encoder. Then, the 2D feature map is placed into the multiple-depth-plane representation to form $f_{I}$ in three different ways (Types A, B, C), where the type of $f_{I}$ determines the type of the final RGB-D feature volume. Below is the description of the three different types.
+
+(i) Type A. Several studies for 3D reconstruction, multi-view stereo, and 3D semantic segmentation generate a feature volume by unprojecting multi-view image features into a 3D volume, then integrating them [10, 32, 40]. In these
+
+
+(a) Type A
+
+
+(b) Type B
+
+
+(c) Type C
+Fig. 4. Three designs of RGB-D feature volume. The RGB-D feature volumes are represented by multiple depth planes and are classified into three types according to the structure of the image feature volume.
+
+methods, all the volume cells that are intersected by a ray starting from the camera's center of projection through an image pixel accumulate the same feature of the pixel. Similarly, we generate an image feature volume $f_{I}^{A}$ to be filled with the same image features along the depth-axis as follows:
+
+$$
+f _ {I} ^ {A} (x, y, k ^ {\prime}) = I (x, y), \forall k ^ {\prime} \in \{k \} _ {k = 1: K}, \tag {3}
+$$
+
+where $I$ denotes a 2D image feature map calculated by feeding an input RGB-D image into a 2D encoder (Figure 2).
+
+(ii) Type B. Since a Type A feature volume allocates image features to its all cells regardless of whether the corresponding depth pixels are valid or not, it does not consider 3D positional information of image features explicitly. In contrast, Type B considers the valid depth values of pixels for image feature allocation. To be specific, for a pixel with a valid depth, we allocate its 2D image feature to only the corresponding 3D cell in the image feature volume $f_{I}^{B}$ . For pixels with invalid depths, we allocate their 2D image features to the corresponding cells in the middle depth plane of $f_{I}^{B}$ . Formally,
+
+$$
+f _ {I} ^ {B} (x, y, k) = \left\{ \begin{array}{l l} I (x, y), & (x, y, k) \in \mathbb {X} \cup \mathbb {X} ^ {\prime} \\ \vec {0}, & \text {o t h e r w i s e} \end{array} , \right. \tag {4}
+$$
+
+where $\mathbb{X}$ is the set of cells determined by Eq. (1) from the valid depth pixels. $\mathbb{X}'$ is the set of cells corresponding to pixels $(x,y)$ with invalid depths, where $k$ is set to $K/2$ , the center depth plane.
+
+(iii) Type C. A Type C feature volume is generated in the same manner as Type B except that the image feature of each pixel with invalid depth is repeatedly allocated to the cells of $f_{I}^{C}$ , traversing along the depth-axis.
+
+The three types of RGB-D feature volumes have the same geometric feature volume, but their image feature volumes are defined differently. We experiment
+
+tally demonstrated that using the Type C feature volume achieves the best performance (Section 4).
+
+# 3.3 Final Depth Regression and Training Loss
+
+Like the MVS works [23, 20], we can regress a completed depth map $D'(\cdot)$ by applying the softmax operator $\sigma(\cdot)$ to the upsampled cost volume $V_{c} \in \mathbb{R}^{W \times H \times K}$ along the depth-axis and using the following equation
+
+$$
+D ^ {\prime} (x, y) = \sum_ {k = 1} ^ {K} d _ {k} \times \mathbf {p} _ {x, y} ^ {k}, \quad \mathbf {p} _ {x, y} = \sigma \left(V _ {c} (x, y,:)\right), \tag {5}
+$$
+
+where $d_{k}$ is the predefined depth value of the $k$ -th plane, $(x,y)$ is an image pixel position, $K$ is the number of depth planes, $V_{c}(x,y,:)$ is a $K$ -dimensional vector along the depth-axis within the cost volume, and $\mathbf{p}_{x,y}$ is a probability vector obtained by the softmax operator $\sigma(\cdot)$ for $K$ depth planes at $(x,y)$ .
+
+We train our CostDCNet in an end-to-end manner by using only the L1 loss function as
+
+$$
+L = \sum_ {(x, y) \in \mathbb {G}} | D ^ {\prime} (x, y) - D _ {g t} (x, y) |, \tag {6}
+$$
+
+where $D_{gt}$ is the GT depth, $D'$ is an inferred depth by Eq. (5), and $\mathbb{G}$ is a set of valid pixels of $D_{gt}$ .
+
+# 4 Experiments
+
+# 4.1 Experimental Setup
+
+Datasets We evaluated semi-dense depth completion on Matterport3D [3] dataset and sparse depth completion on NYUv2 [39], Void [43], and KITTI DC [12] datasets.
+
+- Matterport3D is a large-scale indoor dataset, including 194,400 RGB-D images captured by a Matterport camera. With GT depth images provided by Zhang et al. [48], we used training ( $\sim$ 100K images) and test (474 images) sets as in [18]. We use images downsized into size of $320 \times 256$ for both training and testing.
+- NYUv2 includes RGB-D videos of 464 indoor scenes collected using a Kinect sensor. We randomly sample points to obtain input sparse depth images. We downscaled images into size of $320 \times 240$ and then center-cropped them to be size of $304 \times 228$ . We constructed the training set ( $\sim 48\mathrm{K}$ images) and the test set (654 images) as in previous studies [31].
+- Void provides $640 \times 480$ RGB-D images containing sequences of 56 indoor and outdoor scenes acquired from RealSense D435i camera. We used sparse depth images with about 1500 depth points as input. We train our model on the training set ( $\sim 47\mathrm{K}$ images) and test on the test set (800 images) by following the previous protocol of [43].
+
+Table 1. Quantitative comparisons with SOTA semi-dense depth completion methods on the Matterport3D dataset. The numbers are excerpted from each paper except for [26], of which the number was reported by [2].
+
+| Method | RMSE(m)↓ | MAE(m)↓ | SSIM↑ | δ1.05 ↑ | δ1.10 ↑ | δ1.25 ↑ | δ1.252 ↑ | δ1.253 ↑ |
| MRF [15] | 1.675 | 0.618 | 0.692 | 50.6 | 55.6 | 65.1 | 78.0 | 85.6 |
| AD [28] | 1.653 | 0.610 | 0.696 | 50.3 | 56.0 | 66.3 | 79.2 | 86.1 |
| Zhang et al. [48] | 1.316 | 0.461 | 0.762 | 65.7 | 70.8 | 78.1 | 85.1 | 88.8 |
| Cao et al. [2] | 1.187 | 0.385 | 0.736 | 66.5 | 72.5 | 79.9 | 87.1 | 91.1 |
| Huang et al. [18] | 1.092 | 0.342 | 0.799 | 66.1 | 75.0 | 85.0 | 91.1 | 93.6 |
| MSG-CHN [26] | 1.068 | 0.347 | 0.778 | 65.0 | 73.2 | 83.3 | 90.3 | 93.4 |
| Ours | 1.019 | 0.290 | 0.838 | 71.3 | 78.6 | 87.1 | 92.8 | 94.8 |
+
+
+Fig. 5. Qualitative comparisons with SOTA semi-dense depth completion methods on the Matterport3D dataset. The results of [48, 18] were borrowed from the paper [18] and results of [2] were taken from their project page.
+
+- KITTI DC is an outdoor scene dataset that provides paired RGB and sparse depth images obtained by projecting Velodyne LiDAR sensor measurements onto 2D space. It utilizes 11 consecutive frames to generate denser depth images as GT. For training, we center-cropped the images with size of 1216 $\times$ 240 to ignore the regions with no LiDAR measurements. We used $\sim$ 93K image pairs for training and 1K pairs for testing as in the previous works.
+
+Evaluation metrics We followed the standard metrics to evaluate the performance: root mean squared error (RMSE), mean absolute error (MAE), structural similarity index map (SSIM), relative mean absolute error (REL), and percentages $\delta_x$ of inlier pixels with the less than $x$ meters error.
+
+Implementation detail Our 3D encoder and 2D encoder are composed of 3 and 6 residual blocks [16], respectively. We used the simplified 3D UNet [9] to extract cost volumes. For the detailed network architecture, refer to the supplementary material. We used $K = 16$ depth planes and $p^2 = 16$ feature dimension of a cost volume. The maximum depth $d_{max}$ is set to $5\mathrm{m}$ , $10\mathrm{m}$ , $15\mathrm{m}$ , and $90\mathrm{m}$ for Void, NYUv2, Matterport3D and KITTI DC datasets, respectively. We used the ADAM optimizer [24] with an initial learning rate of $0.5\times 10^{-3}$ , then divided it in half every 20 epochs for network training. We set the batch size to 16 and the training epoch to 50, and trained neural networks using a single NVIDIA RTX 3090 GPU.
+
+Table 2. Quantitative comparisons with SOTA sparse depth completion methods on the NYUv2 dataset. The numbers are excerpted from respective papers.
+
+| Method | #points | #params↓ | RMSE(m)↓ | REL(m)↓ | δ1.25↑ | δ1.252↑ | δ1.253↑ |
| DCoeff [22] | | 45.7M | 0.118 | 0.013 | 99.4 | 99.9 | - |
| CSPN [7] | | 18.5M | 0.117 | 0.016 | 99.2 | 99.9 | 100 |
| CSPN++ [5] | | 28.8M | 0.116 | - | - | - | - |
| DeepLiDAR [34] | | 53.4M | 0.115 | 0.022 | 99.3 | 99.9 | 100 |
| PRNet [25] | | 14.3M | 0.104 | 0.014 | 99.4 | 99.9 | 100 |
| GuideNet [41] | 500 | 63.3M | 0.101 | 0.015 | 99.5 | 99.9 | 100 |
| TWISE [21] | | 5.8M | 0.097 | 0.013 | 99.6 | 99.9 | 100 |
| NLSPN [33] | | 25.8M | 0.092 | 0.012 | 99.6 | 99.9 | 100 |
| Point-Fusion [19] | | 8.7M | 0.090 | 0.014 | 99.6 | 99.9 | 100 |
| Ours | | 1.8M | 0.096 | 0.013 | 99.5 | 99.9 | 100 |
| Point-Fusion [19] | 32 | 8.7M | 0.319 | 0.057 | 96.3 | 99.2 | 99.8 |
| Ours | | 1.8M | 0.258 | 0.048 | 96.4 | 99.1 | 99.7 |
+
+
+
+
+
+
+(a) RGB
+
+
+
+
+
+
+(b) Sparse depth
+
+
+
+
+
+
+(c)CSPN [7]
+
+
+
+
+
+
+(d) NLSPN [33]
+Fig. 6. Qualitative results on NYUv2 dataset. The results of other methods [7, 33] are obtained from the authors' project page.
+
+
+
+
+
+
+(e) Ours
+
+
+
+
+
+
+(f) GT
+
+# 4.2 Comparisons with SOTA
+
+Semi-dense depth completion We compared our method with previous semi-dense depth completion methods on the Matterport3D dataset. Table 1 shows quantitative comparisons with SOTA methods. Our network outperformed all other methods significantly in all metrics by a large margin. Especially, Hwang et al. [18], which is the previous SOTA method, additionally require the normal and boundary maps predicted by Zhang et al. [48] and their network size (19.8M) is 11 times larger than ours. MSG-CHN [26] is the backbone network used by Cao et al. [2], trained by supervised learning. It has slightly better RMSE compared to [18], but our method outperforms it across all metrics. In qualitative comparisons with other methods (Figure 5), our method better expresses details and has clearer boundaries.
+
+Sparse depth completion We conducted experiments on the NYUv2 dataset to compare our framework with SOTA methods for the sparse depth completion task. Table 2 shows the quantitative results on a few standard metrics. When using 500 depth points as the input, our approach achieved the second and third
+
+Table 3. Quantitative comparisons with SOTA sparse depth completion methods on Void test set and KITTI DC validation set.
+
+| Dataset | Method | Train | #Param↓ | Runtime↓ | MAE↓ | RMSE↓ | iMAE↓ | iRMSE↓ |
| VOID | KBNet [44] | U | 6.9M | 13ms | 39.80 | 95.86 | 21.16 | 49.72 |
| Ours | U | 1.8M | 30ms | 27.19 | 79.19 | 13.02 | 35.17 |
| PENet [17] | S | 132M | 226ms | 34.6 | 82.01 | 18.89 | 40.36 |
| NLSPN [33] | S | 25.8M | 122ms | 26.7 | 79.12 | 12.70 | 33.88 |
| Ours | S | 1.8M | 30ms | 25.84 | 76.28 | 12.19 | 32.13 |
| KITTI DC | KBNet [44] | U | 6.9M | 16ms | 260.44 | 1126.85 | 1.03 | 3.20 |
| Ours | U | 1.8M | 34ms | 242.64 | 868.62 | 0.99 | 2.39 |
+
+best performance on REL and RMSE metrics, respectively. However, our Cost-DCNet uses merely $20\%$ of network parameters of Point-Fusion [19] and $7\%$ of NLSPN [33], respectively. We also notice that our method obtained higher accuracy, compared to PRNet [25] and DCoeff [22] that utilize multiple depth planes as representation for an inferred depth map and perform only 2D convolutions. These results show that our framework exploits 3D information much better than PRNet and DCoeff. In addition, even for extremely sparse input depths (32 points), our method achieves SOTA performance in both Rel and RMSE metrics.
+
+We also compared our method with SOTA unsupervised (KBNet) and supervised (NLSPN [33], PENet [17]) methods on VOID (test set) and KITTI DC (validation set) datasets. Most of unsupervised depth completion methods, including KBNet, do not use GT depths and train networks with additional photometric loss using adjacent views. For fast experiments, we did not use the photometric loss and simply trained our networks with the original input as GT and random samples from the original input as input data. We used L1 + L2 losses for KITTI DC datasets. Table 3 shows experimental results. The numbers of other methods are borrowed from the previous paper [29]. Our method outperforms SOTA unsupervised and supervised methods across all metrics, even running in real time ( $\sim$ 30FPS). While KBNet uses 3D position vectors to leverage 3D information, it is still based on 2D CNN. Therefore, its computational costs are lower than ours, but its inductive bias in 3D space could be weaker than 3D CNNs.
+
+Collectively considering the overall performance, the total number of network parameters, robustness in extreme cases, we believe that our framework could be the best option.
+
+# 4.3 Ablation Study
+
+In this section, we analyze the role of each component of our framework. For the analysis, we conducted sparse depth completion on the NYUv2 dataset. To speed up the experiments, we set the resolution of input RGB-D image to $\frac{1}{4}$ size of the original before adding the encoders and trained each model up to 20 epochs.
+
+Table 4. Ablation study for each component of our network. The results were evaluated on the NYUv2 dataset.
+
+| Method | Network | RGB-D Vol. | Encoder | Upsample | RMSE(m)↓ | #param↓ | | | |
| 2D | 3D | P3D | fIA | A | B | C | 2D | 3D | BL | BG | PS | |
| (a) | ✓ | | | | | | | | ✓ | | 0.195 | | 17.3M |
| (b) | ✓ | | | | ✓ | | | | ✓ | | 0.121 | | 1.0M |
| (c) | ✓ | | | | ✓ | | | | ✓ | | 0.123 | | 0.5M |
| (d) | ✓ | | | ✓ | | | | | ✓ | | 0.186 | | 0.5M |
| (e) | ✓ | | | | ✓ | | | | ✓ | | 0.131 | | 0.5M |
| (f) | ✓ | | | | ✓ | | | | ✓ | | 0.122 | | 0.5M |
| (g) | ✓ | | | | ✓ | | ✓ | | ✓ | | 0.108 | | 1.5M |
| (h) | ✓ | | | | ✓ | | ✓ | ✓ | ✓ | | 0.106 | | 1.8M |
| (i) | ✓ | | | | ✓ | | ✓ | ✓ | ✓ | | 0.102 | | 3.1M |
| (j) | ✓ | | | | ✓ | | ✓ | ✓ | ✓ | | 0.099 | | 1.8M |
+
+
+(a)
+
+
+(b)
+Fig. 7. Different upsampling methods. (a) Bilinear upsampling, (b) Bilateral grid learning [45], (c) Per-plane pixel shuffle, and (d) Ground truth.
+
+
+(c)
+
+
+(d)
+
+Network To verify the effect of inferring depth in 3D space, we compare our 3D UNet [9] with 2D UNet [36]. The 2D UNet takes a concatenated RGB-D image as input, and 3D UNet takes as input the RGB-D feature volume. When 2D UNet was replaced with our tiny 3D Unet, even though it has only $2.5\%$ of network parameters of 2D UNet, the accuracy was significantly improved by $\sim 62\%$ (Table 4a&b). The result implies that considering 3D information with the RGB-D feature volume as an appropriate representation is helpful for inferring high-quality cost volume. We also replaced the 3D convolution of 3D UNet with a pseudo-3D convolution (P3D) [35] to reduce the computational cost. P3D showed similar accuracy to 3D convolution while reducing the number of network parameters by half (Table 4b&c). Therefore, P3D was used in our 3D UNet.
+
+Effectiveness of explicit positional conditioning To construct a RGB-D feature volume, a geometric feature volume $f_{g}$ is element-wisely concatenated with an image feature volume $f_{I}$ . We verify that exploiting such explicit positional cues from input depths in RGB-D feature volume construction results in performance improvement. To this end, we compared the results of using only the image feature volume $f_{I}^{A}$ (without $f_{g}$ ) (Table 4d) and Type A (with $f_{g}$ ) (Table 4c). $f_{I}^{A}$ leads to a poorer accuracy than Type A because it does not use 3D geometry information at all. It suggests that it is necessary to assign geometry features to the proper positions in 3D space for accurate depth completion.
+
+Three designs of RGB-D feature volume We also quantified the effect of the design of RGB-D feature volume. Type A (Table 4c) and Type C (Table 4f) had higher accuracy than Type B (Table 4e). We argue 3D information can be inferred better by assigning 2D features of unknown depth values to all possible depth planes rather than to a specific depth plane. In addition, Type C had slightly higher accuracy than Type A. This result means that ambiguity can be reduced by assigning 2D features of valid depths to the correct depth positions.
+
+2D and 3D encoders We evaluated the effectiveness of the 2D and 3D encoders (Table 4g&h). Compared to a model without encoders (Table 4f), the accuracy was significantly improved when our 2D and 3D encoders are added. These results indicate that the 2D and 3D encoders can enrich the information of our RGB-D feature volumes.
+
+Upsampling We quantified the effect of upsampling layers, using bilinear (BL, Table 4h), bilateral grid learning (BG, Table 4i) [45], and per-plane pixel shuffle (PS, Table 4j) upsampling. BG and PS achieved better accuracy than BL. However, BG requires an additional network, which increases the number of parameters, whereas PS rearranges the volume, which is simple and fast. In qualitative results (Figure 7), BL generally blurred the boundary, BG gave clean boundaries, but caused artifacts that break the structure, whereas PS gives clear boundaries and restores the overall structure well. These results indicate PS can reliably up-scale cost volume to the original resolution at low computational cost.
+
+# 5 Conclusion
+
+In this paper, we proposed a single-view depth completion framework, CostDC-Net, that can fully exploit 3D information by performing 3D convolutions of heterogeneous 2D and 3D features in the multiple-depth-plane representation. We introduced three designs of RGB-D feature volume to represent a single RGB-D image into 3D space. Furthermore, we employed the per-plane pixel shuffle to up-sample the low-resolution cost volume on which 3D convolutions are performed efficiently. We demonstrated that our system is lightweight ( $\sim$ 1.8M parameters), runs in real time ( $\sim$ 30ms), and achieves qualitatively and quantitatively SOTA or comparable performance in depth completion for semi-dense depths, sparse depths (500 points), and even extremely sparse depths (32 points).
+
+Limitation and future work Although our framework showed impressive results in indoor sparse and semi-dense depth completion, we have a few limitations. Our framework has a fixed number of depth planes, so in outdoor scenes such as the KITTI DC dataset, the distance between the planes becomes wider, and expressive power decreases. To tackle this problem, we plan to closely consolidate the sparse convolution and coarse-to-fine approach with our CostDCNet.
+
+Acknowledgements This work was supported by the Ministry of Science and ICT, Korea, through IITP grants (SW Star Lab, 2015-0-00174; AI Innovation Hub, 2021-0-02068; Artificial Intelligence Graduate School Program (POSTECH), 2019-0-01906).
+
+# References
+
+1. Boulch, A., Puy, G., Marlet, R.: Fkaconv: Feature-kernel alignment for point cloud convolution. In: Proceedings of Asian Conference on Computer Vision (ACCV) (2020) 4
+2. Cao, Z., Li, A., Yuan, Z.: Self-supervised depth completion via adaptive sampling and relative consistency. In: Proceedings of IEEE International Conference on Image Processing (ICIP). pp. 3263-3267 (2021) 1, 4, 10, 11
+3. Chang, A., Dai, A., Funkhouser, T., Halber, M., Niessner, M., Savva, M., Song, S., Zeng, A., Zhang, Y.: Matterport3D: Learning from RGB-D data in indoor environments. arXiv preprint arXiv:1709.06158 (2017) 9
+4. Chen, Y., Yang, B., Liang, M., Urtasun, R.: Learning joint 2D-3D representations for depth completion. In: Proceedings of IEEE International Conference on Computer Vision (ICCV). pp. 10023-10032 (2019) 4
+5. Cheng, X., Wang, P., Guan, C., Yang, R.: Cspn++: Learning context and resource aware convolutional spatial propagation networks for depth completion. In: Proceedings of AAAI Conference on Artificial Intelligence. vol. 34, pp. 10615-10622 (2020) 4, 11
+6. Cheng, X., Wang, P., Yang, R.: Depth estimation via affinity learned with convolutional spatial propagation network. In: Proceedings of European Conference on Computer Vision (ECCV). pp. 103-119 (2018) 4
+7. Cheng, X., Wang, P., Yang, R.: Learning depth with convolutional spatial propagation network. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) 42(10), 2361-2379 (2019) 11
+8. Choy, C., Gwak, J., Savarese, S.: 4d spatio-temporal convnets: Minkowski convolutional neural networks. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 3075-3084 (2019) 5
+9. Çiçek, Ö., Abdulkadir, A., Lienkamp, S.S., Brox, T., Ronneberger, O.: 3D u-net: learning dense volumetric segmentation from sparse annotation. In: Proceedings of International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI). pp. 424-432. Springer (2016) 5, 10, 13
+10. Dai, A., Nießner, M.: 3dmv: Joint 3D-multi-view prediction for 3D semantic scene segmentation. In: Proceedings of European Conference on Computer Vision (ECCV). pp. 452-468 (2018) 7
+1. Fu, C., Dong, C., Mertz, C., Dolan, J.M.: Depth completion via inductive fusion of planar lidar and monocular camera. In: Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). pp. 10843-10848 (2020) 4
+2. Geiger, A., Lenz, P., Urtasun, R.: Are we ready for autonomous driving? the kitti vision benchmark suite. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 3354-3361 (2012) 9
+3. Gu, X., Fan, Z., Zhu, S., Dai, Z., Tan, F., Tan, P.: Cascade cost volume for high-resolution multi-view stereo and stereo matching. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 2495-2504 (2020) 2, 4
+4. Guo, X., Yang, K., Yang, W., Wang, X., Li, H.: Group-wise correlation stereo network. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 3273-3282 (2019) 2, 4
+5. Harrison, A., Newman, P.: Image and sparse laser fusion for dense scene reconstruction. In: Proceedings of Field and Service Robotics (FSR). pp. 219-228. Springer (2010) 10
+
+16. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 770-778 (2016) 10
+17. Hu, M., Wang, S., Li, B., Ning, S., Fan, L., Gong, X.: Penet: Towards precise and efficient image guided depth completion. In: Proceedings of IEEE International Conference on Robotics and Automation (ICRA). pp. 13656-13662 (2021) 12
+18. Huang, Y.K., Wu, T.H., Liu, Y.C., Hsu, W.H.: Indoor depth completion with boundary consistency and self-attention. In: Proceedings of IEEE International Conference on Computer Vision Workshops (ICCVW). pp. 0–0 (2019) 1, 3, 9, 10, 11
+19. Huynh, L., Nguyen, P., Matas, J., Rahtu, E., Heikkilä, J.: Boosting monocular depth estimation with lightweight 3D point fusion. In: Proceedings of IEEE International Conference on Computer Vision (ICCV). pp. 12767-12776 (2021) 4, 11, 12
+20. Im, S., Jeon, H.G., Lin, S., Kweon, I.S.: Dpsnet: End-to-end deep plane sweep stereo. arXiv preprint arXiv:1905.00538 (2019) 6, 9
+21. Imran, S., Liu, X., Morris, D.: Depth completion with twin surface extrapolation at occlusion boundaries. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 2583-2592 (2021) 11
+22. Imran, S., Long, Y., Liu, X., Morris, D.: Depth coefficients for depth completion. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 12438-12447 (2019) 2, 4, 11, 12
+23. Kendall, A., Martirosyan, H., Dasgupta, S., Henry, P., Kennedy, R., Bachrach, A., Bry, A.: End-to-end learning of geometry and context for deep stereo regression. In: Proceedings of IEEE International Conference on Computer Vision (ICCV). pp. 66-75 (2017) 6, 9
+24. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014) 10
+25. Lee, B.U., Lee, K., Kweon, I.S.: Depth completion using plane-residual representation. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 13916-13925 (2021) 1, 2, 4, 11, 12
+26. Li, A., Yuan, Z., Ling, Y., Chi, W., Zhang, C., et al.: A multi-scale guided cascade hourglass network for depth completion. In: Proceedings of IEEE Winter Conference on Applications of Computer Vision (WACV). pp. 32-40 (2020) 1, 10, 11
+27. Liao, Y., Huang, L., Wang, Y., Kodagoda, S., Yu, Y., Liu, Y.: Parse geometry from a line: Monocular depth estimation with partial laser observation. In: Proceedings of IEEE International Conference on Robotics and Automation (ICRA). pp. 5059-5066 (2017) 4
+28. Liu, J., Gong, X.: Guided depth enhancement via anisotropic diffusion. In: Proceedings of Pacific-Rim conference on multimedia (PCM). pp. 408-417. Springer (2013) 10
+29. Liu, T.Y., Agrawal, P., Chen, A., Hong, B.W., Wong, A.: Monitored distillation for positive congruent depth completion. arXiv preprint arXiv:2203.16034 (2022) 12
+30. Luo, W., Schwing, A.G., Urtasun, R.: Efficient deep learning for stereo matching. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 5695-5703 (2016) 4
+31. Ma, F., Karaman, S.: Sparse-to-dense: Depth prediction from sparse depth samples and a single image. In: Proceedings of IEEE International Conference on Robotics and Automation (ICRA). pp. 4796-4803 (2018) 1, 4, 9
+
+32. Murez, Z., As, T.v., Bartolozzi, J., Sinha, A., Badrinarayanan, V., Rabinovich, A.: Atlas: End-to-end 3D scene reconstruction from posed images. In: Proceedings of European Conference on Computer Vision (ECCV). pp. 414-431. Springer (2020) 7
+33. Park, J., Joo, K., Hu, Z., Liu, C.K., So Kweon, I.: Non-local spatial propagation network for depth completion. In: Proceedings of European Conference on Computer Vision (ECCV). pp. 120-136. Springer (2020) 1, 4, 11, 12
+34. Qiu, J., Cui, Z., Zhang, Y., Zhang, X., Liu, S., Zeng, B., Pollefeys, M.: Deep surface normal guided depth prediction for outdoor scene from sparse lidar data and single color image. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 3313-3322 (2019) 11
+35. Qiu, Z., Yao, T., Mei, T.: Learning spatio-temporal representation with pseudo-3D residual networks. In: Proceedings of IEEE International Conference on Computer Vision (ICCV). pp. 5533-5541 (2017) 5, 13
+36. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: Proceedings of International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI). pp. 234-241. Springer (2015) 13
+37. Shen, Z., Dai, Y., Rao, Z.: Cfnet: Cascade and fused cost volume for robust stereo matching. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 13906-13915 (2021) 2, 4, 6
+38. Shi, W., Caballero, J., Huszar, F., Totz, J., Aitken, A.P., Bishop, R., Rueckert, D., Wang, Z.: Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 1874-1883 (2016) 3, 6
+39. Silberman, N., Hoiem, D., Kohli, P., Fergus, R.: Indoor segmentation and support inference from RGBD images. In: Proceedings of European Conference on Computer Vision (ECCV). pp. 746-760. Springer (2012) 9
+40. Sun, J., Xie, Y., Chen, L., Zhou, X., Bao, H.: Neuralrecon: Real-time coherent 3D reconstruction from monocular video. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 15598-15607 (2021) 7
+41. Tang, J., Tian, F.P., Feng, W., Li, J., Tan, P.: Learning guided convolutional network for depth completion. IEEE Transactions on Image Processing (TIP) 30, 1116-1129 (2020) 4, 11
+42. Wang, S., Suo, S., Ma, W.C., Pokrovsky, A., Urtasun, R.: Deep parametric continuous convolutional neural networks. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 2589-2597 (2018) 4
+43. Wong, A., Fei, X., Tsuei, S., Soatto, S.: Unsupervised depth completion from visual inertial odometry. IEEE Robotics and Automation Letters (RA-L) 5(2), 1899-1906 (2020) 9
+44. Wong, A., Soatto, S.: Unsupervised depth completion with calibrated backprojection layers. In: Proceedings of IEEE International Conference on Computer Vision (ICCV). pp. 12747-12756 (2021) 12
+45. Xu, B., Xu, Y., Yang, X., Jia, W., Guo, Y.: Bilateral grid learning for stereo matching networks. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 12497-12506 (2021) 2, 6, 13, 14
+46. Zbontar, J., LeCun, Y.: Computing the stereo matching cost with a convolutional neural network. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 1592-1599 (2015) 4
+
+47. Zhang, F., Prisacariu, V., Yang, R., Torr, P.H.: Ga-net: Guided aggregation net for end-to-end stereo matching. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 185-194 (2019) 4
+48. Zhang, Y., Funkhouser, T.: Deep depth completion of a single RGB-D image. In: Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR). pp. 175-185 (2018) 3, 9, 10, 11
+49. Zhong, Y., Wu, C.Y., You, S., Neumann, U.: Deep RGB-D canonical correlation analysis for sparse depth completion. Advances in Neural Information Processing Systems (NeurIPS) 32 (2019) 4
\ No newline at end of file
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/images.zip b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ed4dc49f0d2f9bd7c1abd7602788b47724fa7654
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:92aa3e0198f2b790c8a2dbb26db1d1193955d302cc0cefccd1d5c48d897ccb68
+size 576491
diff --git a/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/layout.json b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..da25f6468f77dfcad44b4f8766051e95d725ad28
--- /dev/null
+++ b/costdcnetcostvolumebaseddepthcompletionforasinglergbdimage/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09855fc862a8c80d21440496e174cf8458535655ab2d7506756e44c5b4587885
+size 480363
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_content_list.json b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c2e2e51e5b4f054ec16c47d675a141a2291bf305
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7ec64b9cd53f6a3740a1af792eb75568e30f63130e83b5a178643aa3356ed468
+size 83913
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_model.json b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2eeccf4a2d92e4e245cd18ba2af1f1316876686c
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dc536079d3ce5416c53955b5b5b30e7c2f43570616a0087765cc37933700768d
+size 102365
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_origin.pdf b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a873721930a403d858fe32148e75c6b530d2b900
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/746d0efa-9fcf-4e3d-b43c-1dfcd2d98c43_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08cf6ce08f6d74fe986d8100388108ce4799488b9197cd62ed7e60c6d68a863f
+size 734002
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/full.md b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b12f68fb5aece168d915706b7e134bc13d33de91
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/full.md
@@ -0,0 +1,278 @@
+# Counterfactual Intervention Feature Transfer for Visible-Infrared Person Re-identification
+
+Xulin $\mathrm{Li}^{1,2*}$ , Yan $\mathrm{Lu}^{1,2*}$ , Bin $\mathrm{Liu}^{1,2\boxtimes}$ , Yating $\mathrm{Liu}^3$ , Guojun $\mathrm{Yin}^{1,2}$ , Qi $\mathrm{Chu}^{1,2}$ , Jinyang $\mathrm{Huang}^{1,2}$ , Feng $\mathrm{Zhu}^4$ , Rui $\mathrm{Zhao}^{4,5}$ , and Nenghai $\mathrm{Yu}^{1,2}$
+
+1 School of Information Science and Technology, University of Science and Technology of China
+
+$^{2}$ Key Laboratory of Electromagnetic Space Information, Chinese Academy of Science
+
+$^{3}$ School of Data Science, University of Science and Technology of China $^{4}$ SenseTime Research
+
+$^{5}$ Qing Yuan Research Institute, Shanghai Jiao Tong University {lxlkw, luyan17}@mail.ustc.edu.cn, flowice@ustc.edu.cn {liuyat, gjyin}@mail.ustc.edu.cn, qchu@ustc.edu.cn huangjy@mail.ustc.edu.cn, {zhufeng, zhaorui}@sensetime.com ynh@ustc.edu.cn
+
+Abstract. Graph-based models have achieved great success in person re-identification tasks recently, which compute the graph topology structure (affinities) among different people first and then pass the information across them to achieve stronger features. But we find existing graph-based methods in the visible-infrared person re-identification task (VI-ReID) suffer from bad generalization because of two issues: 1) train-test modality balance gap, which is a property of VI-ReID task. The number of two modalities data are balanced in the training stage but extremely unbalanced in inference, causing the low generalization of graph-based VI-ReID methods. 2) sub-optimal topology structure caused by the end-to-end learning manner to the graph module. We analyze that the joint learning of backbone features and graph features weaken the learning of graph topology, making it not generalized enough during the inference process. In this paper, we propose a Counterfactual Intervention Feature Transfer (CIFT) method to tackle these problems. Specifically, a Homogeneous and Heterogeneous Feature Transfer $(\mathrm{H}^2\mathrm{FT})$ is designed to reduce the train-test modality balance gap by two independent types of well-designed graph modules and an unbalanced scenario simulation. Besides, a Counterfactual Relation Intervention (CRI) is proposed to utilize the counterfactual intervention and causal effect tools to highlight the role of topology structure in the whole training process, which makes the graph topology structure more reliable. Extensive experiments on standard VI-ReID benchmarks demonstrate that CIFT outperforms the state-of-the-art methods under various settings.
+
+Keywords: Person Re-identification, Counterfactual, Cross-modality
+
+
+Fig. 1. The red background hints at the existing methods and the green one means our method. (a) Existing graph-based methods trained on modality-balanced data are difficult to transfer to a modality unbalanced scenario. Our method overcomes this problem by unbalanced scenarios simulation and a novel graph module design. (b) Existing training strategies learn the backbone features and the graph outputs jointly, making affinity learning be weakened. Our method uses a counterfactual intervention tool to calculate the pure effect contributed by the affinity changes only, making the model perceive the role of graph topology more direly.
+
+
+
+# 1 Introduction
+
+Standard person re-identification (ReID) [5, 15, 25, 26, 43] aims to match pedestrian images of the same identity captured by different cameras, which is essentially a single-modality (RGB) retrieval task. However, open-world intelligent monitoring requires methods to retrieve targets captured by infrared or thermal cameras in the dark scenario. Therefore, the research on visible-infrared person re-identification (VI-ReID) has attracted great attention in recent years. Different from standard ReID, large cross-modality discrepancy and intra-modality variations bring new challenges to research on VI-ReID. Most researchers [7, 11, 37, 38, 41, 42, 49] aimed to embed images of two modalities into the same feature space to tackle this task, which preliminarily solved the modality gap.
+
+Graph-based methods have achieved excellent performance on standard person ReID [2,14,23,24]. Generally, they predict the pair-wise similarity as relationships between different samples and then utilize those relationships to propagate messages across samples. This kind of methods can bring a large range of performance gain because the features of one sample not only have the discriminative information of this sample itself but also carry information from other relative samples. So several methods [13,39] attempt to employ graph-based modules to establish relationships and enhance features in the VI-ReID task. But we argue that different from the graph module on the standard Re-ID, the graph methods on VI-ReID suffer bad generalization.
+
+We delve into the graph models pipeline in VI-ReID and summarize two main reasons for the bad generalization: Train-test modality balance gap and
+
+Sub-optimal topology structure. The train-test modality balance gap is a property of VI-ReID task, which means that the number of two modalities data are balanced in the training stage but extremely unbalanced in inference, like Fig. 1 (a) shows. More details about this property will be further introduced in Section 3. The sub-optimal structure is another problem but usually ignored by previous methods. It is caused by the end-to-end learning manner of the graph model. We summarize that the existing joint learning process of both the backbone and the graph module would weaken the learning of the graph topology structure, like Fig. 1 (b) shows. They both lead to low generalization of the graph structure predicted by the graph module in inference.
+
+To tackle the aforementioned problems respectively, we propose a Counterfactual Intervention Feature Transfer (CIFT) including one new graph module called Homogeneous and Heterogeneous Feature Transfer $(\mathrm{H}^2\mathrm{FT})$ with one additional learning methods Counterfactual Relation Intervention (CRI). The $\mathrm{H}^2\mathrm{FT}$ aims to reduce the train-test modality balance gap in two ways, training algorithm and model designing. We reorganize the balanced training data to simulate unbalanced modality distributed scenarios and let the $\mathrm{H}^2\mathrm{FT}$ trained on that environment, which guides the model to adapt to the situation with unbalanced modality distribution. Also, we find that it is hard for the standard graph module to train efficiently on that unbalanced data because the standard message-passing process cannot adapt to the extremely unbalanced modality information. So, we carefully construct the module of the $\mathrm{H}^2\mathrm{FT}$ which includes two different types of graph modules, to reduce the useless information introduced by the standard graph module and treat the message passing in unbalanced data better, as Fig. 1 (a) shows. Except that, the CRI tackles the sub-optimal graph topology problem by highlighting the role of graph structure (predicted affinity) in the total end-to-end training. We utilize the tools of causal inference to implement that motivation. We first represent our graph module in the Structural Causal Model [19, 20] in Fig. 1 (b) and modify the training targets of the graph module from only maximizing the probability likelihood to maximizing the combination of both probability likelihood and the total indirect effect (TIE). The former term guides the whole model to classify the identity of each person image. And the latter one is essentially equal to maximize the difference between the original output and a counterfactual output contributed by the affinity changes only (Fig. 1 (b) green background), which can make the model perceive the function of the graph affinity.
+
+The main contributions of our work are summarized as follows:
+
+- We delve into the existing VI-ReID graph model and find two main reasons for their low generalization: train-test modality balance gap and sub-optimal structure. And we design a novel and effective Counterfactual Intervention Feature Transfer (CIFT) to tackle these problems and achieve the new state of the art.
+- We introduce a Homogeneous and Heterogeneous Feature Transfer $(\mathrm{H}^2\mathrm{FT})$ module including two independent types of well-designed graph module and an unbalanced scenario simulation, which is more suitable for tackling the sample interaction in the scenario with unbalanced modality distribution.
+
+- We propose a novel Counterfactual Relation Intervention (CRI) algorithm to tackle the sub-optimal topology structure problem. It utilizes the counterfactual intervention and causal effect tools to highlight the role of the topology in the feature transfer module, which can train the total module more generalized.
+
+# 2 Related Work
+
+Visible-Infrared Person Re-ID. Traditional single-modality person Re-ID [15, 26, 43] is limited by the poor illumination conditions at night, so the VI-ReID has received extensive attention in recent years. Many VI-ReID approaches have been proposed to overcome the modality discrepancy produced by different cameras. Wu et al. [36] proposed a deep zero-padding network and contribute the first large-scale multiple modality Re-ID dataset named SYSU-MM01.
+
+Many works [7, 10, 11, 37, 38, 41, 42, 49] designed loss functions from the perspective of metric learning to better embed different modalities into the same feature space. Zhu et al. [49] proposed the hetero-center loss to reduce the intraclass cross-modality variations. Liu et al. [11] proposed the hetero-center triplet loss to relax the strict constraint of traditional triplet loss.
+
+Some methods [4, 31, 32, 34] are based on the generative adversarial network (GAN) [6]. cmGAN [4] adopted generative adversarial training to better distinguish images of different modalities at the feature level. $\mathrm{D}^2\mathrm{RL}$ [34] applied dual-level discrepancy reduction learning based on a bi-directional cycle GAN. Recently, Wu et al. [37] introduced a modality alleviation module and a pattern alignment module to discover cross-modality nuances. Hao et al. [7] confused two modalities, ensuring that the optimization is explicitly concentrated on the modality-irrelevant perspective. All these methods treat the VI-ReID as an image embedding task and learn to extract features directly from the single image.
+
+Graph-based Person Re-ID. In the single-modality person Re-ID task, except for the image embedding method, some works [2, 14, 24, 23] pay attention to the relationship between sample pairs. These methods introduced more supervised information of graph relationships into the training stage, while the inference stage also benefits from pair-wise similarity. Besides, some re-ranking [47] and graph neural networks (GNN) [44] methods only treated relational modeling as post-processing to more flexibly adapt to various backbone networks.
+
+In VI-ReID, the large cross-modality discrepancy makes the optimization of the relationship more difficult. Recently, some approaches have explored cross-modality pair-wise relation learning with graph networks. Ye et al. [39] introduced cross-modality graph-structured attention to enhance robustness against noisy samples. Lu et al. [13] proposed the cross-modality shared-specific feature transfer algorithm that utilizes the graph convolution operator to propagate features over a graph to supplement the information of another modality. These methods utilized the graph network or transformer module to propagate message cross samples to extract stronger features. But they are all suffering from the train-test modality balance gap and sub-optimal topology problems, which limits their applications. In this paper, we propose a novel graph method CIFT
+
+to tackle these two problems by both model design and learning algorithm, achieving satisfying generalization on VI-ReID.
+
+Causal Inference in Computer Vision. The causal inference has recently aroused widespread interest, especially in the combination with computer vision [1, 12, 21, 33] to endow models with the ability to pursue the causal effect. Some works [3, 17, 22, 27, 28, 45] utilized counterfactual to solve problems in various fields of computer vision. Tang et al. [27, 28] used counterfactual inference in scene graph generation and long-tailed classification to remove bias from training data with long-tailed distributions. Rao et al. [22] used counterfactual training in fine-grained image recognition to tackle the bias of the spatial attention caused by the dataset. Niu et al. [17] reduce the language bias in visual question answering by subtracting the direct language effect from the total causal effect.
+
+Different from them, we focus on highlighting the affinity of the feature transfer module to address the sub-optimal topology structure due to the graph-based Re-ID model itself, rather than reducing the impact caused by biased data.
+
+# 3 Delving into Graph-based Visible-Infrared ReID
+
+In this section, we investigate the influence of graph-based modules in the VI-ReID task. Specifically, we first give a brief review of graph-based VI-ReID methods. Then, we investigate why they suffered by bad generalization. Here, we take cm-SSFT [13] and DDAG [39] as examples for analysis.
+
+# 3.1 Review of Graph-based VI-ReID Models
+
+The definition of VI-ReID is essentially a cross-modality retrieval task. So its formula can be written as follow: $\mathcal{R} = \mathcal{M}(q,G)$ , where $\mathcal{M}$ is the Re-ID model, used to feedback the ranking list $\mathcal{R}$ between the given query sample $q$ and the gallery set $G$ whose modality is different with the query one. To achieve this pipeline, cm-SSFT [13] and DDAG [39] can be summarized as following:
+
+Step 1: Modality-invariant feature extraction. Give an image $x_{m}$ whatever its modality $m$ ( $m \in \{rgb,ir\}$ ), utilizing CNNs or other backbones to extract features $x$ for each sample.
+
+Step 2: Feature enhancement. Build affinities $A$ between all samples in $\{q, G\}$ on their given features $X$ , where $A_{i,j}$ means the relationship between the $i$ -th and the $j$ -th images. After that, messages can be passed and transferred across different samples, leading to stronger features. It can be written as
+
+$$
+F = A \cdot v (X), \tag {1}
+$$
+
+where $v$ is a linear learnable function and $F$ stores the output features. This process is essentially equal to constructing a graph whose nodes are person features and edges are affinities and then propagating information based on that graph.
+
+Step 3: Computing results. After getting enhanced features, different kinds of outputs, e. g. person identities or ranking lists, can be derived.
+
+Step 4: Feature learning. In the training stage, feature learning algorithms are added on both the backbone features $X$ and graph features $F$ . The classification output $Y$ is derived by $F$ through a classification layer and a cross-entropy loss is used to train it, which makes features carrying identity information.
+
+The most priority of these graph-based modules is passing messages across samples, which mines the potential relationships between different person images. So, they can benefit both training [13, 39] and inference [39]. But we find that they are all suffering from bad generalization in VI-ReID.
+
+# 3.2 Analysis of Bad Generalization of Graph-based VI-ReID
+
+We summarize that the bad generalization of graph-based VI-ReID is caused by two following problems:
+
+Train-Test modality balance gap. The train-test modality balance gap is caused by the difference of modality information ratio in the training and test stage. Specifically, in the training stage, both cm-SSFT [13] and DDAG [39] pass messages and transfer features on the batch data which includes an equal number of visible and infrared images. So the ratio of two modality information provided in training is $1:1$ . But in inference, the available data is $\{q,G\}$ consisting of one query sample $q$ and a gallery set $G$ . Here, the modality information ratio between two modalities is $1:N_{G}$ , where $N_{G}$ is the size of the gallery set. It is clear that the modality information ratio of training and testing is quite different. This is the property of VI-ReID because VI-ReID utilizes the single query evaluation setting which means there is only one query sample available in the inference scenario. It is hard for the model trained on the balanced training data to generalize on the unbalanced inference scenario. The cm-SSFT [13] also provides a series of experiments that demonstrate the unbalanced inference scenario can actually harm the generalization, which brings about $13.9\%$ Rank-1 and $9.1\%$ mAP drops corresponding to a balanced inference one.
+
+Sub-optimal topology structure. The affinities $A$ computed by cm-SSFT [13] and DDAG [39] can indicate the relationships between different samples. So the $A$ can be interpreted as a kind of graph topology structure on the given data. But we argue that the structure learned by the existing graph VI-ReID modules are all sub-optimal because of the end-to-end joint learning.
+
+Both cm-SSFT [13] and DDAG [39] add supervisions on backbone features and graph features simultaneously without any constraint on the affinities $A$ , which hurts the generalization. It is common for the graph modules, like transformer [29] or Graph Attention [30], to train the $A$ in an end-to-end joint manner. But the situation is different here, the supervision on the backbone makes the backbone features $X$ discriminative in the training set. At this time, an $A$ with standard quality can make the final output belong to the feature learning constraints1, so the structure $A$ cannot get much useful guidance. Without further supervision of $A$ , it is hard for the graph module to capture the complex relationships between different samples.
+
+
+Fig. 2. The Framework of the proposed Counterfactual Intervention Feature Transfer (CIFT). The Homogeneous and Heterogeneous Feature Transfer $(\mathrm{H}^2\mathrm{FT})$ module receives features from the backbone feature extractor and simulates unbalanced modality distributed scenarios. It builds homogeneous and heterogeneous message passing for better relationship feature learning under the unbalanced modality distribution. Then, the Counterfactual Relation Intervention (CRI) module calculates total indirect effects to highlight the role of the graph topology and leads to stronger results.
+
+The above analyses reveal that the key to increasing the generalization of graph-based VI-ReID is reducing the modality balance gap between train-test and introducing additional constraints on $A$ in the end-to-end joint learning. Along this direction, we proposed a Counterfactual Intervention Feature Transfer module and show how this model is used to tackle these problems.
+
+# 4 Counterfactual Intervention Feature Transfer
+
+The overview of our proposed Counterfactual Intervention Feature Transfer (CIFT) is shown in Fig. 2. Visible images and infrared images are first fed into a pedestrian feature extractor to extract the instance-level features. Then these features are sent to the graph module Homogeneous and Heterogeneous Feature Transfer $(\mathrm{H}^2\mathrm{FT})$ to extract transferred features ( $\S 4.2$ ). Meanwhile, the Counterfactual Relation Intervention (CRI) is introduced to improve graph structure learning ( $\S 4.3$ ). The optimization and loss function details are shown in ( $\S 4.4$ ).
+
+# 4.1 Pedestrian representation backbone
+
+As shown in Fig. 2, our pedestrian representation backbone network is a weight sharing network for both modality data, which embeds the person images from different modalities to a same feature space. To make sure the representation ability of those features, a loss function $\mathcal{L}_{ce}^{b}$ including a classification loss and a cross-modality metric learning loss $\mathcal{L}_{me}^{b}$ is utilized to optimize the networks. Based on that, each person's image can have an initial representation.
+
+# 4.2 Homogeneous and Heterogeneous Feature Transfer
+
+For a given batch data including $N$ Visible and $N$ infrared images, we aim to simulate the unbalanced modality distributed scenario to train our model. The batch data is split into a series of groups and each group consists of a single image from one modality (seen as the query $q$ ) and $N$ other modality images (seen as the gallery set $G$ ). Specifically, each group can have one visible image with $N$ infrared images or one infrared image with $N$ visible images. Every group simulates the scenario with $1: N$ modality ratio which is similar in the inference setting (one query vs more galleries). So, our $\mathrm{H}^2\mathrm{FT}$ trained under that can adapt on the single query inference without much influence on generalization.
+
+But, under that setting, the modality information is quite imbalanced. The sample seen as the query can only interact with $N$ images from other modality. And for the data seen as gallery, inter-modality interaction is trivial because it just introduces the information provided by the fixed query one, which is redundant even noisy. To avoid this problem, we provide a heterogeneous and a homogeneous graph module for the query data and gallery data separately like Fig. 2 shows. Its equation can be written as:
+
+$$
+f _ {q} = A _ {h e t} \cdot \left[ v \left(x _ {q}\right), v \left(X _ {G}\right) \right], F _ {G} = A _ {h o m} \cdot v \left(X _ {G}\right), \tag {2}
+$$
+
+where $x_{q}$ and $X_{G}$ mean the query feature vector and the gallery features matrix respectively. $[\bullet, \bullet]$ means concatenation in the column dimension. The function $v(\cdot)$ , a BNNeck [15] with learnable weights, is used to enhanced the features. $f_{q}$ and $F_{G}$ mean the transferred features of the query and the gallery set. $A$ means affinity matrix indicating the relationships between its corresponding samples. To achieve $A$ , we first compute the similarity matrix based on the input features:
+
+$$
+\mathcal {S} _ {t y} ^ {i, j} = \exp \frac {\cos (v (x _ {i}) , v (x _ {j}))}{\tau_ {t y}}, \quad t y \in \{h o m, h e t \}. \tag {3}
+$$
+
+$\cos(\cdot, \cdot)$ is the cosine distance function to measure the similarity between samples. $\tau$ is the temperature parameter to adjust the smoothness of the total similarity distribution. We use different $\tau$ for the heterogeneous and homogeneous process because the intra-modality and inter-modality similarities are quite different. To filter out the noisy relationships, we use near neighbor chosen function $\mathcal{T}(\bullet, k)$ [13] to keep the top- $k$ values in each row of similarity matrix: $\mathbf{S}' = \mathcal{T}(\mathbf{S}, k)$ . Finally, our affinity matrices are computed as follows:
+
+$$
+A _ {h o m} = \mathbf {D} _ {h o m} ^ {- 1} \cdot \mathbf {S} _ {h o m} ^ {\prime}, A _ {h e t} = \mathbf {D} _ {h e t} ^ {- 1} \cdot \mathbf {S} _ {h e t} ^ {\prime}. \tag {4}
+$$
+
+$\mathbf{D}^{-1}$ is the Laplacian matrix of the $\mathbf{S}'$ , used to normalize the total affinities.
+
+Finally, after achieving the final transferred features $F$ , a classification layer derives the logits $Y$ and the cross-entropy loss $\mathcal{L}_{ce}^{g}$ is utilized to train $Y$ which is equal to maximizing likelihood to keep the features carrying richer identity information. Then metric learning term $\mathcal{L}_{me}^{g}$ is added to the output to make features carry more discriminative information.
+
+Along that pipeline, the unbalanced scenario simulation makes the model adapt to the single query inference scenario. And the two kinds of message passing processes, heterogeneous and homogeneous, guide the query sample to interact with potential galleries while the gallery data only propagate messages across themselves, which preserves the nontrivial information interaction process in each group data, which is more suitable for tackling this unbalanced situation.
+
+# 4.3 Counterfactual Relation Intervention
+
+To add additional supervision of the affinities $A$ and keep the whole end-to-end training pipeline, we present to highlight the role of the graph topology structure in the total learning process. For this goal, we bring the tools of causal inference here. We first represent our $\mathrm{H}^2\mathrm{FT}$ into a Structural Causal Model (SCM) [19, 20], like Fig. 1 (b) shows. $X \to A$ means the affinity computation and $X \to Y \gets A$ is the message passing process (including the output computation).
+
+It is obvious the process that deriving the output $Y$ from input $X$ can be seen as two types of effects: One is the direct effect $X \rightarrow Y$ and the other is an indirect one $X \rightarrow A \rightarrow Y$ . The classification loss for our $\mathrm{H}^2\mathrm{FT}$ , equal to maximizing the likelihood, would affect the two effects in an end-to-end manner so the $A$ in the indirect effect path cannot be enhanced sufficiently.
+
+To highlight the $A$ in the whole training process, we utilize the Total Indirect Effect (TIE) here. We first give its equation:
+
+$$
+Y _ {T I E} = Y _ {X, A _ {X}} - \mathbb {E} _ {X ^ {*}} \left[ Y _ {X, A _ {X ^ {*}}} \right]. \tag {5}
+$$
+
+$Y_{X,A_X}$ is the original output of our graph module, which means feeding forward the different sample features $X$ and computing their outputs. Note that the affinity matrix here is denoted as $A_{X}$ which means that affinities are computed based on the input features $X$ . $Y_{X,A_{X^{*}}}$ means computing the results by replacing original affinity $A_{X}$ to a intervened one $A_{X^{*}}$ , where $X^{*}$ is the intervened inputs given manually. It is obvious that $Y_{X,A_{X^{*}}}$ cannot occur in the real world because features $X$ and affinities $A_{X^{*}}$ come from different inputs $X$ and $X^{*}$ , which is called counterfactual intervention. So modification from $Y_{X,A_X}$ to $Y_{X,A_{X^{*}}}$ is equal to keep all potential variables fixed but only change the affinity $A$ , which can show the pure effect introduced by $A$ . We compute the expectation of that effect to get the more stable one. Intervened input features $X^{*}$ utilized to compute $A_{X^{*}}$ are sampled by a Gaussian distribution:
+
+$$
+X ^ {*} = X _ {\sigma} \cdot Z + X _ {\mu}, \tag {6}
+$$
+
+where $Z$ is the standard random vector whose dimension is same with features $X$ . mean $X_{\mu}$ and stand deviation $X_{\sigma}$ are learned by the re-parameterization trick [9] in an end-to-end way.
+
+A cross-entropy loss is added to the TIE: $\mathcal{L}_{tie} = \mathcal{L}_{ce}(Y_{TIE})$ . Minimizing that cross-entropy loss is equal to maximizing the $Y_{TIE}$ on the prediction of the correct class, which guides the model to increase the gap between the original output
+
+and the counterfactual one. It is clear that the counterfactual classification results should be worse than the original one because the intervened affinities $A_{X^{*}}$ commonly do not match with inputs $X$ . So an intuitive understanding about maximizing TIE is constraining the model to increase the difference between the outputs derived from good $A_{X}$ and bad $A_{X^{*}}$ . Since other variables have been fixed, the model has to change the $A_{X}$ to increase the original results $Y_{X,A_X}$ for enhancing the gaps, leading to better training of affinity.
+
+# 4.4 Optimization
+
+The whole model is trained end-to-end and the total loss $\mathcal{L}_{total}$ of our method is defined as:
+
+$$
+\mathcal {L} _ {\text {t o t a l}} = \underbrace {\mathcal {L} _ {c e} ^ {b} + \mathcal {L} _ {m e} ^ {b}} _ {\text {b a c k b o n e t e r m}} + \underbrace {\mathcal {L} _ {c e} ^ {g} + \mathcal {L} _ {m e} ^ {g}} _ {\text {g r a p h t e r m}} + \underbrace {\mathcal {L} _ {\text {t i e}}} _ {\text {C R I t e r m}}. \tag {7}
+$$
+
+# 5 Experiments
+
+# 5.1 Datasets and Evaluation Protocol
+
+In this section, we conduct comprehensive experiments to evaluate our method on two public datasets, SYSU-MM01 [36] and RegDB [16].
+
+SYSU-MM01 is the first large-scale benchmark dataset for Visible-Infrared ReID. It is collected by four visible and two infrared cameras, in both indoor and outdoor environments. The training set contains 395 identities with 22,258 visible and 11,909 infrared images while the test set contains 96 identities. Concretely, the query set contains 3,803 infrared images and the gallery set contains 301/3010 (single-shot/multi-shot) randomly selected visible images.
+
+RegDB is collected by a dual-camera system (a pair of aligned visible and thermal cameras). It contains 412 people, and each person has 10 visible and 10 far-infrared images. The dataset is divided into training and test splits randomly, the images of 206 identities for training and the rest 206 identities for testing.
+
+Evaluation Protocol. All the experiments follow the standard evaluation protocol in existing Visible-Infrared cross-modality ReID benchmarks. For SYSUMM01, the original evaluation protocol [36] provides all-search and indoor-search modes for testing. Both search modes have two retrieval settings, single-shot and multi-shot. For RegDB, we follow the widely used evaluation protocol in [16] which contains two modes for testing, Visible to Infrared test mode and Infrared to Visible test mode. We evaluate our model on the 10 trials with different training/test splits to achieve stable performance. For both datasets, the cumulative matching characteristics (CMC) and mean average precision (mAP) are adopted as evaluation metrics.
+
+Table 1. Comparison of rank-1 accuracy (\%) and mAP accuracy(\%) with the state-of-the-art methods on SYSU-MM01 and RegDB. (CIFT $\dagger$ means we use backbone features for inference rather than the transferred graph features.)
+
+| Method | SYSU-MM01 [36] | RegDB [16] |
| All-search | Indoor-search | Visible to Infrared | Infrared to Visible |
| Single-shot | Multi-shot | Single-shot | Multi-shot |
| rank-1 | mAP | rank-1 | mAP | rank-1 | mAP | rank-1 | mAP | rank-1 | mAP | rank-1 | mAP |
| Zero-Pad [36] | 14.80 | 15.95 | 19.13 | 10.89 | 20.58 | 26.92 | 24.43 | 18.64 | - | - | - | - |
| cmGAN [4] | 26.97 | 27.80 | 31.49 | 22.27 | 31.63 | 42.19 | 37.00 | 32.76 | - | - | - | - |
| D²RL [34] | 28.9 | 29.2 | - | - | - | - | - | - | 43.4 | 44.1 | - | - |
| JSIA-ReID [31] | 38.1 | 36.9 | 45.1 | 29.5 | 43.8 | 52.9 | 52.7 | 42.7 | 48.5 | 49.3 | 48.1 | 48.9 |
| AlignGAN [32] | 42.4 | 40.7 | 51.5 | 33.9 | 45.9 | 54.3 | 57.1 | 45.3 | 57.9 | 53.6 | 56.3 | 53.4 |
| AGW [40] | 47.5 | 47.65 | - | - | 54.17 | 62.97 | - | - | 70.05 | 66.37 | - | - |
| cm-SSFT [13] | 61.6 | 63.2 | 63.4 | 62.0 | 70.5 | 72.6 | 73.0 | 72.4 | 72.3 | 72.0 | 71.0 | 71.7 |
| cm-SSFT(sq) | 47.7 | 54.1 | - | - | 57.4 | 59.1 | - | - | 65.4 | 65.6 | 63.8 | 64.2 |
| DDAG [39] | 54.75 | 53.02 | - | - | 61.02 | 67.98 | - | - | 69.34 | 63.46 | 68.06 | 61.80 |
| HC [49] | 56.96 | 54.95 | 62.09 | 48.02 | 59.74 | 64.91 | 69.76 | 57.81 | - | - | - | - |
| CIMA [46] | 57.2 | 59.3 | 60.7 | 52.6 | 66.6 | 74.7 | 73.8 | 68.3 | 78.8 | 69.4 | 77.9 | 69.4 |
| HCT [11] | 61.68 | 57.51 | - | - | 63.41 | 68.17 | - | - | 91.05 | 83.28 | 89.30 | 81.46 |
| MCLNet [7] | 65.4 | 61.98 | - | - | 72.56 | 76.58 | - | - | 80.31 | 73.07 | 75.93 | 69.49 |
| SMCL [35] | 67.39 | 61.78 | 72.15 | 54.93 | 68.84 | 75.56 | 79.57 | 66.57 | 83.93 | 79.83 | 83.05 | 78.57 |
| MPANet [37] | 70.58 | 68.24 | 75.58 | 62.91 | 76.74 | 80.95 | 84.22 | 75.11 | 83.7 | 80.9 | 82.8 | 80.7 |
| CIFT†(Ours) | 71.77 | 67.64 | 78.00 | 62.46 | 78.65 | 82.11 | 86.97 | 77.03 | 92.17 | 86.96 | 90.12 | 84.81 |
| CIFT(Ours) | 74.08 | 74.79 | 79.74 | 75.56 | 81.82 | 85.61 | 88.32 | 86.42 | 91.96 | 92.00 | 90.30 | 90.78 |
+
+# 5.2 Implementation Details
+
+We implement our approach with PyTorch [18] on one NVIDIA Titan Xp GPU. Following the previous ReID methods [15, 40], we use ResNet-50 [8] pre-trained on ImageNet as our backbone network. We change the stride of the last convolutional layer in the backbone to 1 and employ the Batch Normalization Neck [15] as the embedding layer. Each person image is resized to commonly used $288 \times 144$ resolution. We also adopt the random cropping, random horizontal flipping and random erasing [48] for data augmentation. The $k$ in the near neighbor chosen function is set to 4. $\tau_{hom}$ and $\tau_{het}$ in Eq. 3 are set to 0.4 and 0.2 for the heterogeneous and homogeneous process. The whole model is trained for 120 epochs with the SGD optimizer. The learning rate gradually rises up by the warm-up scheme and decays by a factor of 10 at the 60th and 100th epochs. The batch size is set to 64, containing 32 visible and 32 infrared images from 8 identities. And each identity consists of 4 visible and 4 infrared images.
+
+# 5.3 Comparison with State-of-the-art Methods
+
+In this part, we compare our proposed method CIFT with state-of-the-art (SOTA) visible-infrared person Re-ID approaches, including Zero-Pad [36], cmGAN [4], $\mathrm{D}^2\mathrm{RL}$ [34], JSIA-ReID [31], AlignGAN [32], AGW [40], cm-SSFT [13], DDAG [39], HC [49], CIMA [46], HCT [11], MCLNet [7], SMCL [35] and MPANet [37].
+
+Comparison and Analysis. The experimental results are shown in Table 1 and the proposed method outperforms the existing SOTAs on both datasets. In SYSU-MM01 dataset, our CIFT achieves $74.08\%$ rank-1 accuracy and $74.79\%$ mAP accuracy, which surpasses MPANet [37] by $3.50\%$ on rank-1 accuracy and $6.55\%$ on mAP accuracy in the most challenging single-shot all search mode. Even our $\mathrm{CIFT}^\dagger$ (only uses graph module in training and utilizes the backbone features in inference) outperforms MPANet by $1.19\%$ on rank-1 accuracy. In another popular public RegDB dataset, whether in 'infrared to visible' mode or 'visible to infrared' mode, our $\mathrm{CIFT}^\dagger$ still achieves the highest scores. The average performances in the two modes are $91.15\%$ rank-1 accuracy and $85.89\%$ mAP accuracy, which surpasses MPANet by a large gain of about $7.90\%$ on rank-1 accuracy and $5.09\%$ on mAP accuracy. This is because the learning of transferred features introduces additional supervision to the model, so that the features of the backbone network are also enhanced.
+
+For the multi-shot setting, the mAP accuracy of all other methods will drop significantly compared with the single-shot evaluation because the model is required to retrieve more positive targets in the multi-shot setting. So it is more challenging for the model to find out all potential targets. But our CIFT is not suffering that bad phenomenon even can achieve better results, which shows that our method is qualitatively different from other methods. When the scale gallery size is larger, our model can extract richer and more discriminate relation features so that the model is more robust to gallery size even benefited by the larger scale one. Compared with cm-SSFT [13] which also obtain relationship from the gallery set, our CIFT improves the mAP accuracy by $0.77\%$ as the gallery size increases (multi-shot versus single-shot), while the cm-SSFT reduces the mAP accuracy by $1.2\%$ . This is because we utilize CRI to highlight the role of topology structure in the whole training process. The affinities are much more accurate so that the final representation is much stronger.
+
+# 5.4 Comparison with Multi-gallery Matching Methods
+
+To demonstrate the superiority of our CIFT to other graph and post-process VI-ReID methods, we compare it with other multi-gALLERY matching methods, including cm-SSFT [13], k-reciprocal rerank [47], and GNN rerank [44]. We evaluate these methods with our CIFT on different backbone networks including AGW [40], HC [49], HCT [11], and our backbone network, to show the generality of our method under different level baselines. For a fair comparison, we also search the best hyper-parameters for these multi-gALLERY matching methods, so that they can fit the backbones well. Please note that, to adapt these backbone features format, cm-SSFT is set as only using the shared feature transfer.
+
+Our results are shown in the 5th line in Table 2 and 1st~3rd lines represent different widely used post-processing ways, combining different multi-gallery matching methods with the trained backbone features directly in inference. Comparing with the strongest post-process GNN rerank [44], we achieve averaged $5.12\%$ rank-1 and $4.03\%$ mAP gains on all given backbones. Further, we also compare the single query cm-SSFT (the 4th row) who does additional feature
+
+Table 2. Compared with other methods that use gallery set information in the inference stage on same backbone networks, i.e. AGW [40], HC [49], HCT [11] and our backbone. We report the rank-1 accuracy $(\%)$ and the mAP accuracy $(\%)$ on the SYSUMM01 single-shot all search mode. 'train' and 'test' in 'strategy' means the training methods and test methods separately
+
+| Row | backbone Strategy | AGW [40] rank-1 | mAP | HC [49] rank-1 | mAP | HCT [11] rank-1 | mAP | Our backbone rank-1 | mAP |
| 1 | backbone | 47.22 | 47.78 | 54.52 | 54.06 | 61.05 | 56.97 | 70.49 | 66.58 |
| 2 | k-reciprocal [47] | 47.63 | 51.81 | 53.91 | 60.03 | 62.33 | 62.05 | 71.47 | 72.49 |
| 3 | GNN rerank [44] | 46.96 | 52.01 | 55.05 | 59.79 | 60.52 | 62.72 | 70.40 | 73.21 |
| 4 | cm-SSFT [13] | 48.65 | 51.76 | 56.17 | 61.36 | 62.27 | 61.85 | 69.92 | 71.77 |
| 5 | CIFT | 52.12 | 56.92 | 61.03 | 64.05 | 66.18 | 68.09 | 74.08 | 74.79 |
+
+Table 3. Ablation study on SYSU-MM01. The important modules of the proposed CIFT, i.e. $\mathrm{H}^2\mathrm{FT}$ and CRI are analyzed under different settings.
+
+| Row | GFT | UBS | H2G | CRI | SYSU-MM01 |
| rank-1 | mAP |
| 1 | - | - | - | - | 70.49 | 66.58 |
| 2 | ✓ | - | - | - | 72.01 | 72.12 |
| 3 | ✓ | ✓ | - | - | 72.90 | 71.97 |
| 4 | ✓ | ✓ | ✓ | - | 72.29 | 73.79 |
| 5 | ✓ | ✓ | ✓ | ✓ | 74.08 | 74.79 |
+
+Table 4. Affinity quality statistics on the SYSU-MM01 test set. The value (\%) represents the average error ratio of the affinity matrix in the entire test set.
+
+| Method | All-search | Indoor-search |
| Single-shot | Multi-shot | Single-shot | Multi-shot |
| w/o CRI | 5.16 | 3.95 | 6.54 | 6.15 |
| w/ CRI | 3.90 | 2.76 | 5.03 | 4.66 |
+
+transfer learning corresponding to the aforementioned post-process methods. It only achieves comparable results with GNN rerank in the 3rd line and does not show much more priority of its graph learning. That is because cm-SSFT trains in the case of balanced modality but transferred to modal unbalanced inference scenario, which hurts its generalization. So, with the ability to tackle the inference under unbalanced modality distribution, it is common for CIFT to suppress the cm-SSFT by a large margin. The results in Table 2 show that our method achieves the best performance on all backbone networks, bringing average improvements of $5.03\%$ on rank-1 accuracy and $9.50\%$ on mAP accuracy. This proves that our method is compatible with various backbone networks and can achieve effective improvement.
+
+# 5.5 Ablation Study
+
+In this section, we conduct ablation studies to prove the effectiveness of each module of the proposed CIFT, i.e. $\mathrm{H}^2\mathrm{FT}$ and CRI. All ablation experiments are performed on our baseline backbone in the single-shot all search mode of the large-scale dataset SYSU-MM01. The results are shown in Table 3.
+
+Effectiveness of $\mathbf{H}^2\mathbf{FT}$ . In the proposed CIFT, we introduce a graph-based feature transfer module $\mathrm{H}^2\mathrm{FT}$ to tackle the train-test modality balance gap. To evaluate the effectiveness of each detailed part in $\mathrm{H}^2\mathrm{FT}$ , We split the $\mathrm{H}^2\mathrm{FT}$ into three parts: Graph Feature Transfer (GFT), UnBalanced Scenario simulation (UBS) and Homogeneous&Heterogeneous Graph module $(\mathrm{H}^2\mathrm{G})$ . GFT is a simple graph module baseline proposed by ourselves, which is used to show the gain introduced by the message passing in the graph module itself. Its details can be seen in the supplementary and we try ourselves to keep other variables not changing. Its performance in the 2nd row shows that the feature transfer can bring about $5.5\%$ gains in mAP. To train the model suitable for the unbalanced inference scenario, we add the UBS on it. But we find that the performance on mAP has a little drop. We think that is caused by the model design who is not fit the unbalanced data. Now, we add the $\mathrm{H}^2\mathrm{G}$ back in the 3rd line, equal to the complete $\mathrm{H}^2\mathrm{FT}$ , and achieve additional $1.67\%$ mAP gains. proving the effectiveness of our $\mathrm{H}^2\mathrm{FT}$ .
+
+Effectiveness of CRI. The proposed CRI algorithm utilizes the counterfactual intervention to highlight the role of the topology to tackle the sub-optimal topology structure problem. As shown in Table 3, CRI algorithm brings improvements of $1.79\%$ rank-1 accuracy and $1.00\%$ mAP accuracy without any computational costs in the inference stage. In addition, we also do another quantitative analysis of the CRI to demonstrate its contribution. Specifically, we first compute the ideal affinity matrix by the ground-truth label, which uses 1 to indicate the positive pair and 0 as the negative one. And then for the affinity matrix computed by our model, we define the top-4 results in each row as positive. After that, we compute the averaged error rate between the predicted affinities with the ground truths in the entire test set. The results are shown in Table 4. In the single-shot all-search mode, the model without CRI gets for $5.16\%$ error ratio while the model with CRI achieves $3.90\%$ . In other test modes, introducing CRI also significantly reduces the error ratios. This reflects that our CRI has learned a better structure which is more close to the ground-truth one.
+
+# 6 Conclusion
+
+We propose a Homogeneous and Heterogeneous Feature Transfer (H²FT) module with a Counterfactual Relation Intervention (CRI) learning method to tackle the Visible-Infrared Person Re-identification. The H²FT consists of two types of graph modules that can handle the train-test modality balance gap that the previous graph-based model suffered. And CRI introduces the causal inference tool to tackle the sub-optimal topology structure problem and makes our method more generalized.
+
+# References
+
+1. Chalupka, K., Perona, P., Eberhardt, F.: Visual causal feature learning. arXiv preprint arXiv:1412.2309 (2014)
+2. Chen, D., Xu, D., Li, H., Sebe, N., Wang, X.: Group consistent similarity learning via deep crf for person re-identification. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 8649-8658 (2018)
+3. Chen, L., Yan, X., Xiao, J., Zhang, H., Pu, S., Zhuang, Y.: Counterfactual samples synthesizing for robust visual question answering. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10800-10809 (2020)
+4. Dai, P., Ji, R., Wang, H., Wu, Q., Huang, Y.: Cross-modality person re-identification with generative adversarial training. In: IJCAI. vol. 1, p. 2 (2018)
+5. Gong, S., Cristani, M., Loy, C.C., Hospedales, T.M.: The re-identification challenge. In: Person re-identification, pp. 1-20. Springer (2014)
+6. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial networks. Communications of the ACM 63(11), 139–144 (2020)
+7. Hao, X., Zhao, S., Ye, M., Shen, J.: Cross-modality person re-identification via modality confusion and center aggregation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 16403-16412 (2021)
+8. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+9. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114 (2013)
+0. Ling, Y., Luo, Z., Lin, Y., Li, S.: A multi-constraint similarity learning with adaptive weighting for visible-thermal person re-identification. In: IJCAI. pp. 845-851 (2021)
+1. Liu, H., Tan, X., Zhou, X.: Parameter sharing exploration and hetero-center triplet loss for visible-thermal person re-identification. IEEE Transactions on Multimedia (2020)
+2. Lopez-Paz, D., Nishihara, R., Chintala, S., Scholkopf, B., Bottou, L.: Discovering causal signals in images. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 6979-6987 (2017)
+3. Lu, Y., Wu, Y., Liu, B., Zhang, T., Li, B., Chu, Q., Yu, N.: Cross-modality person re-identification with shared-specific feature transfer. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13379–13389 (2020)
+4. Luo, C., Chen, Y., Wang, N., Zhang, Z.: Spectral feature transformation for person re-identification. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4976-4985 (2019)
+5. Luo, H., Gu, Y., Liao, X., Lai, S., Jiang, W.: Bag of tricks and a strong baseline for deep person re-identification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 0–0 (2019)
+6. Nguyen, D.T., Hong, H.G., Kim, K.W., Park, K.R.: Person recognition system based on a combination of body images from visible light and thermal cameras. Sensors 17(3), 605 (2017)
+7. Niu, Y., Tang, K., Zhang, H., Lu, Z., Hua, X.S., Wen, J.R.: Counterfactual vqa: A cause-effect look at language bias. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12700-12710 (2021)
+
+18. Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., Lerer, A.: Automatic differentiation in pytorch (2017)
+19. Pearl, J., Glymour, M.a., Jewell, N.P.: Causal inference in statistics: A primer. John Wiley & Sons (2016)
+20. Pearl, J., Mackenzie, D.: The book of why: the new science of cause and effect. Basic books (2018)
+21. Qi, J., Niu, Y., Huang, J., Zhang, H.: Two causal principles for improving visual dialog. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10860-10869 (2020)
+22. Rao, Y., Chen, G., Lu, J., Zhou, J.: Counterfactual attention learning for fine-grained visual categorization and re-identification. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 1025-1034 (2021)
+23. Shen, Y., Li, H., Xiao, T., Yi, S., Chen, D., Wang, X.: Deep group-shuffling random walk for person re-identification. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2265-2274 (2018)
+24. Shen, Y., Li, H., Yi, S., Chen, D., Wang, X.: Person re-identification with deep similarity-guided graph neural network. In: Proceedings of the European conference on computer vision (ECCV). pp. 486-504 (2018)
+25. Sun, Y., Cheng, C., Zhang, Y., Zhang, C., Zheng, L., Wang, Z., Wei, Y.: Circle loss: A unified perspective of pair similarity optimization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6398-6407 (2020)
+26. Sun, Y., Zheng, L., Yang, Y., Tian, Q., Wang, S.: Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In: Proceedings of the European conference on computer vision (ECCV). pp. 480-496 (2018)
+27. Tang, K., Huang, J., Zhang, H.: Long-tailed classification by keeping the good and removing the bad momentum causal effect. arXiv preprint arXiv:2009.12991 (2020)
+28. Tang, K., Niu, Y., Huang, J., Shi, J., Zhang, H.: Unbiased scene graph generation from biased training. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3716-3725 (2020)
+29. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+30. Velicković, P., Cucurull, G., Casanova, A., Romero, A., Lio, P., Bengio, Y.: Graph attention networks. arXiv preprint arXiv:1710.10903 (2017)
+31. Wang, G.A., Zhang, T., Yang, Y., Cheng, J., Chang, J., Liang, X., Hou, Z.G.: Cross-modality paired-images generation for rgb-infrared person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 12144-12151 (2020)
+32. Wang, G., Zhang, T., Cheng, J., Liu, S., Yang, Y., Hou, Z.: Rgb-infrared cross-modality person re-identification via joint pixel and feature alignment. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3623-3632 (2019)
+33. Wang, T., Huang, J., Zhang, H., Sun, Q.: Visual commonsense r-cnn. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10760-10770 (2020)
+34. Wang, Z., Wang, Z., Zheng, Y., Chuang, Y.Y., Satoh, S.: Learning to reduce dual-level discrepancy for infrared-visible person re-identification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 618-626 (2019)
+
+35. Wei, Z., Yang, X., Wang, N., Gao, X.: Syncretic modality collaborative learning for visible infrared person re-identification. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 225-234 (2021)
+36. Wu, A., Zheng, W.S., Yu, H.X., Gong, S., Lai, J.: RGB-infrared cross-modality person re-identification. In: Proceedings of the IEEE international conference on computer vision. pp. 5380-5389 (2017)
+37. Wu, Q., Dai, P., Chen, J., Lin, C.W., Wu, Y., Huang, F., Zhong, B., Ji, R.: Discover cross-modality nuances for visible-infrared person re-identification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4330-4339 (2021)
+38. Ye, M., Lan, X., Li, J., Yuen, P.: Hierarchical discriminative learning for visible thermal person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 32 (2018)
+39. Ye, M., Shen, J., J. Crandall, D., Shao, L., Luo, J.: Dynamic dual-attentive aggregation learning for visible-infrared person re-identification. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XVII 16. pp. 229-247. Springer (2020)
+40. Ye, M., Shen, J., Lin, G., Xiang, T., Shao, L., Hoi, S.C.: Deep learning for person re-identification: A survey and outlook. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021)
+41. Ye, M., Wang, Z., Lan, X., Yuen, P.C.: Visible thermal person re-identification via dual-constrained top-ranking. In: IJCAI. vol. 1, p. 2 (2018)
+42. Zhang, L., Du, G., Liu, F., Tu, H., Shu, X.: Global-local multiple granularity learning for cross-modality visible-infrared person reidentification. IEEE Transactions on Neural Networks and Learning Systems (2021)
+43. Zhang, X., Luo, H., Fan, X., Xiang, W., Sun, Y., Xiao, Q., Jiang, W., Zhang, C., Sun, J.: Alignedreid: Surpassing human-level performance in person re-identification. arXiv preprint arXiv:1711.08184 (2017)
+44. Zhang, X., Jiang, M., Zheng, Z., Tan, X., Ding, E., Yang, Y.: Understanding image retrieval re-ranking: a graph neural network perspective. arXiv preprint arXiv:2012.07620 (2020)
+45. Zhang, Z., Zhao, Z., Lin, Z., He, X., et al.: Counterfactual contrastive learning for weakly-supervised vision-language grounding. Advances in Neural Information Processing Systems 33, 18123-18134 (2020)
+46. Zhao, Z., Liu, B., Chu, Q., Lu, Y., Yu, N.: Joint color-irrelevant consistency learning and identity-aware modality adaptation for visible-infrared cross modality person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 35, pp. 3520-3528 (2021)
+47. Zhong, Z., Zheng, L., Cao, D., Li, S.: Re-ranking person re-identification with k-reciprocal encoding. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1318-1327 (2017)
+48. Zhong, Z., Zheng, L., Kang, G., Li, S., Yang, Y.: Random erasing data augmentation. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 13001-13008 (2020)
+49. Zhu, Y., Yang, Z., Wang, L., Zhao, S., Hu, X., Tao, D.: Hetero-center loss for cross-modality person re-identification. Neurocomputing 386, 97-109 (2020)
\ No newline at end of file
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/images.zip b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c4bfd56bea410d28c0a157c2eebd0535aba3267b
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3788775626532fa8ed5c6294aebb0a2e64b0512225225ea73c2319fe5033c9c8
+size 367871
diff --git a/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/layout.json b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..98b5fad665655d7ffea79eb523ca362f65812fe8
--- /dev/null
+++ b/counterfactualinterventionfeaturetransferforvisibleinfraredpersonreidentification/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91da56858c5877ac8379820b16113fd2edc4657909d1e1d8dbc297cad27f610b
+size 460206
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_content_list.json b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..780ec88ee3161d1d6f56b3061ec0432061ee93d0
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:316a1154e9a6b07b76a91fa0e16ec6ff4344f38a728474e9d2a578838e0493f7
+size 84442
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_model.json b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..90013d7763c17655963f607ac05aa4cbd0db1cfb
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2c86d874b2284ec23f838233d7ead04fcb546a0c6b469b3e4bbd4054f7dc910
+size 104691
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_origin.pdf b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..468ff38630429caa72755183c215e49a7d4b4aa7
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/2044500a-dc54-49d7-882f-b6a7672845fb_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:12cff1934ace985f9da0552a813cb1651fbdb680e6b762090c3002cda75df4b4
+size 1743145
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/full.md b/couplefacerelationmattersforfacerecognitiondistillation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8fb599b10c442cb7050f1d15d7e785108cd4d327
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/full.md
@@ -0,0 +1,315 @@
+# CoupleFace: Relation Matters for Face Recognition Distillation
+
+Jiaheng Liu $^{1*}$ , Haoyu Qin $^{2*}$ , Yichao Wu $^{2}$ , Jinyang Guo $^{3}$ , Ding Liang $^{2}$ , and Ke Xu $^{1}$
+
+$^{1}$ State Key Lab of Software Development Environment, Beihang University $^{2}$ SenseTime Group Limited
+
+3 SKLSDE, Institute of Artificial Intelligence, Beihang University liujiaheng@buaa.edu.cn, {qinhaoyu1, wuyichao, liangding}@sensetime.com
+
+Abstract. Knowledge distillation is an effective method to improve the performance of a lightweight neural network (i.e., student model) by transferring the knowledge of a well-performed neural network (i.e., teacher model), which has been widely applied in many computer vision tasks, including face recognition (FR). Nevertheless, the current FR distillation methods usually utilize the Feature Consistency Distillation (FCD) (e.g., $L_{2}$ distance) on the learned embeddings extracted by the teacher and student models for each sample, which is not able to fully transfer the knowledge from the teacher to the student for FR. In this work, we observe that mutual relation knowledge between samples is also important to improve the discriminative ability of the learned representation of the student model, and propose an effective FR distillation method called CoupleFace by additionally introducing the Mutual Relation Distillation (MRD) into existing distillation framework. Specifically, in MRD, we first propose to mine the informative mutual relations, and then introduce the Relation-Aware Distillation (RAD) loss to transfer the mutual relation knowledge of the teacher model to the student model. Extensive experimental results on multiple benchmark datasets demonstrate the effectiveness of our proposed CoupleFace for FR. Moreover, based on our proposed CoupleFace, we have won the first place in the ICCV21 Masked Face Recognition Challenge (MS1M track).
+
+Keywords: Face recognition, Knowledge distillation, Loss function
+
+# 1 Introduction
+
+Face recognition (FR) has been well investigated for decades. Most of the progress is credited to large-scale training datasets [59,19], resource-intensive networks with millions of parameters [13,38] and effective loss functions [4,47]. In practice, FR models are often deployed on mobile and embedded devices, which are incompatible with the large neural networks (e.g., ResNet-101 [13]). Besides, as shown in Fig. 1(a), the capacities of the lightweight neural networks (e.g.,
+
+
+Fig. 1. The illustration of different methods for two samples from different classes. $\mathbf{f}_1^t$ and $\mathbf{f}_2^t$ are extracted by teacher model, and $\mathbf{f}_1^s$ and $\mathbf{f}_2^s$ are extracted by student model. $d_t$ and $d_s$ denote the distances (i.e., $1 - \cos (\mathbf{f}_1^t,\mathbf{f}_2^t)$ and $1 - \cos (\mathbf{f}_1^s,\mathbf{f}_2^s)$ ) of the embeddings, where $\cos (\cdot ,\cdot)$ measures the cosine similarity of two features. Model is better when distance is larger. (a). The teacher and student models are both trained by ArcFace [4]. (b). The teacher model is trained by ArcFace. The student model is trained by using FCD. (c). The teacher model is trained by ArcFace. The student model is trained by using both FCD and MRD in CoupleFace.
+
+
+
+
+
+MobileNetV2 [35]) cannot be fully exploited when they are only supervised by existing popular FR loss functions (e.g., ArcFace [4]). Therefore, how to develop lightweight and effective FR models for real-world applications has been investigated in recent years. For example, knowledge distillation [14] is being actively discussed to produce lightweight and effective neural networks, which transfers the knowledge from an effective teacher model to a lightweight student model.
+
+Most existing knowledge distillation works usually aim to guide the student to mimic the behavior of the teacher by introducing probability constraints (e.g., KL divergence [14]) between the predictions of teacher and student models, which are not well-designed for FR. In contrast, as improving the discriminative ability of the feature embedding is the core problem for FR, it is important to enable the student model to share the same embedding space with the teacher model for similarity comparison. Thus, a simple and straightforward FR distillation method is to directly minimize the $L_{2}$ distance of the embeddings extracted by teacher and student models [49,37], which aims to align the embedding spaces between the teacher and student models. We call this simple method as Feature Consistency Distillation (FCD) as shown in Fig. 1(b), and FCD has been widely used in practice to improve the lightweight neural networks for FR.
+
+In Fig. 1(b), when FCD is used, feature embeddings extracted by student model get close to the corresponding feature embeddings extracted by teacher model. However, there are some cases that the distances of embeddings (i.e., $d_{s}$ ) from different classes of student model are still smaller than $d_{t}$ of teacher model. Similarly, there are also some cases that $d_{s}$ from the same class is larger than $d_{t}$ . In practice, when student model is deployed, smaller $d_{s}$ for negative pair or larger $d_{s}$ for positive pair usually leads to false recognition, which indicates that FCD
+
+is not sufficient to transfer the knowledge of teacher model to student model. In Fig. 1(c), we define the cosine similarity between samples as mutual relation and observe that $d_{s} \approx d_{t}$ when we additionally utilize the mutual relation information of teacher model to distill the corresponding mutual relation information of student model. Thus, we propose to introduce the Mutual Relation Distillation (MRD) into the existing FR distillation by reducing the gap between teacher and student models with respect to the mutual relation information.
+
+Since FCD is able to align the embedding space of student model to teacher model well, the student model can distinguish most image pairs easily, which indicates that the differences of the most mutual relations between teacher and student models are relatively small. In other words, most mutual relations cannot provide valuable knowledge and affect the similarity distribution of all image pairs for FR. Therefore, how to generate sufficient informative mutual relations efficiently in MRD is a challenging issue.
+
+Moreover, recent metric learning works [11,53,39] have shown that hard negative samples are crucial for improving the discriminative ability of feature embedding. But these works are not well-designed for mining mutual relations between samples for FR distillation. To this end, we propose to mine informative mutual relations in MRD. Moreover, as the number of positive pairs is usually small, we focus on mining the mutual relations of negative pairs.
+
+Overall, in our work, we propose an effective FR distillation method referred to as CoupleFace, including FCD and MRD. Specifically, we first pre-train the teacher model on the large-scale training dataset. Then, in FCD, we calculate the $L_{2}$ distance of the embeddings extracted by the teacher and student models to generate the FCD loss for aligning the embedding spaces of the teacher and student models. In MRD, we first propose the Informative Mutual Relation Mining module to generate informative mutual relations efficiently in the training process, where the informative prototype set generation and memory-updating strategies are introduced to improve the mining efficiency. Then, we introduce the Relation-Aware Distillation (RAD) loss to exploit the mutual relation knowledge by using valid mutual relations and filtering out relations with subtle differences, which aims to better transfer the informative mutual relation knowledge from the teacher model to the student model.
+
+The contributions are summarized as follows:
+
+- In our work, we first investigate the importance of mutual relation knowledge for FR distillation, and propose an effective distillation framework called CoupleFace, which consists of Feature Consistency Distillation (FCD) and Mutual Relation Distillation (MRD).
+- In MRD, we propose to obtain informative mutual relations efficiently in our Informative Mutual Relation Mining module, where the informative prototype set generation and memory-updating strategies are used. Then, we introduce the Relation-Aware Distillation (RAD) loss to better transfer the mutual relation knowledge.
+- Extensive experiments on multiple benchmark datasets demonstrate the effectiveness and generalization ability of our proposed CoupleFace method.
+
+# 2 Related Work
+
+Face Recognition. FR aims to maximize the inter-class discriminative ability and the intra-class compactness. The success of FR can be summarized into the three factors: effective loss functions [47,58,28,41,46,4,3,31,5,23,24,21,26], large-scale datasets [59,1,18,57,19], and powerful deep neural networks [43,40,38,42,27]. The loss function design is the main-stream research direction for FR, which improves the generalization and discriminative abilities of the learned feature representation. For example, Triplet loss [36] is proposed to enlarge the distances of negative pairs and reduce the distances of positive pairs. Recently, the angular constraint is applied into the cross-entropy loss function in many angular-based loss functions [29,28]. Besides, CosFace [48] and ArcFace [4] further utilize a margin item for better discriminative capability of the feature representation. Moreover, some mining-based loss functions (e.g., CurricularFace [16] and MV-Arc-Softmax [50]) take the difficulty degree of samples into consideration and achieve promising results. The recent work VPL [5] additionally introduces the sample-to-sample comparisons to reduce the gap between the training and evaluation processes for FR. In contrast, we propose to design an effective distillation loss function to improve the lightweight neural network.
+
+Knowledge Distillation. As a representative type of model compression and acceleration methods [9,10,22], knowledge distillation aims to distill knowledge from a powerful teacher model into a lightweight student model [14], which has been applied in many computer vision tasks [56,54,33,44,32,15,2,6,7,55,25,17]. Many distillation methods have been proposed by utilizing different kinds of representation as knowledge for better performance. For example, FitNet [34] uses the middle-level hints from hidden layers of the teacher model to guide the training process of the student model. CRD [44] utilizes a contrastive-based objective function for transferring knowledge between deep networks. Some relation-based knowledge distillation methods (e.g., CCKD [33], RKD [32]) utilize the relation knowledge to improve the student model. Recently, knowledge distillation has also been applied to improve the performance of lightweight network (e.g., MobileNetV2 [35]) for FR. For example, EC-KD [49] proposes a position-aware exclusivity strategy to encourage diversity among different filters of the same layer to alleviate the low capability of student models. When compared with existing works, CoupleFace is well-designed for FR distillation by considering to mine informative mutual relations and transferring the relation knowledge of the teacher model using Relation-Aware Distillation loss.
+
+# 3 Method
+
+In this section, we introduce the details of our CoupleFace in Fig. 2, which contains Feature Consistency Distillation (FCD) and Mutual Relation Distillation (MRD) for FR distillation. The overall pipeline is as follows. First, we train the teacher model on a large-scale dataset. Then, in the distillation process of student model, we extract the feature embeddings based on the teacher and student models for each face image. After that, in FCD, we compute the Feature
+
+
+Fig. 2. The framework of CoupleFace for FR distillation. In FCD, we use the $\mathcal{L}_{fcd}$ loss between $\mathbf{f}_i^s$ and $\mathbf{f}_i^t$ to align the embedding spaces of the teacher and student models. In MRD, we first mine the informative features $\{\mathbf{g}_i^k\}_{k=1}^K$ (see Sec. 3.3), where $K$ is the number of features, and calculate the teacher mutual relations (TMRs) and student mutual relations (SMRs) based on $\mathbf{f}_i^s$ , $\mathbf{f}_i^t$ and $\{\mathbf{g}_i^k\}_{k=1}^K$ . Then, we minimize the $\mathcal{L}_{rad}$ loss to transfer the mutual relation knowledge of the teacher model to student model.
+
+Consistency Distillation (FCD) loss $\mathcal{L}_{fd}$ based on $L_{2}$ distance of the feature embeddings. Meanwhile, in MRD, we first build the informative mutual relations using the feature embeddings of teacher and student models with the mined informative features as shown in Fig. 3, and then calculate the Relation-Aware Distillation (RAD) loss $\mathcal{L}_{rad}$ to transfer the mutual relation knowledge.
+
+# 3.1 Preliminary on Face Recognition Distillation
+
+In this section, we define some notations in CoupleFace, and discuss the necessity of FR distillation when compared with traditional knowledge distillation.
+
+Notations. We denote the teacher model as $\mathcal{T}$ and the student model as $\mathcal{S}$ . For each sample $x_{i}$ , the corresponding identity label is $y_{i}$ , and the corresponding features extracted by $\mathcal{T}$ and $\mathcal{S}$ are denoted as $\mathbf{f}_i^t$ and $\mathbf{f}_i^s$ , respectively.
+
+Necessity of Face Recognition Distillation. For the traditional knowledge distillation of image classification, the existing methods usually utilize the probability consistency [14] (e.g., KL divergence) to align the prediction probabilities from $S$ with the prediction probabilities from $\mathcal{T}$ . However, the traditional knowledge distillation techniques are usually incompatible with FR. In practice, for FR, we can only obtain a pre-trained $\mathcal{T}$ but have no idea about how it was trained (e.g., the training datasets, loss functions). Therefore, the probability consistency loss is not available when the number of identities of the training dataset for $\mathcal{T}$ is different from the current dataset for $S$ or $\mathcal{T}$ is trained by other metric learning based loss functions (e.g., triplet loss [36]). Besides, FR models are trained to generate discriminative feature embeddings for similarity comparison in the open-set setting rather than an effective classifier for the close-set classification. Thus, aligning the embedding spaces between $S$ and $\mathcal{T}$ is more important for FR distillation.
+
+# 3.2 Feature Consistency Distillation
+
+In Feature Consistency Distillation (FCD), to boost the performance of $S$ for FR, a simple and effective Feature Consistency Distillation (FCD) loss $\mathcal{L}_{fcd}$ is widely adopted in practice, which is defined as follows:
+
+$$
+\mathcal {L} _ {f c d} = \frac {1}{2 N} \sum_ {i = 1} ^ {N} \left| \left| \frac {\mathbf {f} _ {i} ^ {t}}{| | \mathbf {f} _ {i} ^ {t} | | _ {2}} - \frac {\mathbf {f} _ {i} ^ {s}}{| | \mathbf {f} _ {i} ^ {s} | | _ {2}} \right| \right| ^ {2}, \tag {1}
+$$
+
+where $N$ is the number of face images for each mini-batch.
+
+# 3.3 Mutual Relation Distillation
+
+In this section, we describe the Mutual Relation Distillation (MRD) of Couple-Face in detail. First, we discuss the necessity of MRD for FR distillation. Then, we describe how to generate the informative mutual relations by using our informative mutual relation mining strategy. Finally, we introduce the Relation-Aware Distillation (RAD) loss to transfer the mutual relation knowledge.
+
+Necessity of Mutual Relation Distillation. First, we define a pair of embeddings as a couple. Given a couple $(\mathbf{f}_i^g,\mathbf{f}_j^g)$ , $g\in \{s,t\}$ denotes $\mathcal{S}$ or $\mathcal{T}$ , the mutual relation $\mathrm{R}(\mathbf{f}_i^g,\mathbf{f}_j^g)$ of this couple is defined as follows:
+
+$$
+\operatorname {R} \left(\mathbf {f} _ {i} ^ {g}, \mathbf {f} _ {j} ^ {g}\right) = \cos \left(\mathbf {f} _ {i} ^ {g}, \mathbf {f} _ {j} ^ {g}\right), \tag {2}
+$$
+
+where $\cos (\cdot ,\cdot)$ measures the cosine similarity between two features. Given two couples $(\mathbf{f}_i^t,\mathbf{f}_i^s)$ and $(\mathbf{f}_j^t,\mathbf{f}_j^s)$ , when FCD loss is applied on $S$ , the mutual relations $\mathrm{R}(\mathbf{f}_i^t,\mathbf{f}_i^s)$ and $\mathrm{R}(\mathbf{f}_j^t,\mathbf{f}_j^s)$ will be maximized. However, in practice, when $S$ is deployed, the mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ will be used to measure the similarity of this couple $(\mathbf{f}_i^s,\mathbf{f}_j^s)$ for FR. Thus, if we only use the FCD loss in FR distillation, the optimization on the mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ is ignored, which limits the further improvement of $S$ for FR. Meanwhile, $\mathcal{T}$ with superior performance is able to provide an effective mutual relation $\mathrm{R}(\mathbf{f}_i^t,\mathbf{f}_j^t)$ as the ground-truth to distill the mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ from $S$ . Therefore, we introduce the MRD into the existing FR distillation framework.
+
+However, direct optimization on mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ may not be a good choice in practice. Due to the batch size limitation and randomly sampling strategy in the training process, the mutual relations for these couples $\{(f_i^s,f_j^s)\}_{j = 1,j\neq i}^N$ constructed across the mini-batch cannot support an effective and efficient mutual relation distillation. To this end, in CoupleFace, we propose to optimize $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^t)$ instead of $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ for following reasons. First, the quantity of mutual relations for these couples $\{(\mathbf{f}_i^s,\mathbf{f}_j^t)\}_{j = 1,j\neq i}^L$ can be very large, where $L$ is the number of samples of the dataset and $\mathbf{f}_j^t$ can be pre-calculated using teacher model. Second, the quality of the mutual relation for couple $(\mathbf{f}_i^s,\mathbf{f}_j^t)$ can be guaranteed as it can be mined from sufficient couples. Third, $\mathbf{f}_j^s$ is almost the same as $\mathbf{f}_j^t$ from the perspective of $\mathbf{f}_i^s$ when the FCD loss between $\mathbf{f}_j^s$ and $\mathbf{f}_j^t$
+
+
+Fig. 3. We first pre-calculate identity prototypes $\{\mathbf{r}_m\}_{m=1}^M$ and generate the informative prototype set $H_{y_i}$ for identity $y_i$ using our informative prototype set generation strategy, where $M$ is the number of identities across the training dataset. Then, we maintain a feature bank $\mathbf{E} \in \mathbb{R}^{M \times d}$ to store the feature embeddings of $\mathcal{T}$ , which is updated in each iteration using our memory-updating strategy. Finally, we obtain $K$ informative features $\{\mathbf{g}_i^k\}_{k=1}^K$ based on $H_{y_i}$ and $\mathbf{E}$ , and construct the SMRs and the TMRs based on $\mathbf{f}_i^s$ , $\mathbf{f}_i^t$ and $\{\mathbf{g}_i^k\}_{k=1}^K$ . Here, we set $K = 4$ for better illustration.
+
+is fast converged, which represents that the mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^t)$ of couple $(\mathbf{f}_i^s,\mathbf{f}_j^t)$ is an ideal approximation of $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ of couple $(\mathbf{f}_i^s,\mathbf{f}_j^s)$ . Therefore, we propose to use the mutual relation $\mathrm{R}(\mathbf{f}_i^t,\mathbf{f}_j^t)$ to distill $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^t)$ .
+
+Note that we call $\mathrm{R}(\mathbf{f}_i^t, \mathbf{f}_j^t)$ and $\mathrm{R}(\mathbf{f}_i^s, \mathbf{f}_j^t)$ as teacher mutual relation (TMR) and student mutual relation (SMR), respectively. To sum up, in MRD, we propose to utilize TMRs to distill the SMRs in the training process of FR.
+
+Informative Mutual Relation Mining. In this section, we describe how to generate informative mutual relations efficiently in Fig. 3 of CoupleFace.
+
+Intuitively, for $\mathbf{f}_i^s$ and $\mathbf{f}_i^t$ , a straightforward way is to construct the couples across all training samples and generate SMRs and TMRs. However, the computation cost is very large in this way, which is not applicable in practice. An alternative way is to generate SMRs and TMRs across the mini-batch. However, the batch size is relatively small and most mutual relations cannot provide valuable knowledge to improve $\mathcal{S}$ , as it is easy to distinguish most image pairs and only the hard image pairs will greatly affect the performance of FR model. Meanwhile, recent metric learning works [11,53,39] show that hard negative samples are crucial for improving the discriminative ability of the embeddings. Therefore, in MRD, we propose to mine informative mutual relations among negative pairs to reduce the computation cost and improve $\mathcal{S}$ as shown in Fig. 3. Specifically, we use an informative prototype set generation strategy to find a set of most similar identities called informative prototype set $H_{y_i}$ for identity $y_i$ . Then, we utilize a memory-updating strategy to build the informative mutual relations based on $\mathbf{f}_i^s$ , $\mathbf{f}_i^t$ and the features belonging to $H_{y_i}$ efficiently.
+
+Informative prototype set generation. First, we extract the features of the training data by using a well-performed trained model. In our work, we directly use $\mathcal{T}$ . The generated features can be denoted as $\{\mathbf{f}_i^t\}_{i=1}^L$ and the corresponding
+
+identity label is $y_{i}$ for $\mathbf{f}_i^t$ . For the training dataset, we denote the number of samples as $L$ , the number of identities as $M$ , and the identity label set as $\{m\}_{m=1}^{M}$ . For each identity $m$ , we calculate the identity prototype $\mathbf{r}_m$ as follows:
+
+$$
+\mathbf {r} _ {m} = \frac {1}{l _ {m}} \sum_ {i = 1, y _ {i} = m} ^ {L} \frac {\mathbf {f} _ {i} ^ {t}}{\| \mathbf {f} _ {i} ^ {t} \| _ {2}}, \tag {3}
+$$
+
+where $l_{m}$ is the number of samples in the training dataset for identity $m$ . Then, all identity prototypes of the dataset can be denoted as $\{\mathbf{r}_m\}_{m=1}^M$ . After that, to find the informative prototype set $H_{m}$ for $\mathbf{r}_m$ , we calculate the cosine similarity between $\mathbf{r}_m$ and $\mathbf{r}_n$ , where $n \in \{m\}_{m=1}^M$ and $n \neq m$ . Afterwards, we select the top $K$ (e.g., $K = 100$ ) identities with the largest similarities to construct $H_{m}$ for identity $m$ , where $H_{m}$ contains $K$ identity labels. Finally, the informative prototype set for identity $y_i$ is denoted as $H_{y_i}$ .
+
+Memory-updating. As the number of samples belonging to $H_{y_i}$ is also relatively large, we further propose a memory-updating strategy to reduce the computation cost while making full use of all samples belonging to $H_{y_i}$ inspired by MoCo [12]. Specifically, we maintain a feature bank $\mathbf{E} \in \mathbb{R}^{M \times d}$ to store feature embeddings extracted by $\mathcal{T}$ , where only one embedding is preserved for each identity and $d$ is the dimension (e.g., 512) of the embedding. At the beginning of the training process for $S$ , we initialize the feature bank $\mathbf{E}$ by randomly selecting one feature embedding generated by $\mathcal{T}$ for each identity. Then, in each iteration, we first obtain the feature embeddings $\{\mathbf{f}_i^t\}_{i=1}^N$ extracted by $\mathcal{T}$ , where $N$ is the size of mini-batch, and we update the feature bank $\mathbf{E}$ by setting $\mathbf{E}[y_i] = \mathbf{f}_i^t$ , where $[\cdot]$ means to obtain features from $\mathbf{E}$ based on identity $y_i$ .
+
+Based on the informative prototype set $H_{y_i}$ for $y_i$ , we can obtain $K$ informative negative features $\mathbf{G}_i = \mathbf{E}[H_{y_i}]$ , where $\mathbf{G}_i \in \mathbb{R}^{K \times d}$ . Meanwhile, we denote each feature in $\mathbf{G}_i$ as $\mathbf{g}_i^k$ , where $k \in \{1, \dots, K\}$ . Finally, a set of couples $\{(\mathbf{f}_i^s, \mathbf{g}_i^k)\}_{k=1}^K$ is constructed for $\mathbf{f}_i^s$ and we can calculate the informative SMRs using these couples. Similarly, we can also generate the informative TMRs based on a set of couples $\{(\mathbf{f}_i^t, \mathbf{g}_i^k)\}_{k=1}^K$ as the ground-truth of these SMRs.
+
+Relation-Aware Distillation Loss. Based on the mined TMRs and SMRs, the Relation-Aware Distillation (RAD) loss can be easily defined as follows:
+
+$$
+\mathcal {L} _ {r a d} = \frac {1}{N K} \sum_ {i = 1} ^ {N} \sum_ {k = 1} ^ {K} | \cos \left(\mathbf {f} _ {i} ^ {s}, \mathbf {g} _ {i} ^ {k}\right) - \cos \left(\mathbf {f} _ {i} ^ {t}, \mathbf {g} _ {i} ^ {k}\right) |. \tag {4}
+$$
+
+However, the teacher model is not always better than the student model for each case in the training dataset. As illustrated in Fig. 4 of Sec. 4.4, we observe that $\cos (\mathbf{f}_i^t,\mathbf{g}_i^k) > \cos (\mathbf{f}_i^s,\mathbf{g}_i^k)$ does exist between the mined TMRs and SMRs. Therefore, if we directly use the Eq. (4) to transfer the mutual relation knowledge of $\mathcal{T}$ , $S$ will be misled in some cases, which may degrade the performance of $S$ .
+
+To this end, we propose only to use the valid mutual relations when $\cos (\mathbf{f}_i^t,\mathbf{g}_i^k) < \cos (\mathbf{f}_i^s,\mathbf{g}_i^k)$ , and we reformulate the RAD loss of Eq. (4) as follows:
+
+$$
+\mathcal {L} _ {r a d} = \frac {1}{N ^ {\prime}} \sum_ {i = 1} ^ {N} \sum_ {k = 1} ^ {K} \max \left(\cos \left(\mathbf {f} _ {i} ^ {s}, \mathbf {g} _ {i} ^ {k}\right) - \cos \left(\mathbf {f} _ {i} ^ {t}, \mathbf {g} _ {i} ^ {k}\right), 0\right), \tag {5}
+$$
+
+where $N^{\prime}$ is the number of valid mutual relations across the mini-batch. Thus, RAD loss of Eq. (5) will only affect the gradient when $\cos (\mathbf{f}_i^t,\mathbf{g}_i^k) < \cos (\mathbf{f}_i^s,\mathbf{g}_i^k)$ and transfer the accurate mutual relation knowledge from $\mathcal{T}$ to $\mathcal{S}$ in MRD.
+
+We mine informative mutual relations for each identity. But there exists some identities, which can be easily distinguished from other identities, which indicates that the differences between the mined SMRs and TMRs for these identities are still subtle. Inspired by the hinge loss [8], we further propose a more effective variant of our RAD loss by introducing a margin $q$ as follows:
+
+$$
+\mathcal {L} _ {r a d} = \frac {1}{N ^ {\prime}} \sum_ {i = 1} ^ {N} \sum_ {k = 1} ^ {K} \max \left(\cos \left(\mathbf {f} _ {i} ^ {s}, \mathbf {g} _ {i} ^ {k}\right) - \cos \left(\mathbf {f} _ {i} ^ {t}, \mathbf {g} _ {i} ^ {k}\right) - q, 0\right). \tag {6}
+$$
+
+Intuitively, the RAD loss in Eq. (6) further filters out the mutual relations with subtle differences between the SMRs and TMRs and pays attention to these SMRs, which are far away from their corresponding TMRs.
+
+# 3.4 Loss Function of CoupleFace
+
+The overall loss function of CoupleFace is defined as follows:
+
+$$
+\mathcal {L} = \mathcal {L} _ {f c d} + \alpha \cdot \mathcal {L} _ {r a d} + \beta \cdot \mathcal {L} _ {c e}, \tag {7}
+$$
+
+where $\alpha$ and $\beta$ are the weights of RAD loss $\mathcal{L}_{rad}$ and recognition loss $\mathcal{L}_{ce}$ (e.g., ArcFace [4]), respectively. We also provide an algorithm in Alg. 1.
+
+# 4 Experiments
+
+Datasets. For training, the mini version of Glint360K [1] named as Glint-Mini [18] is used, where Glint-Mini [18] contains 5.2M images of 91k identities. For testing, we use four datasets (i.e., IJB-B [51], IJB-C [30], and MegaFace [19]).
+
+Experimental setting. For the pre-processing of the training data, we follow the recent works [4,20,3] to generate the normalized face crops $(112 \times 112)$ . For teacher models, we use the widely used large neural networks (e.g., ResNet-34, ResNet-50 and ResNet-100 [13]). For student models, we use MobileNetV2 [35] and ResNet-18 [13]. For all models, the feature dimension is 512. For the training process of all models based on ArcFace loss, the initial learning rate is 0.1 and divided by 10 at the $100\mathrm{k}$ , $160\mathrm{k}$ , $180\mathrm{k}$ iterations. The batch size and the total iteration are set as 512 and $200\mathrm{k}$ , respectively. For the distillation process, the initial learning rate is 0.1 and divided by 10 at the $45\mathrm{k}$ , $70\mathrm{k}$ , $90\mathrm{k}$ iterations. The batch size and the total iteration are set as 512 and $100\mathrm{k}$ , respectively. In the informative mutual relation mining stage, we set the number of most similar identities (i.e., $K$ ) as 100. In Eq. (6), we set the margin (i.e., $q$ ) as 0.03. The loss weight $\alpha$ is set as 1, where $\beta$ is set as 0 in the first $100\mathrm{k}$ iterations, and is set as 0.01 in CoupleFace+ of Table 1. In the following experiments of different distillation methods, by default, we use the ResNet-50 (R-50), MobileNetV2 (MBNet) as $\mathcal{T}$ and $\mathcal{S}$ , respectively.
+
+Algorithm 1 CoupleFace
+Input: Pre-trained teacher model $\mathcal{T}$ ; Randomly initialized student model $S$ ; Current batch with $N$ images; The dimension of feature representation $d$ ; The number of identities $M$ ; The training dataset with $L$ images; The feature bank $\mathbf{E} \in \mathbb{R}^{M \times d}$ ;
+1: Extract all features $\{\mathbf{f}_i^t\}_{i=1}^L$ of the dataset using $\mathcal{T}$ ;
+2: Generate all identity prototypes $\{\mathbf{r}_m\}_{m=1}^M$ based on $\{\mathbf{f}_i^t\}_{i=1}^L$ according to Eq. (3);
+3: Based on $\{\mathbf{r}_m\}_{m=1}^M$ , calculate informative prototype set $\{H_{y_i}\}_{i=1}^L$ for each sample according to the label $y_i$ ;
+4: Initialize feature bank $\mathbf{E}$ using $\{\mathbf{f}_i^t\}_{i=1}^L$ ;
+5: for each iteration in the training process do
+6: Get features $\{\mathbf{f}_i^t\}_{i=1}^N$ extracted by $\mathcal{T}$ from $\{\mathbf{f}_i^t\}_{i=1}^L$ ;
+7: Get features $\{\mathbf{f}_i^s\}_{i=1}^N$ extracted by $\mathcal{S}$ ;
+8: Calculate $\mathcal{L}_{fd}$ of $\{\mathbf{f}_i^s\}_{i=1}^N$ and $\{\mathbf{f}_i^t\}_{i=1}^N$ by Eq. (1);
+9: Update feature bank $\mathbf{E}$ using $\{\mathbf{f}_i^t\}_{i=1}^N$ ;
+10: for each feature $\mathbf{f}_i^s$ in $\{\mathbf{f}_i^s\}_{i=1}^N$ do
+11: Get $K$ informative negative features $\{\mathbf{g}_i^k\}_{k=1}^K$ from $\mathbf{E}$ using $H_{y_i}$ ;
+12: Build TMRs and SMRs by $\{(\mathbf{f}_i^s, \mathbf{g}_i^k)\}_{k=1}^K$ and $\{(\mathbf{f}_i^t, \mathbf{g}_i^k)\}_{k=1}^K$ , respectively;
+13: end for
+14: Calculate $\mathcal{L}_{rad}$ using TMRs and SMRs by Eq. (6);
+15: Update the parameters of $\mathcal{S}$ by minimizing the loss function $\mathcal{L} = \mathcal{L}_{fd} + \alpha \cdot \mathcal{L}_{rad} + \beta \cdot \mathcal{L}_{ce}$ ;
+16: end for
+Output: The optimized student model $\mathcal{S}$ .
+
+# 4.1 Results on the IJB-B and IJB-C datasets
+
+As shown in Table 1, the first two rows represent the performance of models trained by using the ArcFace loss function [4]. We compare our method with classical KD [14], FCD, CCKD [33], SP [45], RKD [32], EC-KD [49]. For FCD, we only use the FCD loss of Eq. (1) to align the embedding space of the student and teacher models, which is a very strong baseline to improve the performance of student model for FR. For these methods (i.e., CCKD [33], SP [45] and RKD [32]), we combine these methods with FCD loss instead of the classical KD loss to achieve better performance. For EC-KD proposed for FR, we implement this method. In Table 1, FCD is much better than classical KD, which indicates the importance of aligning embedding space for FR when compared with classical KD. Moreover, we observe that CoupleFace achieves significant performance improvements when compared with existing methods, which demonstrates the effectiveness of CoupleFace. For the CoupleFace+, we first pretrain student by CoupleFace, and then train student by CoupleFace with ArcFace by setting $\beta$ in Eq.(7) as 0.01 for another 100k iterations, better results are obtained.
+
+# 4.2 Results on the MegaFace dataset
+
+In Table 2, we also provide the results of CoupleFace on MegaFace [52], and we observe that CoupleFace is better than other methods. For example, when
+
+Table 1. Results (TAR@FAR) on IJB-B and IJB-C of different methods.
+
+| Models | Method | IJB-B | IJB-C |
| 1e-4 | 1e-5 | 1e-4 | 1e-5 |
| R-50 [13] | ArcFace [4] | 93.89 | 89.61 | 95.75 | 93.44 |
| MBNet [35] | ArcFace [4] | 85.97 | 75.81 | 88.95 | 82.64 |
| MBNet [35] | KD [14] | 86.12 | 75.99 | 89.03 | 82.69 |
| FCD | 90.34 | 81.92 | 92.68 | 87.74 |
| CCKD [33] | 90.72 | 83.34 | 93.17 | 89.11 |
| RKD [32] | 90.32 | 82.45 | 92.33 | 88.12 |
| SP [45] | 90.52 | 82.88 | 92.71 | 88.52 |
| EC-KD [49] | 90.59 | 83.54 | 92.85 | 88.32 |
| CoupleFace | 91.18 | 84.63 | 93.18 | 89.57 |
| CoupleFace+ | 91.48 | 85.12 | 93.37 | 89.85 |
+
+compared with the FCD baseline, our method improves the rank-1 accuracy by $0.62\%$ on MegaFace under the distractor size as $10^{6}$ .
+
+Table 2. Rank-1 accuracy with different distractors on MegaFace.
+
+| Models | Method | Distractors |
| 104 | 105 | 106 |
| R-50 [13] | ArcFace [4] | 99.40 | 98.98 | 98.33 |
| MBNet [35] | ArcFace [4] | 94.56 | 90.25 | 84.64 |
| MBNet [35] | KD [14] | 94.46 | 90.25 | 84.65 |
| FCD | 97.81 | 96.39 | 93.65 |
| CCKD [33] | 98.07 | 96.43 | 93.90 |
| RKD [32] | 98.06 | 96.41 | 93.84 |
| SP [45] | 98.01 | 96.58 | 93.95 |
| EC-KD [49] | 98.00 | 96.41 | 93.85 |
| CoupleFace | 98.09 | 96.74 | 94.27 |
+
+# 4.3 Ablation Study
+
+The effect of different variants of RAD loss. In MRD, we propose three variants of RAD loss (i.e., Eq. (4), Eq. (5) and Eq. (6)). To analyze the effect of different variants, we also perform additional experiments based on Eq. (4) and Eq. (5) and report the results of MBNet on IJB-B and IJB-C. In Table 3, for CoupleFace-A, we replace the RAD loss of Eq. (6) with Eq. (4), which means that we transfer the mutual relations by distilling all TMRs to the corresponding SMRs without any selection process. For CoupleFace-B, we replace the RAD loss of Eq. (6) with Eq. (5) without using the margin item. In Table 3, we observe that CoupleFace-B outperforms CoupleFace-A a lot, which shows the effectiveness of only using the mutual relations when $\cos (\mathbf{f}_i^t,\mathbf{g}_i^k) < \cos (\mathbf{f}_i^s,\mathbf{g}_i^k)$ . Moreover,
+
+Table 3. Results on IJB-B and IJB-C of different methods.
+
+| Methods | IJB-B | IJB-C |
| 1e-4 | 1e-5 | 1e-4 | 1e-5 |
| CoupleFace | 91.18 | 84.63 | 93.18 | 89.57 |
| CoupleFace-A | 90.73 | 83.68 | 92.75 | 88.35 |
| CoupleFace-B | 90.88 | 84.23 | 93.02 | 88.99 |
| CoupleFace-C | 90.65 | 83.18 | 92.52 | 88.89 |
| CoupleFace-D | 90.85 | 83.73 | 92.86 | 89.04 |
| CoupleFace-E | 90.78 | 83.32 | 92.78 | 88.79 |
+
+- CoupleFace also outperforms CoupleFace-B, so it is necessary to emphasize the distillation on these SMRs, which are far from their corresponding TMRs.
+
+The effect of Informative Mutual Relation Mining. To demonstrate the effect of mining the informative mutual relations, we further propose three alternative variants of CoupleFace (i.e., CoupleFace-C, CoupleFace-D, CoupleFace-E). Specifically, for CoupleFace-C, we propose to directly optimize mutual relation $\mathrm{R}(\mathbf{f}_i^s,\mathbf{f}_j^s)$ without the process of mining mutual relations, where only mutual relations from limited couples $\{(\mathbf{f}_i^s,\mathbf{f}_j^s)\}_{j = 1,j\neq i}^N$ across the mini-batch are constructed. For CoupleFace-D, we randomly select $K = 100$ identities to construct the $H_{y_i}$ for each identity $y_{i}$ , while for CoupleFace-E, we propose to build the TMRs and SMRs across the mini-batch without mining process, and compute the RAD loss from them. As shown in Table 3, we observe that CoupleFace is much better than three alternative variants, which demonstrates that it is beneficial to mine the informative mutual relations in CoupleFace.
+
+The effect of informative prototype set generation when using different models. In our work, we directly use $\mathcal{T}$ (i.e., R-50) to generate the informative prototype set $H_{y_i}$ for each identity $y_i$ . Here, we propose to use other pre-trained models (i.e., MBNet and ResNet-100 (R-100)) trained by ArcFace loss to generate $H_{y_i}$ for $y_i$ , and we call these alternative methods as CoupleFace-MBN and CoupleFace-RN100, respectively. In Table 4, we report the results of MBNet on IJB-B and IJB-C after using CoupleFace, CoupleFace-MBN and CoupleFace-RN100. We observe that CoupleFace achieves comparable performance with CoupleFace-RN100, and higher performance than CoupleFace-MBN. For this phenomenon, we assume that when using a more effective model, we will generate more discriminative identity prototypes $\{\mathbf{r}_m\}_{m=1}^M$ , which leads to generating a more accurate informative prototype set $H_{y_i}$ . Thus, it is beneficial to use effective models for obtaining the informative prototype set.
+
+# 4.4 Further Analysis
+
+Visualization on the differences of SMRs and TMRs. To further analyze the effect of CoupleFace, we visualize the distributions of the differences between SMRs and TMRs for both FCD and CoupleFace in Fig. 4. Specifically, we use the models of MBNet in the 20,000th, 60,000th, 100,000th iterations for both
+
+Table 4. Results on IJB-B and IJB-C of different methods.
+
+| Methods | IJB-B | IJB-C |
| 1e-4 | 1e-5 | 1e-4 | 1e-5 |
| CoupleFace | 91.18 | 84.63 | 93.18 | 89.57 |
| CoupleFace-MBN | 91.06 | 83.91 | 92.95 | 88.94 |
| CoupleFace-RN100 | 91.15 | 84.65 | 93.16 | 89.58 |
+
+
+
+
+
+
+
+
+Fig. 4. The distributions of differences between the SMRs and TMRs of different iterations for FCD and CoupleFace.
+
+
+
+
+
+FCD and CoupleFace. The first and the second rows show the results of FCD and CoupleFace, respectively. In Fig. 4, during training, for CoupleFace, we observe that the differences of SMRs and TMRs gradually decrease at the right side of the red line, which demonstrates the effect of minimizing the RAD loss of Eq. (6). Besides, when compared with FCD, most SMRs are less than or approximate to TMRs in CoupleFace, which indicates that CoupleFace transfers the mutual relation knowledge of the teacher model to the student model well.
+
+Visualization on the distributions of similarity scores. We visualize the distributions of similarity scores on IJB-C of MBNet based on different methods in Fig. 5. Specifically, we still use the R-50 as $\mathcal{T}$ to distill MBNet in FCD and CoupleFace. As shown in Fig. 5, when compared with FCD, the similarity distributions of positive pairs and negative pairs in CoupleFace are more compact and separable, which further shows the effectiveness of CoupleFace.
+
+Comparison with existing relation-based knowledge distillation methods (RB-KDs). The differences between CoupleFace and existing RB-KDs (e.g., CCKD, RKD [33,32]) are as follows. (1) General KDs are usually incompatible with FR. Existing RB-KDs are proposed for general vision tasks (e.g., close-set classification). In contrast, it is non-trivial to transfer relation knowledge for open-set FR well and CoupleFace is well-designed for FR distillation.
+
+
+Fig. 5. Cosine similarity distributions of the positive pairs and negative pairs.
+
+
+
+(2) Mining is considered. We observe that most mutual relations cannot provide valuable knowledge and affect the similarity distribution for FR, so how to produce sufficient informative mutual relations efficiently is a challenging issue. In CoupleFace, we propose to mine informative mutual relations in MRD, while existing RB-KDs have not discussed the mining process. (3) Loss function is intrinsically different. The RAD loss in Eq. (6) aims to better exploit the mutual relation knowledge by using valid mutual relations and filtering out the mutual relations with subtle differences, which are not discussed in existing works. (4) Better performance. CoupleFace outperforms existing RB-KDs a lot.
+
+Computation costs. When compared with FCD, training time and GPU memory use of CoupleFace are 1.056 times and 1.002 times, respectively. which further demonstrates the efficiency of our proposed CoupleFace.
+
+# 5 Conclusion
+
+In our work, we investigate the importance of mutual relation knowledge for FR distillation and propose an effective FR distillation method named as CoupleFace. When compared with existing methods using Feature Consistency Distillation (FCD), CoupleFace further introduces the Mutual Relation Distillation (MRD), where we propose to mine the informative mutual relations and utilize the Relation-Aware Distillation (RAD) loss to transfer the mutual relation knowledge from the teacher model to the student model. Extensive experiments on multiple FR benchmark datasets demonstrate the effectiveness of CoupleFace. In our future work, we will continue to explore what kind of information is important for FR distillation and develop more effective distillation methods.
+
+# 6 Acknowledgments
+
+This research was supported by National Natural Science Foundation of China under Grant 61932002.
+
+# References
+
+1. An, X., Zhu, X., Gao, Y., Xiao, Y., Zhao, Y., Feng, Z., Wu, L., Qin, B., Zhang, M., Zhang, D., Fu, Y.: Partial fc: Training 10 million identities on a single machine. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops. pp. 1445-1449 (October 2021)
+2. David, S., Sergey, A.: Margindistillation: Distillation for face recognition neural networks with margin-based softmax. International Journal of Computer and Information Engineering 15(3), 206-210 (2021)
+3. Deng, J., Guo, J., Liu, T., Gong, M., Zafeiriou, S.: Sub-center arcface: Boosting face recognition by large-scale noisy web faces. In: Proceedings of the IEEE Conference on European Conference on Computer Vision (2020)
+4. Deng, J., Guo, J., Xue, N., Zafeiriou, S.: Arcface: Additive angular margin loss for deep face recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4690-4699 (2019)
+5. Deng, J., Guo, J., Yang, J., Lattas, A., Zafeiriou, S.: Variational prototype learning for deep face recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 11906-11915 (June 2021)
+6. Fang, Z., Wang, J., Wang, L., Zhang, L., Yang, Y., Liu, Z.: {SEED}: Self-supervised distillation for visual representation. In: International Conference on Learning Representations (2021)
+7. Feng, Y., Wang, H., Hu, H.R., Yu, L., Wang, W., Wang, S.: Triplet distillation for deep face recognition. In: 2020 IEEE International Conference on Image Processing (ICIP). pp. 808-812. IEEE (2020)
+8. Gentile, C., Warmuth, M.K.: Linear hinge loss and average margin. Advances in neural information processing systems 11, 225-231 (1998)
+9. Guo, J., Liu, J., Xu, D.: Jointpruning: Pruning networks along multiple dimensions for efficient point cloud processing. IEEE Transactions on Circuits and Systems for Video Technology 32(6), 3659-3672 (2021)
+0. Guo, J., Ouyang, W., Xu, D.: Multi-dimensional pruning: A unified framework for model compression. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1508-1517 (2020)
+1. Harwood, B., Kumar BG, V., Carneiro, G., Reid, I., Drummond, T.: Smart mining for deep metric learning. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 2821-2829 (2017)
+2. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+3. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+4. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015)
+5. Huang, Y., Shen, P., Tai, Y., Li, S., Liu, X., Li, J., Huang, F., Ji, R.: Improving face recognition from hard samples via distribution distillation loss. In: European Conference on Computer Vision. pp. 138-154. Springer (2020)
+6. Huang, Y., Wang, Y., Tai, Y., Liu, X., Shen, P., Li, S., Li, J., Huang, F.: Curricularface: adaptive curriculum learning loss for deep face recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5901-5910 (2020)
+
+17. Huang, Y., Wu, J., Xu, X., Ding, S.: Evaluation-oriented knowledge distillation for deep face recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 18740-18749 (June 2022)
+18. InsightFace: Glint-mini face recognition dataset. [online]. https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_(2021)
+19. Kemelmacher-Shlizerman, I., Seitz, S.M., Miller, D., Brossard, E.: The megaface benchmark: 1 million faces for recognition at scale. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4873-4882 (2016)
+20. Kim, Y., Park, W., Shin, J.: Broadface: Looking at tens of thousands of people at once for face recognition. ECCV (2020)
+21. Li, Z., Wu, Y., Chen, K., Wu, Y., Zhou, S., Liu, J., Yan, J.: Learning to auto weight: Entirely data-driven and highly efficient weighting framework. In: Proceedings of the AAAI Conference on Artificial Intelligence. pp. 4788-4795 (2020)
+22. Liu, J., Guo, J., Xu, D.: Apsnet: Towards adaptive point sampling for efficient 3d action recognition. IEEE Transactions on Image Processing (2022)
+23. Liu, J., Qin, H., Wu, Y., Liang, D.: Anchorface: Boosting tar@far for practical face recognition. In: Proceedings of the AAAI Conference on Artificial Intelligence (2022)
+24. Liu, J., Wu, Y., Wu, Y., Li, C., Hu, X., Liang, D., Wang, M.: Discrepancy alignment metric for face recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 3814-3823 (2021)
+25. Liu, J., Yu, T., Peng, H., Sun, M., Li, P.: Cross-lingual cross-modal consolidation for effective multilingual video corpus moment retrieval. In: NAACL-HLT (2022)
+26. Liu, J., Yu, Z., Qin, H., Wu, Y., Liang, D., Zhao, G., Xu, K.: Oneface: One threshold for all. In: Proceedings of the European Conference on Computer Vision (ECCV) (2022)
+27. Liu, J., Zhou, S., Wu, Y., Chen, K., Ouyang, W., Xu, D.: Block proposal neural architecture search. IEEE Transactions on Image Processing 30, 15-25 (2020)
+28. Liu, W., Wen, Y., Yu, Z., Li, M., Raj, B., Song, L.: Spherface: Deep hypersphere embedding for face recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 212-220 (2017)
+29. Liu, W., Wen, Y., Yu, Z., Yang, M.: Large-margin softmax loss for convolutional neural networks. In: ICML. vol. 2, p. 7 (2016)
+30. Maze, B., Adams, J., Duncan, J.A., Kalka, N., Miller, T., Otto, C., Jain, A.K., Niggel, W.T., Anderson, J., Cheney, J., et al.: Iarpa janus benchmark-c: Face dataset and protocol. In: 2018 International Conference on Biometrics (ICB). pp. 158-165. IEEE (2018)
+31. Meng, Q., Zhao, S., Huang, Z., Zhou, F.: Magface: A universal representation for face recognition and quality assessment. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 14225-14234 (2021)
+32. Park, W., Kim, D., Lu, Y., Cho, M.: Relational knowledge distillation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3967-3976 (2019)
+33. Peng, B., Jin, X., Liu, J., Li, D., Wu, Y., Liu, Y., Zhou, S., Zhang, Z.: Correlation congruence for knowledge distillation. In: ICCV (October 2019)
+34. Romero, A., Ballas, N., Kahou, S.E., Chassang, A., Gatta, C., Bengio, Y.: Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550 (2014)
+35. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.C.: Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4510-4520 (2018)
+
+36. Schroff, F., Kalenichenko, D., Philbin, J.: Facenet: A unified embedding for face recognition and clustering. In: CVPR. pp. 815-823 (2015)
+37. Shi, W., Ren, G., Chen, Y., Yan, S.: Proxylesskd: Direct knowledge distillation with inherited classifier for face recognition. arXiv preprint arXiv:2011.00265 (2020)
+38. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+39. Suh, Y., Han, B., Kim, W., Lee, K.M.: Stochastic class-based hard example mining for deep metric learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7251-7259 (2019)
+40. Sun, Y., Chen, Y., Wang, X., Tang, X.: Deep learning face representation by joint identification-verification. In: Advances in neural information processing systems. pp. 1988-1996 (2014)
+41. Sun, Y., Cheng, C., Zhang, Y., Zhang, C., Zheng, L., Wang, Z., Wei, Y.: Circle loss: A unified perspective of pair similarity optimization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6398-6407 (2020)
+42. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., Rabinovich, A.: Going deeper with convolutions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (June 2015)
+43. Taigman, Y., Yang, M., Ranzato, M., Wolf, L.: Deepface: Closing the gap to human-level performance in face verification. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1701-1708 (2014)
+44. Tian, Y., Krishnan, D., Isola, P.: Contrastive representation distillation. In: ICLR (2020)
+45. Tung, F., Mori, G.: Similarity-preserving knowledge distillation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (October 2019)
+46. Wang, F., Cheng, J., Liu, W., Liu, H.: Additive margin softmax for face verification. IEEE Signal Processing Letters 25(7), 926-930 (2018)
+47. Wang, F., Xiang, X., Cheng, J., Yuille, A.L.: Normface: L2 hypersphere embedding for face verification. In: Proceedings of the 25th ACM international conference on Multimedia. pp. 1041-1049 (2017)
+48. Wang, H., Wang, Y., Zhou, Z., Ji, X., Gong, D., Zhou, J., Li, Z., Liu, W.: Cosface: Large margin cosine loss for deep face recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 5265-5274 (2018)
+49. Wang, X., Fu, T., Liao, S., Wang, S., Lei, Z., Mei, T.: Exclusivity-consistency regularized knowledge distillation for face recognition. In: ECCV. pp. 325-342. Springer (2020)
+50. Wang, X., Zhang, S., Wang, S., Fu, T., Shi, H., Mei, T.: Mis-classified vector guided softmax loss for face recognition. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 12241-12248 (2020)
+51. Whitelam, C., Taborsky, E., Blanton, A., Maze, B., Adams, J., Miller, T., Kalka, N., Jain, A.K., Duncan, J.A., Allen, K., et al.: Iarpa janus benchmark-b face dataset. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops. pp. 90-98 (2017)
+52. Wolf, L., Hassner, T., Maoz, I.: Face recognition in unconstrained videos with matched background similarity. IEEE (2011)
+53. Wu, C.Y., Manmatha, R., Smola, A.J., Krahenbuhl, P.: Sampling matters in deep embedding learning. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 2840-2848 (2017)
+
+54. Yang, C., An, Z., Cai, L., Xu, Y.: Hierarchical self-supervised augmented knowledge distillation. In: Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence. pp. 1217-1223 (2021)
+55. Yang, C., An, Z., Cai, L., Xu, Y.: Knowledge distillation using hierarchical self-supervision augmented distribution. IEEE Transactions on Neural Networks and Learning Systems (2022)
+56. Yang, C., Zhou, H., An, Z., Jiang, X., Xu, Y., Zhang, Q.: Cross-image relational knowledge distillation for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12319-12328 (2022)
+57. Yi, D., Lei, Z., Liao, S., Li, S.Z.: Learning face representation from scratch. arXiv preprint arXiv:1411.7923 (2014)
+58. Zhang, X., Fang, Z., Wen, Y., Li, Z., Qiao, Y.: Range loss for deep face recognition with long-tailed training data. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 5409-5418 (2017)
+59. Zhu, Z., Huang, G., Deng, J., Ye, Y., Huang, J., Chen, X., Zhu, J., Yang, T., Lu, J., Du, D., Zhou, J.: Webface260m: A benchmark unveiling the power of million-scale deep face recognition. In: CVPR. pp. 10492-10502 (June 2021)
\ No newline at end of file
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/images.zip b/couplefacerelationmattersforfacerecognitiondistillation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e56023a4f94a805f1778326237f5cbcc5c58ee28
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6800f1e77556bb6bdf4d12fa46cde9b296560bc264a10ea4d84c9e317a1b09bf
+size 365278
diff --git a/couplefacerelationmattersforfacerecognitiondistillation/layout.json b/couplefacerelationmattersforfacerecognitiondistillation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5da3519325f836cdc5b203e6acff001feb258579
--- /dev/null
+++ b/couplefacerelationmattersforfacerecognitiondistillation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f50e8fefaca2d2bbe4c9e414aaf0124305b0441609c69476a665f20d13de8834
+size 567343
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_content_list.json b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1c2346db10742aafed4447b4d2cc86e0f34f29ff
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:341f5b63ddefc21c64ac6fbbf8efcbc48eed97c9f3f580e71ccf3b736484dc0b
+size 79896
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_model.json b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c1ce0f835b365f96c9f83d30e78c84587a5445d
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:457ab000fe9f48f6f6f8a586b974c213e2d9bbdbf2146746530320b69770eb6c
+size 100095
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_origin.pdf b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d83107d13ccd46f293bef9b3de204df1521085ce
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/3f9c4f24-8987-4473-b38f-20fb23b4fca5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:17f539db42e07cef6ad88c70c4e1576d087a845570ce46e65021b5cd1c2f842d
+size 4551712
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/full.md b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..55896f88bb3a2707d6ff32a848cfab9d79fbb5d6
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/full.md
@@ -0,0 +1,300 @@
+# CramNet: Camera-Radar Fusion with Ray-Constrained Cross-Attention for Robust 3D Object Detection
+
+Jyh-Jing Hwang, Henrik Kretzschmar, Joshua Manela, Sean Rafferty, Nicholas Armstrong-Crews, Tiffany Chen, Dragomir Anguelov
+
+Waymo
+
+Abstract. Robust 3D object detection is critical for safe autonomous driving. Camera and radar sensors are synergistic as they capture complementary information and work well under different environmental conditions. Fusing camera and radar data is challenging, however, as each of the sensors lacks information along a perpendicular axis, that is, depth is unknown to camera and elevation is unknown to radar. We propose the camera-radar matching network CramNet, an efficient approach to fuse the sensor readings from camera and radar in a joint 3D space. To leverage radar range measurements for better camera depth predictions, we propose a novel ray-constrained cross-attention mechanism that resolves the ambiguity in the geometric correspondences between camera features and radar features. Our method supports training with sensor modality dropout, which leads to robust 3D object detection, even when a camera or radar sensor suddenly malfunctions on a vehicle. We demonstrate the effectiveness of our fusion approach through extensive experiments on the RADIATE dataset, one of the few large-scale datasets that provide radar radio frequency imagery. A camera-only variant of our method achieves competitive performance in monocular 3D object detection on the Waymo Open Dataset.
+
+Keywords: Sensor fusion; cross attention; robust 3D object detection.
+
+# 1 Introduction
+
+3D object detection that is robust to different weather conditions and sensor failures is critical for safe autonomous driving. Fusion between camera and radar sensors stands out as they are both relatively resistant to various weather conditions [2] compared to the popular lidar sensor [3]. A fusion design that naturally accepts single-sensor failures (lidar, radar, or camera or radar) is thus desired and boosts safety in an autonomous driving system (Figure 1).
+
+Most sensor fusion research has focused on fusion between lidar and another sensor [32, 54, 7, 11, 50, 51, 19, 11, 31, 57, 39] because lidar provides complete geometric information, i.e., azimuth, range, and elevation. Sparse correspondences
+
+
+Fig. 1: Our approach takes as input a camera image (top left) and a radar RF image (bottom left). The model then predicts foreground segmentation for both native 2D representations before projecting the foreground points with features into a joint 3D space (middle bottom) for sensor fusion. Finally, the method runs sparse convolutions in the joint space for 3D object detection. The network architecture naturally supports training with sensor dropout. This allows the resulting model to cope with sensor failures at inference time as it can run on camera only and radar only input depending on which sensors are available.
+
+
+
+between lidar and another sensor is thus well defined, making lidar an ideal carrier for fusion. On the other hand, even though camera and radar sensors are lighter and cheaper, consume less power, and endure longer than lidar, camera-radar fusion is understudied. Camera-radar fusion is especially challenging as each sensor lacks information along one perpendicular axis: depth unknown for camera and elevation unknown for emerging imaging radar, as summarized in Table 1. Radar produces radio frequency (RF) imagery that encodes the environment approximately in the bird's-eye view (BEV) with various noise patterns, an example shown in Figure 1. As a result, camera data (in perspective view) and radar data (in BEV) form many-to-many mappings and the exact matching is unclear from geometry alone.
+
+To solve the matching problem, we consider three possible schemes for fusion: (1) Perspective view primary [32]: This scheme implies we trust the depth reasoning from the perspective view. One can project camera pixels to their 3D locations with depth estimates and find their vertical nearest neighbors of corresponding radar points. If depth is unknown, one can project a pixel along a ray in 3D and perform matching. (2) Bird's-eye view primary [50]: This scheme implies we trust the elevation reasoning from the bird's-eye view. However, since it's difficult to predict elevation from radar imagery directly, one might borrow elevation information from the map. Hence, the inferred elevation for radar is sometimes inaccurate, resulting in rare usage unless LiDAR is available. (3) Cross-view matching [13]: This scheme implies we perform matching in a joint 3D space. For example, one can use supplementary information (map or camera depth estimation) to upgrade camera and radar 2D image pixels to 3D point clouds (with some uncertainty) and perform matching between point clouds
+
+| Sensor | Azimuth | Range | Elevation | Resistance to weather | 3D detection literature |
| Camera | ✓ | x | ✓ | medium | abundant |
| Radar | ✓ | ✓ | x* | high | scarce |
| Lidar | ✓ | ✓ | ✓ | low | abundant |
+
+Table 1: Characteristics of major sensors commonly used for autonomous driving. Both camera and radar tend to be less affected by inclement weather compared to lidar scanners. However, whereas regular camera does not directly measure range, radar does not measure elevation. This poses a unique challenge for fusing camera and radar readings as the geometric correspondences between the two sensors are underconstrained. Overall, camera-radar fusion is still underexplored in the literature. *Although there exists radars with elevation, this paper focuses on planar radar which, at the moment, is more common for automotive radar.
+
+directly. This is supposedly the most powerful scheme if we can properly handle uncertainties. Our architecture is designed to enable this matching scheme, hence we name it CramNet (Camera and RAdar Matching Network).
+
+Since the effectiveness of projecting into 3D space heavily relies on accurate camera depth estimates, we propose a ray-constrained cross-attention mechanism to leverage radar for better depth estimation. The idea is to match radar responses along each camera ray emitted from a pixel. The correct projection should be the locations where radar senses reflections. Our architecture is further designed to accept sensor failures naturally. As shown in Figure 1, the model is able to operate even when one of the modalities is corrupted during inference. To this end, we incorporate sensor dropout [7, 52] in the point cloud fusion stage during training to boost the sensor robustness.
+
+We summarize the contributions of this paper as follows:
+
+1. We present a camera-radar fusion architecture for 3D object detection that is flexible enough to fall back to a single sensor modality in the event of a sensor failure.
+2. We demonstrate that the sensor fusion model effectively leverages data from both sensors as the model outperforms both the camera-only and the radar-only variants significantly.
+3. We propose a ray-constrained cross-attention mechanism that leverages the range measurements from radar to improve camera depth estimates, leading to improved detection performance.
+4. We incorporate sensor dropout during training to further improve the accuracy and the robustness of camera-radar 3D object detection.
+5. We demonstrate state-of-the-art radar-only and camera-radar detection performance on the RADIATE dataset [40] and competitive camera-only detection performance on the Waymo Open Dataset [47].
+
+# 2 Related Work
+
+Camera-based 3D object detection. Monocular camera 3D object detection is first approached by directly extending 2D detection architectures and
+
+incorporating geometric relationships between the 2D perspective view and 3D space [6, 27, 4, 43, 23, 23, 44, 8, 16]. Utilizing pixel-wise depth maps as an additional input shows improved results, either for lifting detected boxes [26, 42] or projecting image pixels into 3D point clouds [53, 24, 58, 9, 55] (also known as Pseudo-LiDAR [53]). More recently, another camp of methods emerge to be promising, i.e., projecting intermediate features into BEV grid features along the projection ray without explicitly forming 3D point clouds [36, 46, 34, 18].
+
+The BEV grid methods benefit from naturally expressing the 3D projection uncertainty along the depth dimension. However, these methods suffer from significantly increased compute requirements as the detection range expands. In contrast, we model the depth uncertainty through sampling along the projection ray and consulting radar features for more accurate range signals. This also enables the adoption of foreground extraction that allows a balanced trade-off between detection range and computation.
+
+Radar-based 3D object detection. Frequency modulated continuous wave (FMCW) radar is usually presented by two kinds of data representations, i.e., radio frequency (RF) images and radar points. The RF images are generated from the raw radar signals using a series of fast Fourier transforms that encode a wide variety of sensing context whereas the radar points are derived from these RF images through a peak detection algorithm, such as Constant False Alarm Rate (CFAR) algorithm [35]. The downside of the radar points is that recall is imperfect and the contextual information of radar returns is lost, with only the range, azimuth and doppler information retained. As a result, radar points are not suitable for effective single modality object detection [38, 33], which is why most works use this data format only to foster fusion [2, 13, 29, 28]. On the other hand, the RF images maintain rich environmental context information and even complete object motion information to enable a deep learning model to understand the semantic meaning of a scene [25, 40]. Our work is therefore built upon radar RF images and can produce reasonable 3D object detection predictions with radar-only inputs.
+
+Sensor fusion for 3D object detection. Sensor fusion for 3D object detection has been studied extensively using lidar and camera. The reasons are twofold: 1) Lidar scans provide comprehensive representations in 3D for inferring correspondences between sensors, and 2) camera images contain more semantic information to further boost the recognition ability. Various directions have been explored, such as image detection in 2D before projecting into frustums [32, 54], two-stage frameworks with object-centric modality fusion [7, 11, 17], image feature-based lidar point decoration [50, 51], or multi-level fusion [19, 11, 31]. Since sparse correspondences between camera and lidar are well defined, fusion is mostly focused on integrating information rather than matching points from different sensors.
+
+As a result, these fusion techniques are not directly applicable to camera-radar fusion where associations are underconstrained. Early work, Lim et al. [20], applies feature fusion directly between camera and radar features without any geometric considerations. Recently, more works tend to leverage camera models and geometry for association. For example, CenterFusion [28] creates camera
+
+
+Fig. 2: Architecture overview. Our method can be partitioned into three stages: (1a) camera 2D foreground segmentation and depth estimation, (1b) radar 2D foreground segmentation, (2) projection from 2D to 3D and subsequent point cloud fusion, and (3) 3D foreground point cloud object detection. The cross-attention mechanism modifies the camera depth estimation by consulting radar features, as further illustrated in Figure 3. The modality coding module appends a camera or radar binary code to the features that are fed into the 3D stage, enabling sensor dropout and enhancing robustness. We depict the camera stream in blue, the radar stream in green, and the fused stream in red.
+
+object proposal frustums to associate radar features and GRIF Net [13] projects 3D RoI to camera perspective and radar BEV to associate features. Our model, on the other hand, fuses camera-radar data in a joint 3D space with the flexibility to perform 3D detection with either single modality, leading to increased robustness.
+
+# 3CramNet for Robust 3D Object Detection
+
+We describe the overall architecture for camera-radar fusion in Section 3.1. In Section 3.2, We then introduce a ray-constrained cross-attention mechanism to leverage radar for better camera 3D point localization. Finally, we propose sensor dropout that can be integrated seamlessly into the architecture in Section 3.3 to further improve the robustness of 3D object detection.
+
+# 3.1 Overall Architecture
+
+Our model architecture, in Figure 2, is inspired by Range Sparse Net (RSN) [48], which is an efficient two-stage lidar-based object detection framework. The RSN framework takes input of perspective range images, segments perspective foreground pixels, extracts 3D (BEV) features on foreground regions using sparse convolution [56], and performs CenterNet-style [60] detection. We adapt the framework for camera-radar fusion and the overall architecture can be partitioned
+
+into three stages: (1) 2D foreground segmentation, (2) 2D to 3D projection and point cloud fusion, and (3) 3D foreground point cloud detection.
+
+Stage 1: 2D foreground segmentation. The goal of this stage is to perform efficient foreground segmentation for native dense representations from two modalities. This allows us to restrict the expensive 3D operations to foreground points. The network takes as input a pair of camera images $\mathbf{I}_C$ and radar RF images $\mathbf{I}_R$ . We then employ two identical lightweight U-Nets [37] to extract 2D features and predict foreground segmentation masks for each modality, $\mathbf{F}_C$ and $\mathbf{F}_R$ , respectively. For camera image feature extraction, one can also adopt a more powerful, multi-scale feature extractor, such as a feature pyramid network [21]. The detailed design of the U-Net can be found in the supplementary.
+
+To train such a segmentation network (for both camera and radar), we use the 2D projection of 3D bounding box labels as ground truth - a pixel belongs to the foreground class if it falls inside any of the projected 2D boxes. This might introduce some noise as background pixels sometimes fall within a box, but we find that this noise is insignificant in practice. We then apply a pixel-wise focal loss [22] to classify each pixel:
+
+$$
+L _ {\text {s e g}} = \frac {- 1}{N} \left(\sum_ {i \in \boldsymbol {F}} \left(1 - p _ {i}\right) ^ {\gamma_ {s}} \log \left(p _ {i}\right) + \sum_ {i \in \boldsymbol {B}} p _ {i} ^ {\gamma_ {s}} \log \left(1 - p _ {i}\right)\right), \tag {1}
+$$
+
+where $N$ is the total number of pixels, $\mathbf{F}$ and $\mathbf{B}$ are the sets of foreground and background pixels, and $p_i$ is the model's estimated probability of foreground for pixel $i$ . The hyperparameter $\gamma_s$ controls the penalty reduction. A pixel with foreground score higher than $\tau$ will be selected. Since the 3D stage can resolve false positives, whereas false negatives cannot be recovered, we typically set a low value for $\tau$ to attain high recall.
+
+Stage 2: 2D to 3D projection and point cloud fusion. Once we obtain the foreground pixels, we project them into 3D for the following 3D stage. For the camera projection, we predict a depth value for each pixel from the same U-Net with additional convolutional layers. The depth ground truth is obtained by projecting lidar points to the camera view and overlaying them with depth values from projected ground truth 3D boxes. The use of depth from ground truth boxes is to enable 3D detection where lidar data alone is insufficient. This is especially true outside of lidar range, as well as when lidar points are deteriorated due to weather. We train the depth estimation using pixelwise L2 losses on valid regions, or $L_{\mathrm{depth}}$ . The camera projection relies on the camera model, i.e., the intrinsics and extrinsics, with depth to infer the 3D location of each pixel.
+
+For radar projection, we use the radar model to transform radar BEV points to 3D using the sensor height as elevation. If map is available, the road elevation can be used to offset this value to handle non-planar scenes like hills.
+
+There are several options to combine the camera and radar 3D point clouds. One plausible choice is to select one modality as a major sensor and gather features from the other modality. This is usually how researchers fuse lidar with other sensors [50]. However, the drawback is obvious: the major sensor is a single point of failure. Instead, we directly place two point clouds in a joint 3D
+
+space. We align the feature dimensions of both modalities and append a modality code to the feature so that the 3D network can leverage the multi-modality information easily. The major benefit is to enable robust detection especially when one modality fails to perform.
+
+Stage 3: 3D foreground point cloud detection. We apply dynamic voxelization [61] on the fused foreground point cloud, whose features are then encoded into sparse voxel features. A 2D or 3D sparse convolution network [10] (for pillar style [15], or 3D voxelization, respectively) is applied on the sparse voxels. The network details can be found in the supplementary.
+
+We follow RSN [48] for CenterNet-style [60] 3D box regression. We calculate a ground truth objectness heatmap for every point $x \in \mathbb{R}^3$ : $h(x) = \max \{\exp(-\frac{||x - c|| - ||x_c - c||}{\sigma^2}) \mid c \in C(x)\}$ where $C(x)$ is the set of centers of boxes containing $x$ , $x_c$ is the closest point to box center $c$ , and $\sigma$ is a constant. In other words, the objectness of a point is inversely related to its distance to the closest box center. We train the network to predict a heatmap using a focal loss [22]:
+
+$$
+\begin{array}{l} L _ {\mathrm {h m}} = \frac {- 1}{N} \sum_ {x} \left(\left(1 - \tilde {h} (x)\right) ^ {\gamma_ {h}} \log \left(\tilde {h} (x)\right) \mathbb {1} (h > 1 - \epsilon_ {h}) + \right. \\ \left. \left(1 - h (x)\right) _ {h} ^ {\alpha} \tilde {h} (x) ^ {\gamma_ {h}} \log \left(1 - \tilde {h} (x)\right) \mathbb {1} \left(h \leq 1 - \epsilon_ {h}\right)\right), \tag {2} \\ \end{array}
+$$
+
+where $\mathbb{1}(\cdot)$ is the indicator function, $h$ and $\tilde{h}$ are the ground truth and predicted heat map, $(1 - \epsilon_h)$ decides the threshold for ground truth objectness, and $\alpha_{h}$ and $\gamma_{h}$ are hyperparameters in the focal loss.
+
+The 3D boxes are parameterized as $\pmb{b} = (b_{x}, b_{y}, b_{z}, l, w, h, \theta)$ where $b_{x}, b_{y}, b_{z}$ are the offsets of a 3D box center relative to a voxel center, and $l, w, h, \theta$ are the length, width, height, and heading of a box. All the box parameters are trained with smooth L1 losses except for the heading that is trained with a bin loss [41]. An additional IoU loss [59] is employed for better accuracy. The box regression loss is as follows:
+
+$$
+L _ {\text {b o x}} = \frac {1}{B} \sum_ {i} \left(L _ {\text {S m o o t h L 1}} \left(\boldsymbol {b} _ {i} \backslash \theta_ {i} - \tilde {\boldsymbol {b}} _ {i} \backslash \tilde {\theta} _ {i}\right) + L _ {\text {b i n}} \left(\theta_ {i}, \tilde {\theta} _ {i}\right) + L _ {\text {I o U} i}\right), \tag {3}
+$$
+
+where $B$ is the total number of boxes with ground truth heatmap value greater than a threshold $\tau_{\mathrm{hm}}$ , and $\pmb{b}_i$ and $\tilde{\pmb{b}}_i$ denote the ground truth and prediction for box $\pmb{b}_i$ , respectively; the same for $\theta_i$ . For more details on heatmap and box regression, we refer interested readers to RSN [48].
+
+We train the fusion network end-to-end with losses summarized as:
+
+$$
+L = \lambda_ {\text {s e g}} L _ {\text {s e g}} + \lambda_ {\text {d e p t h}} L _ {\text {d e p t h}} + \lambda_ {\text {h m}} L _ {\text {h m}} + L _ {\text {b o x}}, \tag {4}
+$$
+
+where $\lambda_{*}$ are hyperparameters for the respective loss weighting.
+
+# 3.2 Ray-Constrained Cross-Attention
+
+It is widely known [30, 53] that camera-based 3D object detection relies heavily on accurate depth estimation, either explicitly or implicitly through BEV
+
+
+Fig. 3: The proposed ray-constrained cross-attention mechanism resolves the ambiguity in the geometric correspondences between camera features and radar features. Following the Transformer [49], we take camera features as queries and radar features as keys to transform 3D camera points as values.
+
+
+
+representations. Luckily, for camera-radar fusion, we don't have to rely solely on camera to infer depth as radar provides relatively accurate range estimates. To utilize the complementary sensing directions, we propose a ray-constrained cross attention mechanism to leverage radar for improving camera 3D point localization, illustrated in Figure 3.
+
+Our observation is that an optimal 3D location for each foreground camera pixel usually accompanies a corresponding peak response from radar. Thus we propose to consult radar features along a camera 3D ray, emitted from each pixel, to rectify the camera 3D point location after projection. Since there is infinite possible locations, we perform sampling along the ray, centered at the initial depth estimation. The final 3D location is decided by matching between camera and radar features among these sampled locations.
+
+We denote the projected camera 3D location from a depth estimate $\tilde{d}_i$ for pixel $i$ as $M(\tilde{d}_i)$ . We sample $s$ points farther and closer around the estimated location respectively, or $M(\tilde{d}_i \pm \epsilon \times k)$ , where $\epsilon$ is a hyperparameter for depth error, and $k$ ranges from 1 to $s$ . We denote this set of 3D locations as $\tilde{M}_i \in \mathbb{R}^{(2s + 1) \times 3}$ . We gather closest radar features for every sampled location, denoted as $\pmb{\psi}_{Ri} \in \mathbb{R}^{(2s + 1) \times d}$ . Likewise, we denote the camera feature for a pixel $i$ as $\pmb{\psi}_{Ci} \in \mathbb{R}^{1 \times d}$ . The final camera 3D point location $M_i \in \mathbb{R}^{1 \times 3}$ for pixel $i$ can thus be obtained using a cross-attention formulation [49]:
+
+$$
+M _ {i} = \operatorname {s o f t m a x} \left(\frac {\boldsymbol {\psi} _ {C i} \boldsymbol {\psi} _ {R i} ^ {T}}{\sqrt {d}}\right) \tilde {\boldsymbol {M}} _ {i}. \tag {5}
+$$
+
+To relate to the naming convention in attention [49], we use the camera feature $\pmb{\psi}_{Ci}$ as a query, a set of radar features $\pmb{\psi}_{Ri}$ as keys, and the sampled 3D locations $\tilde{M}_i$ as values. Therefore, the final location is calculated by matching the query with the most active keys, associated with the respective values.
+
+Notably, this design is computationally efficient. The time complexity is asymptotically proportional to $(N \times d \times s)$ , where $N$ is the number of (foreground) pixels. Since $s$ is a small constant, this operation is as cheap as a conv layer.
+
+# 3.3 Sensor Dropout
+
+One appealing property of this architecture is the independence of each sensor. We can perform camera-only or radar-only 3D object detection with the same architecture when one modality is unavailable. This is desired in practice as one never knows when a sensor might be unavailable due to various situations, e.g., occlusions, weather, or sensor failure.
+
+To enhance the model ability to handle sensor failures, we incorporate a sensor dropout mechanism [7, 52] during training. With a probability $P_{\mathrm{drop}}$ , we randomly drop out the entire set of point features of camera $\pmb{\psi}_C$ or radar $\pmb{\psi}_R$ , or
+
+$$
+\boldsymbol {X} _ {C} = \mathbb {1} (r _ {1} \geq P _ {\mathrm {d r o p}}) \boldsymbol {X} _ {C} + \mathbb {1} (r _ {1} < P _ {\mathrm {d r o p}} \wedge r _ {2} \geq 0. 5) \boldsymbol {0}
+$$
+
+$$
+\boldsymbol {X} _ {R} = \mathbb {1} \left(r _ {1} \geq P _ {\text {d r o p}}\right) \boldsymbol {X} _ {R} + \mathbb {1} \left(r _ {1} < P _ {\text {d r o p}} \wedge r _ {2} < 0. 5\right) \boldsymbol {0} \tag {6}
+$$
+
+where $\mathbf{0}$ is a zero matrix and $r_1$ and $r_2$ are uniform random numbers in $[0, 1]$ . Note that camera and radar features won't be dropped out at the same time. We use $p_{\mathrm{drop}} = 0.2$ in our experiments.
+
+The reason why we choose to mask out 3D point features instead of input data directly is that we can still train the cross-attention with proper 2D features normally. If radar sensor is corrupted during inference and produces noisy 2D features, it results in a uniform attention map inside cross-attention and little effect on 3D camera point locations.
+
+# 4 Experiments
+
+We present experiments on the RADIATE [40] and Waymo Open [47] datasets to verify the efficacy of our proposed CramNet model. We introduce the settings in Section 4.1 and 4.2. We include the main results, ablation studies, robustness tests, and visualization on the RADIATE dataset in Section 4.3, 4.4, 4.5, and 4.7, respectively. We also present our camera-only results on the Waymo Open dataset in Section 4.6. More ablation studies can be found in the supplementary.
+
+# 4.1 Dataset and Evaluation
+
+RADIATE dataset. We evaluate our method on the challenging RADIATE dataset [40]. This dataset features radar sensor data collected for scene understanding for safe autonomous driving in various weather conditions, including sunny, night, rainy, foggy, and snowy. The dataset includes 3 hours of annotated radar imagery with more than $200\mathrm{k}$ labeled objects for 8 categories. These properties make the RADIATE dataset one of the few public datasets that contain high-resolution radar data along with a large number of ground truth labels for road actors. While the dataset provides high-quality radar data, the quality of its camera and LiDAR data is not comparable to that of other autonomous driving datasets, such as the Waymo Open Dataset [47]. This shortcoming, however, makes the evaluation of the robustness of our proposed sensor fusion algorithm even more compelling. In all of our experiments, we train the models on the
+
+| Method | Overall | Sunny (Parked) | Overcast (Motorway) | Sun/OC (Urban) | Night (Motorway) | Rain (Suburban) | Fog (Suburban) | Snow (Surburban) |
| Baseline [40] | 46.55 | 79.72 | 44.23 | 35.45 | 64.29 | 31.96 | 51.22 | 8.14 |
| CramNet-C* | 23.66 | 67.98 | 6.50 | 23.43 | 2.24 | 17.69 | 9.50 | 0.12 |
| CramNet-R | 56.19 | 83.58 | 37.65 | 48.33 | 60.38 | 42.86 | 71.11 | 15.84 |
| CramNet | 62.07 | 96.68 | 50.49 | 52.25 | 79.56 | 57.90 | 85.26 | 8.89 |
+
+Table 2: Main results evaluated in BEV AP (\%) on the RADIATE dataset [40]. CramNet-C (*notes evaluation on camera/lidar-specific labels), CramNet-R, and CramNet denote our camera-only, radar-only, and fusion models, respectively. Our final model outperforms the baseline Faster R-CNN [40] by 16 percentage points, the camera-only variant by 38 points, and the radar-only variant by 6 points. These large gains validate the efficacy of our proposed sensor fusion model.
+
+training set that contains both good and bad weather conditions, and we evaluate the resulting models on the standard validation set.
+
+Evaluation. The (pseudo) 3D labels in the RADIATE dataset are 2D BEV labels with assumed heights for each category. We therefore report our 3D detection results in terms of BEV AP to align with the baselines, unless otherwise noted. We follow the proposed evaluation in the dataset and define the category "vehicle" to encompass the six categories "car", "van", "truck", "bus", "motorbike", and "bicycle". The final BEV/3D AP numbers are therefore weighted sums of the objects from these categories. For all radar and fusion experiments, we evaluate the performance on the region that is captured by both the cameras and the radar sensors, up to the radar range of 100 meters. For all camera-only experiments, we exclude labels that do not contain any LiDAR points. The motivation for this is that camera depth estimates beyond the LiDAR supervision (up to 70 meters) tend to be inaccurate.
+
+# 4.2 Implementation Details
+
+Hyperparameters. CramNet follows the implementation of RSN [48]. The sparse convolution implementation is also similar to [56]. The input camera and radar RF images are both normalized to be in [0, 1]. The foreground score cutoff is set to 0.15, the segmentation loss weight is set to 400, and the depth loss weight is set to 20. For cross-attention, we sample 1 point closer and farther around the predicted depth location, with $10\%$ error. The voxelization region is $[-100\mathrm{m}, 100\mathrm{m}] \times [-100\mathrm{m}, 100\mathrm{m}] \times [-5\mathrm{m}, 5\mathrm{m}]$ with 0.2 meter voxel sizes. In the heatmap computation, $\sigma_h$ is set to 1.0, the heatmap loss weight is set to 4 and threshold $\epsilon_h$ are set to 0.2. We use 12 bins in the heading bin loss for heading regression.
+
+Training and inference. We train CramNet from scratch end-to-end using the Adam optimizer [14] on Tesla V100 GPUs. The models are trained with 5 batches on 8 GPUs. We use a cosine learning rate decay, where we set the initial learning rate to 0.006, with 1k warm-up steps starting at 0.003 and 50k steps in total. We use layer normalization [1] instead of batch normalization [12] in the 3D network for the number of foreground points varies among different scenes. We do not perform 2D data augmentation but adopt two 3D data augmentation strategies,
+
+namely, random flipping along the $x$ -axis and a global rotation around the $z$ -axis, with a random angle from $[-\pi / 4, \pi / 4]$ on the selected foreground points.
+
+# 4.3 Performance on the RADIATE dataset
+
+We evaluate the performance of our method on the RADIATE dataset [40] and summarize the results in Table 2. We report the BEV AP at a 0.5 IoU threshold to align with the baseline proposed in the RADIATE dataset [40]. The baseline runs a Faster R-CNN detector with a ResNet-101 backbone on radar RF images.
+
+Our radar-only variant, CramNet-R, outperforms the baseline by a large margin, $\sim 10$ percentage points in AP. Our two-stage framework effectively filters out radar noise in the segmentation stage to focus inference on the remaining radar signals in subsequent stages. Our camera-only variant, CramNet-C, performs the worst. Several factors may contribute to the poor performance. First, adverse weather affects the cameras more than the radar sensors, which is exacerbated by the lack of wipers mounted on the vehicles. Second, the effective range of the LiDAR sensors, which we use for camera depth supervision at training time, tends to drop from 70 meters in clear weather to about 40 meters in adverse weather, whereas we have labeled ground truth boxes within a range of 100 meters. Overall, we observe that the short sensing range and the sparsity of the points prevent the model from learning accurate camera depth estimation, resulting in poor camera-only 3D detection performance.
+
+Our proposed fusion model, CramNet, equipped with ray-constrained cross attention and sensor dropout, outperforms the baseline BEV AP by 16 percentage points, the camera-only variant by 38 points, and the radar-only variant by 6 points. These large gains validate the efficacy of our proposed sensor fusion model. In the next sections, we study the performance of our method in more detail.
+
+# 4.4 Ablation Study
+
+| Attention | Dropout | BEV AP |
| | 56.19 |
| ✓ | | 60.20 |
| ✓ | 61.23 |
| ✓ | ✓ | 62.07 |
+
+| Radar Intensity Threshold | # of Points | BEV AP | Degradation |
| None | - | 60.20 | - |
| 0.25 | 70K | 50.90 | -15.45% |
| 0.5 | 2K | 17.81 | -70.42% |
+
+Table 3: Ablation study on CramNet on the RADIATE dataset [40]. Left: The cross-attention and sensor dropout both improve over the vanilla fusion model by 4 to 5 points in AP. Putting them together yields the final fusion model with the best performance. Right: We simulate the radar sparse signals by setting the intensity thresholds to 0.25 or 0.5, resulting in $\sim 70\mathrm{K}$ or 2K points, respectively. As a result, our model performance is degraded relatively by $15\%$ to $70\%$ . This confirms radar RF imagery contains critical information for 3D detection.
+
+| Dropout Location | BEV AP |
| Normal | 57.00 |
| Input | 55.78 |
| Point Cloud | 58.64 |
| Point Feature | 61.23 |
+
+
+Fig. 4: Left: Analysis on different sensor dropout strategies. Masking out point features yields the best performance. Two possible benefits for this dropout location: 1) Reduce the 3D network reliance on features, which are disrupted the most given sensor noise. 2) Remain smooth training of 2D feature extractors and cross-attention. Right: Analysis on model performance degradation on corrupted data. We add varying degrees of Gaussian white noises to corrupt camera images and evaluate the performance. Our fusion model trained with sensor dropout greatly outperforms the one without by 2 to 10 percentage points in BEV AP. This demonstrates that sensor dropout can drastically enhance sensor robustness.
+
+Effects of ray-constrained cross-attention and dropout. We experiment the fusion model with different settings to enable/disable ray-constrained cross-attention and sensor dropout mechanisms. The experimental results are summarized in Table 3 (left). The cross-attention and sensor dropout both improve over the vanilla fusion model by 4 to 5 points in BEV AP. Putting them together yields our final fusion model, achieving the performance of $62.07\%$ AP.
+
+Effects of sampling radar points. Most of the camera-radar fusion methods, such as GRIF Net [13] and CenterFusion [28], perform experiments on the nuScenes dataset [5] that contains only sparse radar points, at the scale of hundreds of points in a scene. The resulted radar-only model usually performs poorly, such as $25.5\%$ AP reported in [13]. On the other hand, our model is specifically designed to perform either single modality effectively by taking as input the RF images instead of sparse points.
+
+To quantitatively study how the sparsity of radar signals affects the performance, we filter RF images with varying intensity thresholds, as summarized in Table 3 (right). We set the intensity thresholds to 0.25 or 0.5, resulting in $\sim 70\mathrm{K}$ or $2\mathrm{K}$ points, respectively, which are already denser than sparse radar points available on nuScenes [5] or SeeingThroughFog [2] datasets. As a result, our model performance is degraded relatively by $15\%$ to $70\%$ . We conclude that radar RF imagery contains critical information for effective 3D object detection.
+
+# 4.5 Detection Robustness
+
+Detection robustness against sensor deterioration is critical for safe autonomous driving. In this section, we study the effects of our proposed sensor dropout with ablation study and corrupted sensor data.
+
+Where to drop out sensor data? Dropout is a popular technique for training neural network models [45]. It is usually applied on a layer to randomly mask out neuron activations. We experiment on various places to drop out sensor data and summarize them in Table 4 (left). The 'normal' dropout applies the conventional dropout on point cloud features, regardless of which sensor the points are from. This conventional dropout does not provide benefits in either overall performance or in bad weather conditions. The 'input' dropout randomly masks out a sensor (radar or camera) entirely. The 'point cloud' dropout randomly masks out the 3D points from one sensor entirely. The 'point feature' dropout randomly masks out the initial point cloud features from one sensor entirely but leaves the point cloud positions intact. As the numbers dictate, masking out point features yields the best performance. Two possible benefits for this dropout location: (1) Reduce the 3D network reliance on features, which are disrupted the most due to sensor noise. (2) Remain training of 2D feature extractors and cross-attention. As such, we conclude dropping out sensor point features randomly is the most effective.
+
+Sensor dropout improves robustness against input corruption. We study how the corruption of sensors will affect the performance with and without sensor dropout and summarize the experiments in Table 4 (right). For this purpose, we add random Gaussian white noise with varying standard deviation to corrupt the camera images to different degrees. We evaluate the fusion model on the corrupted data, with or without sensor dropout during training. The experimental results show that our fusion model trained with sensor dropout greatly outperforms the one without by 2 to 10 percentage points in BEV AP. This study demonstrates that sensor dropout can drastically enhance sensor robustness.
+
+# 4.6 Camera-only CramNet on Waymo Open Dataset
+
+Our radar-only and camera-radar fusion models perform strongly on the RADI-ATE dataset [40]. However, the camera-only model suffers from the poor image quality and adverse weather conditions in the dataset. Since we do not have access to another public dataset that contains radar RF imagery, we evaluate our camera-only model performance on the Waymo Open Dataset [47], as summarized in Table 4. We report 3D AP/APH with 0.7 IoU threshold on the LEVEL_1 difficulty in Table 4. Our camera-only model, CramNet-C, achieves competitive performance. More details can be found in the supplementary.
+
+# 4.7 Visualization
+
+We present the visual comparisons between our camera-only, radar-only, and fusion models in Figure 5. Since the camera visibility is severely reduced due to either underexposure or adverse weather, the camera-only model tends to miss detection and the predicted localization tends to be inaccurate. In contrast, the radar-only model suffers from false positives due to lack of appearance features from RF images. Overall, our camera-radar fusion model combines the advantages from the two and produces the most accurate predictions.
+
+| Method | 3D AP | 0 - 30m | 30 - 50m | 50m - ∞ | 3D APH | 0 - 30m | 30 - 50m | 50m - ∞ |
| M3D-RPN [4] | 0.35 | 1.12 | 0.18 | 0.02 | 0.34 | 1.10 | 0.18 | 0.02 |
| CaDDN [34] | 5.03 | 14.54 | 1.47 | 0.10 | 4.99 | 14.43 | 1.45 | 0.10 |
| CramNet-C | 4.14 | 15.46 | 1.20 | 0.15 | 4.10 | 15.31 | 1.19 | 0.13 |
+
+Table 4: Camera-only 3D detection results on the Waymo Open Dataset [47] validation set on the vehicle class, evaluated in terms of 3D AP/APH at 0.7 IoU on the LEVEL_1 difficulty. Baseline numbers are from [34]. Our camera-only model, CramNet-C, achieves competitive performance among state-of-the-art.
+
+
+Fig. 5: Visual comparison between CramNet-C, CramNet-R, and CramNet from 6 scenarios. We visualize the predicted boxes in red and the ground truth boxes in yellow with projected radar and camera pixels. Whereas the camera-only model tends to miss detections and predict inaccurate localization, the radar-only model suffers from false positives. Our camera-radar fusion model combines the advantages of the two and produces the most accurate predictions.
+
+# 5 Conclusion
+
+We introduced a camera-radar sensor fusion approach for robust 3D object detection for autonomous driving. The method relies on a ray-constrained cross-attention mechanism to leverage the range measurements from radar to improve camera depth estimates. Training with sensor dropout allows the method to fall back to a single modality when one of the sensors malfunctions. We present experiments on the RADIATE dataset and the Waymo Open Dataset.
+
+Limitations. Whereas a camera pixel corresponds to a ray, a (range, azimuth) radar reading corresponds to an arc in 3D space. Intersecting a camera ray and a radar arc yields their correspondence. We approximate the radar arc as a pillar, that is, we assume that the radar points are at the same elevation as the sensor. This assumption works well in practice when most objects are at a similar elevation as the sensor. We currently use the RF images in Cartesian coordinates, which may be suboptimal as the radar natively operates in polar coordinates. We will explore a polar convolutional network design and radar-specific spherical voxelization in future work.
+
+# References
+
+1. Ba, J.L., Kiros, J.R., Hinton, G.E.: Layer normalization. arXiv preprint arXiv:1607.06450 (2016)
+2. Bijelic, M., Gruber, T., Mannan, F., Kraus, F., Ritter, W., Dietmayer, K., Heide, F.: Seeing through fog without seeing fog: Deep multimodal sensor fusion in unseen adverse weather. In: CVPR (2020)
+3. Bijelic, M., Gruber, T., Ritter, W.: A benchmark for lidar sensors in fog: Is detection breaking down? In: 2018 IEEE Intelligent Vehicles Symposium (IV) (2018)
+4. Brazil, G., Liu, X.: M3d-rpn: Monocular 3d region proposal network for object detection. In: ICCV (2019)
+5. Caesar, H., Bankiti, V., Lang, A.H., Vora, S., Liong, V.E., Xu, Q., Krishnan, A., Pan, Y., Baldan, G., Beijbom, O.: nuscenes: A multimodal dataset for autonomous driving. In: CVPR (2020)
+6. Chen, X., Kundu, K., Zhang, Z., Ma, H., Fidler, S., Urtasun, R.: Monocular 3d object detection for autonomous driving. In: CVPR (2016)
+7. Chen, X., Ma, H., Wan, J., Li, B., Xia, T.: Multi-view 3d object detection network for autonomous driving. In: CVPR (2017)
+8. Chen, Y., Tai, L., Sun, K., Li, M.: Monopair: Monocular 3d object detection using pairwise spatial relationships. In: CVPR (2020)
+9. Ding, M., Huo, Y., Yi, H., Wang, Z., Shi, J., Lu, Z., Luo, P.: Learning depth-guided convolutions for monocular 3d object detection. In: CVPR workshops (2020)
+10. Graham, B., van der Maaten, L.: Submanifold sparse convolutional networks. arXiv preprint arXiv:1706.01307 (2017)
+1. Huang, T., Liu, Z., Chen, X., Bai, X.: Epnet: Enhancing point features with image semantics for 3d object detection. In: ECCV (2020)
+2. Ioffe, S., Szegedy, C.: Batch normalization: Accelerating deep network training by reducing internal covariate shift. In: ICML (2015)
+3. Kim, Y., Choi, J.W., Kum, D.: Grif net: Gated region of interest fusion network for robust 3d object detection from radar point cloud and monocular image. In: IROS (2020)
+4. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+5. Lang, A.H., Vora, S., Caesar, H., Zhou, L., Yang, J., Beijbom, O.: Pointpillars: Fast encoders for object detection from point clouds. In: CVPR (2019)
+6. Li, P., Zhao, H., Liu, P., Cao, F.: Rtm3d: Real-time monocular 3d detection from object keypoints for autonomous driving. In: ECCV (2020)
+7. Li, Y., Yu, A.W., Meng, T., Caine, B., Ngiam, J., Peng, D., Shen, J., Lu, Y., Zhou, D., Le, Q.V., et al.: Deepfusion: Lidar-camera deep fusion for multi-modal 3d object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 17182-17191 (2022)
+8. Li, Z., Wang, W., Li, H., Xie, E., Sima, C., Lu, T., Yu, Q., Dai, J.: Bevformer: Learning bird's-eye-view representation from multi-camera images via spatiotemporal transformers. In: ECCV (2022)
+9. Liang, M., Yang, B., Wang, S., Urtasun, R.: Deep continuous fusion for multi-sensor 3d object detection. In: ECCV (2018)
+20. Lim, T.Y., Ansari, A., Major, B., Fontijne, D., Hamilton, M., Gowaikar, R., Subramanian, S.: Radar and camera early fusion for vehicle detection in advanced driver assistance systems. In: Machine Learning for Autonomous Driving Workshop at the 33rd Conference on Neural Information Processing Systems (2019)
+
+21. Lin, T.Y., Dollár, P., Girshick, R., He, K., Hariharan, B., Belongie, S.: Feature pyramid networks for object detection. In: CVPR (2017)
+22. Lin, T.Y., Goyal, P., Girshick, R., He, K., Dólár, P.: Focal loss for dense object detection. In: ICCV (2017)
+23. Liu, L., Wu, C., Lu, J., Xie, L., Zhou, J., Tian, Q.: Reinforced axial refinement network for monocular 3d object detection. In: ECCV (2020)
+24. Ma, X., Liu, S., Xia, Z., Zhang, H., Zeng, X., Ouyang, W.: Rethinking pseudo-lidar representation. In: ECCV (2020)
+25. Major, B., Fontijne, D., Ansari, A., Teja Sukhavasi, R., Gowaikar, R., Hamilton, M., Lee, S., Grzechnik, S., Subramanian, S.: Vehicle detection with automotive radar using deep learning on range-azimuth-doppler tensors. In: ICCV Workshops (2019)
+26. Manhardt, F., Kehl, W., Gaidon, A.: Roi-10d: Monocular lifting of 2d detection to 6d pose and metric shape. In: CVPR (2019)
+27. Mousavian, A., Anguelov, D., Flynn, J., Kosecka, J.: 3d bounding box estimation using deep learning and geometry. In: CVPR (2017)
+28. Nabati, R., Qi, H.: Centerfusion: Center-based radar and camera fusion for 3d object detection. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (2021)
+29. Nobis, F., Shafiei, E., Karle, P., Betz, J., Lienkamp, M.: Radar voxel fusion for 3d object detection. Applied Sciences (2021)
+30. Park, D., Ambrus, R., Guizilini, V., Li, J., Gaidon, A.: Is pseudo-lidar needed for monocular 3d object detection? In: ICCV (2021)
+31. Piergiovanni, A., Casser, V., Ryoo, M.S., Angelova, A.: 4d-net for learned multi-modal alignment. In: ICCV (2021)
+32. Qi, C.R., Liu, W., Wu, C., Su, H., Guibas, L.J.: Frustum pointnets for 3d object detection from rgb-d data. In: CVPR (2018)
+33. Qi, C.R., Yi, L., Su, H., Guibas, L.J.: Pointnet++: Deep hierarchical feature learning on point sets in a metric space. NeurIPS (2017)
+34. Reading, C., Harakeh, A., Chae, J., Waslander, S.L.: Categorical depth distribution network for monocular 3d object detection. In: CVPR (2021)
+35. Richards, M.A., Scheer, J., Holm, W.A., Melvin, W.L.: Principles of modern radar (2010)
+36. Roddick, T., Kendall, A., Cipolla, R.: Orthographic feature transform for monocular 3d object detection. arXiv preprint arXiv:1811.08188 (2018)
+37. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: MICCAI (2015)
+38. Schumann, O., Hahn, M., Dickmann, J., Wöhler, C.: Semantic segmentation on radar point clouds. In: 2018 21st International Conference on Information Fusion (FUSION) (2018)
+39. Shah, M., Huang, Z., Laddha, A., Langford, M., Barber, B., Zhang, S., Vallespi-Gonzalez, C., Urtasun, R.: Liranet: End-to-end trajectory prediction using spatiotemporal radar fusion. In: CoRL (2020)
+40. Sheeny, M., De Pellegrin, E., Mukherjee, S., Ahrabian, A., Wang, S., Wallace, A.: Radiate: A radar dataset for automotive perception in bad weather. In: ICRA (2021)
+41. Shi, S., Wang, X., Li, H.: Pointcnn: 3d object proposal generation and detection from point cloud. In: CVPR (2019)
+42. Shi, X., Chen, Z., Kim, T.K.: Distance-normalized unified representation for monocular 3d object detection. In: ECCV (2020)
+
+43. Simonelli, A., Bulo, S.R., Porzi, L., López-Antequera, M., Kontschieder, P.: Disentangling monocular 3d object detection. In: ICCV (2019)
+44. Simonelli, A., Bulo, S.R., Porzi, L., Ricci, E., Kontschieder, P.: Towards generalization across depth for monocular 3d object detection. In: ECCV (2020)
+45. Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., Salakhutdinov, R.: Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research (2014)
+46. Srivastava, S., Jurie, F., Sharma, G.: Learning 2d to 3d lifting for object detection in 3d for autonomous vehicles. In: IROS (2019)
+47. Sun, P., Kretzschmar, H., Dotiwalla, X., Chouard, A., Patnaik, V., Tsui, P., Guo, J., Zhou, Y., Chai, Y., Caine, B., et al.: Scalability in perception for autonomous driving: Waymo Open Dataset. In: CVPR (2020)
+48. Sun, P., Wang, W., Chai, Y., Elsayed, G., Bewley, A., Zhang, X., Sminchisescu, C., Anguelov, D.: Rsn: Range sparse net for efficient, accurate lidar 3d object detection. In: CVPR (2021)
+49. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. NeurIPS (2017)
+50. Vora, S., Lang, A.H., Helou, B., Beijbom, O.: Pointpainting: Sequential fusion for 3d object detection. In: CVPR (2020)
+51. Wang, C., Ma, C., Zhu, M., Yang, X.: Pointaugmenting: Cross-modal augmentation for 3d object detection. In: CVPR (2021)
+52. Wang, W., Tran, D., Feiszli, M.: What makes training multi-modal classification networks hard? In: CVPR (2020)
+53. Wang, Y., Chao, W.L., Garg, D., Hariharan, B., Campbell, M., Weinberger, K.Q.: Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. In: CVPR (2019)
+54. Wang, Z., Jia, K.: Frustum convnet: Sliding frustums to aggregate local point-wise features for amodal 3d object detection. In: IROS (2019)
+55. Weng, X., Kitani, K.: Monocular 3d object detection with pseudo-lidar point cloud. In: ICCV Workshops (2019)
+56. Yan, Y., Mao, Y., Li, B.: Second: Sparsely embedded convolutional detection. Sensors (2018)
+57. Yang, B., Guo, R., Liang, M., Casas, S., Urtasun, R.: Radarnet: Exploiting radar for robust perception of dynamic objects. In: ECCV (2020)
+58. You, Y., Wang, Y., Chao, W.L., Garg, D., Pleiss, G., Hariharan, B., Campbell, M., Weinberger, K.Q.: Pseudo-lidar++: Accurate depth for 3d object detection in autonomous driving. arXiv preprint arXiv:1906.06310 (2019)
+59. Zhou, D., Fang, J., Song, X., Guan, C., Yin, J., Dai, Y., Yang, R.: Iou loss for 2d/3d object detection. In: 2019 International Conference on 3D Vision (3DV) (2019)
+60. Zhou, X., Wang, D., Krahenbuhl, P.: Objects as points. arXiv preprint arXiv:1904.07850 (2019)
+61. Zhou, Y., Sun, P., Zhang, Y., Anguelov, D., Gao, J., Ouyang, T., Guo, J., Ngiam, J., Vasudevan, V.: End-to-end multi-view fusion for 3d object detection in lidar point clouds. In: CoRL (2020)
\ No newline at end of file
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/images.zip b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..1579ad10d1771a02ccaa951b7aae37d68126cb2d
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:592b7c5503d6e73da9db1f6cba59d495e4d22a2f44c69b62c36e82978ece50a2
+size 369736
diff --git a/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/layout.json b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1ad92070c8e5754be48739d5aa0a6a70f6126335
--- /dev/null
+++ b/cramnetcameraradarfusionwithrayconstrainedcrossattentionforrobust3dobjectdetection/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a0537a04faf4250e54ac423e4969696c913b3c9782729fa414ffcf5613f47bd1
+size 393321
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_content_list.json b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ac7f72215061d6ce935b134553b0ac6087ea2e93
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e24e79884179f267509ba5b4139d1d802370595035e017e48d0a03ac1d700f8
+size 76052
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_model.json b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4eb54bcdc3b933f417fc8b91455b3f618b24b75f
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ef7b4909e7556b649cba6db45dcca41313aefca4bb0d6af8b362774556e49261
+size 94824
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_origin.pdf b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0a6cf77a8374f58acbb523c61f7a43186a4d8f78
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/c0d0b83b-2dc4-46d8-b9b9-c57290be38b1_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:413875a18a962fe6ef7ed68c2b14a4a368b6817f0a76bd1e921d5f1a9819d642
+size 10053336
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/full.md b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..881fb10d9be5c9cc4388e010afcf98db841624f6
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/full.md
@@ -0,0 +1,269 @@
+# Cross Attention Based Style Distribution for Controllable Person Image Synthesis
+
+Xinyue Zhou $^{1}$ , Mingyu Yin $^{1}$ , Xinyuan Chen $^{3}$ , Li Sun $^{1,2\star}$ , Changxin Gao $^{4}$ , and Qingli Li $^{1}$
+
+$^{1}$ Shanghai Key Laboratory of Multidimensional Information Processing, $^{2}$ Key Laboratory of Advanced Theory and Application in Statistics and Data Science, East China Normal University, Shanghai, China $^{3}$ Shanghai AI Laboratory, Shanghai, China $^{4}$ Huazhong University of Science and Technology, Wuhan, China
+
+
+Fig. 1. Left: given the source image and target pose, our model is able to transfer the pose and generate the target parsing map as required. Note that we have only a single training stage without independent generation for the target parsing map. However, our model still synthesizes it precisely by cross attention based style distribution module. Right: Our model also enables virtual try-on and head identity) swapping by explicitly controlling the poses and per-body-part appearance of source and reference images.
+
+Abstract. Controllable person image synthesis task enables a wide range of applications through explicit control over body pose and appearance. In this paper, we propose a cross attention based style distribution module that computes between the source semantic styles and target pose for pose transfer. The module intentionally selects the style represented by each semantic and distributes them according to the target pose. The attention matrix in cross attention expresses the dynamic similarities between the target pose and the source styles for all semantics. Therefore, it can be utilized to route the color and texture from the source
+
+image, and is further constrained by the target parsing map to achieve a clearer objective. At the same time, to encode the source appearance accurately, the self attention among different semantic styles is also added. The effectiveness of our model is validated quantitatively and qualitatively on pose transfer and virtual try-on tasks. Codes are available at https://github.com/xyzhouo/CASD.
+
+Keywords: Person image synthesis, Pose transfer, Virtual try-on
+
+# 1 Introduction
+
+Synthesizing realistic person images under explicit control of the body pose and appearance has many potential applications, such as person reID [47,38,6], video generation [40,16] and virtual clothes try-on [9,34,3,7], etc. Recently, the conditional GAN is employed to transfer the source style into the specified target pose. The generator connects the intended style with the required pose in its different layers. E.g., PATN [50], HPT [41], ADGAN [23] insert several repeated modules with the same structure to combine style and pose features. However, these modules are usually composed of common operations, such as Squeeze-and-Excitation (SE) [11] or Adaptive Instance Normalization (AdaIN) [12], which lacks the ability to align source style with target pose.
+
+In contrast, the 2D or 3D deformation is applied in the task with a clearer motivation. DefGAN [28], GFLA [26] and Intr-Flow [15] estimate the correspondence between the source and target pose to guide the spread of appearance features. Although these methods generate realistic texture, they may produce noticeable artifacts when faced with large deformations. Besides, more than one training stages are often needed, and the unreliable flow from the first stage limits the quality of results.
+
+This paper aims for the better fusion on features of both source image and target pose in a single training stage. Instead of directly estimating the geometry deformation and warping source features to fulfill target pose, we propose a simple cross attention based style distribution (CASD) module to calculate between the target pose and the source style represented by each semantic, and distribute the source semantic styles to the target pose. The basic idea is to employ the coarse fusion features under target pose as queries, requiring the source styles from different semantic components as keys and values to update and refine them. Following ADGAN [23], appearance within each semantic region is described by a style encoder, which extracts the color and texture within the corresponding region (such as head, arms, or legs, etc.). The style features are dynamically distributed by the CASD block for each query position under the target pose. Particularly, values from each semantic are softly weighted and summed together according to the attention matrix, so that they are matched with target pose. The aligned feature can be further utilized to affect the input to the decoder.
+
+To further improve the synthesis quality, we have some special designs within CASD block. First, to tightly link styles from different semantics, the self attenuate
+
+tion is performed among them, making each style no longer independent with others. Second, another routing scheme, in the same size with attention matrix, is also employed for style routing. It is directly predicted from the target pose without exhaustive comparisons with keys of styles. Third, extra constraint from target parsing map is incorporated on the attention matrix, so that the attention head has a clearer motivation. In this way, our attention matrix represents the predicted target parsing map. Additionally, our model can also achieve virtual try-on and head identity) swapping based on reference images by exchanging the specific semantic region in style features. Fig 1 shows some applications of our model. The contributions of the paper can be summarized into following aspects.
+
+- We propose cross attention based style distribution (CASD) module for controllable person image synthesis, which softly selects the source style represented by each semantic and distributes them to the target pose.
+- We intentionally add self attention to connect styles from different semantic components, and let the model predict the attention matrix based on the target pose. Moreover, the target parsing maps are used as the ground truths for the attention matrix, giving the model an evident object during training.
+- We can achieve applications in image manipulation by explicit controlling over body pose and appearance, e.g., pose transfer, parsing map generation, virtual try-on and head identity) swapping.
+- Extensive experiments on DeepFashion dataset validates the effectiveness of our proposed model. Particularly, the synthesis quality has been greatly improved, indicated by both quantitative metrics and user study.
+
+# 2 Related Work
+
+Human pose transfer is first proposed in [20], and becomes well developed in recent years due to the advancement in image synthesis. Most of the existing works need paired training data, which employ the ground truth under target pose during training. Though a few of them are fully unsupervised [21,5,25,30,44,44,48,27], they are not of our major concern. Previous research can be characterized into either two- (or multi-) stage or one-stage methods. The former first generates coarse images or foreground masks, and then gives them to the second stage generator as input for refinement. In [1], the model first segments the foreground from image into different body components, and then applies learnable spatial deformations on them to generate the foreground image. GFLA [26] pretrains a network to estimate the 2D flow and occlusion mask based on source image, source and target poses. Afterwards, it uses them to warp local patches of the source to match the required pose. Li et.al. [15] fit a 3D mesh human model onto the 2D image, and train the first stage model to predict the 3D flow, which is employed to warp the source appearance in the second stage. LiquidGAN [16] also adopts the 3D model to guide the geometry deformation within the foreground region. Although geometry-based methods generate realistic texture, they may fail to extract accurate motions, resulting
+
+in noticeable artifacts. On the other hand, without any deformation operation, PISE [43] and SPGnet [19] synthesize the target parsing maps, given the source masks, source poses and target poses as input in the first stage. Then it generates the image with the help of them in the second stage. These work show that the parsing maps under target pose have potential to be exploited for pose transfer.
+
+Compared to two-stage methods, the single stage model has light training burden. Different from [1], DefGAN [28] explicitly computes the local 2D affine transformation between source and target patches, and applies the deformation to align source features to the target pose. PATN [50] proposes a repeated pose attention module, consisting of the computation like SE-Net, to combine features from the appearance and pose. ADGAN [23] uses a texture encoder to extract style vectors within each semantic, and gives them to several AdaIN residual blocks to synthesize the target image. XingGAN [31] proposes two types of cross attention blocks to fuse features from the target pose and source appearance in two directions, repeatedly. Although these models design the fusion block of pose and appearance style, they lack the operation to align source appearance with the target pose. CoCosNet [44,48] computes the dense correspondences between cross-domain images by attention-based operation. However, each target position is only related to a local patch of the source image, which implies that the correlation matrix should be a sparse matrix, and the dense correlation matrix leads to quadratic memory consumption. Our model deals with this problem by an efficient CASD block.
+
+Attention and transformer modules first appear in NLP [33], which enlarge the receptive field in a dynamic way. Non-local network [36] is its first attempt in image domain. The scheme becomes increasingly popular in various tasks including image classification [4,32,17,35], object detection [2,49] and semantic segmentation [13,46] due to its effectiveness. There are basically two different ways for it which are self and cross attention. Self attention projects the queries, keys and values from the same token set, while cross attention usually obtains keys and values from one set, and queries from another one. The computation process then becomes the same, measuring the similarity between queries and keys to form an attention matrix, which is used to weight values to update query tokens. Based on the repeated attention module, multi-stage transformer can be built. Note that adding the MLP (FFN) and residual connection between stages are crucial and become a designing routine, for which we also follows.
+
+# 3 Method
+
+# 3.1 Overview Framework
+
+Given a source image $I_{s}$ under the pose $P_{s}$ , our goal is to synthesize a high fidelity image $\hat{I}_{t}$ under a different target pose $P_{t}$ . $\hat{I}_{t}$ should not only fulfil the pose requirement, but also have the same appearance with $I_{s}$ . Fig 2 shows the overview of the proposed generation model. It consists of a pose encoder $E_{p}$ , a semantic region style encoder $E_{s}$ and a decoder $Dec$ . Besides, there are several cross attention based style distribution (CASD) blocks which are the key
+
+
+Fig. 2. Overview architecture of our proposed generator. There are separate pose and style encoders, with their outputs $F_{p}$ and $F_{s}$ being fused by AdaIN ResBlks and Cross Attention based Style Distribution (CASD) blocks, and giving the pose-aligned feature $F_{ps}$ as the output. Then, the same $F_{ps}$ is adapted to decoder through AFN ResBlks. The key component, CASD Block, consists of both self and cross attention, and can also output the predicted target parsing maps $\hat{S}_{t}$ .
+
+components in our generator. Before and after the attention, there are several AdaIN residual blocks and Aligned Feature Normalization (AFN) residual blocks with the similar design as [24,42]. The former coarsely adapts the source style to the target pose, while the latter incorporates the pose-aligned feature from the CASD blocks into the decoder. Both of them are learnable, which change the feature statistics in their affecting layers.
+
+As is shown in Fig 2, the desired $P_{t}$ is directly used as the input by encoder $E_{p}$ , which describes the key point positions of human body. For each point, we make a single channel heatmap with a predefined standard deviation to describe its location. Except the individual point, we additionally adopt straight lines between selected points to better model the pose structure. There are totally 18 points and 12 lines, so $P_{t} \in \mathbb{R}^{H \times W \times 30}$ . To facilitate accurate style extraction from $I_{s}$ , we follow the strategy in [23], which employs the source parsing map $S_{s} \in \mathbb{R}^{H \times W \times N_{s}}$ to separate the full image into regions, so that $E_{s}$ independently encodes the styles in different semantics. $N_{s}$ is the total number of semantics in the parsing map. During training, the ground truth image $I_{t}$ and its corresponding parsing map $S_{t}$ are exploited. Note that $F_{p} \in \mathbb{R}^{H \times W \times C}$ and $F_{s} \in \mathbb{R}^{N_{s} \times 1 \times 1 \times C}$ represent the pose and style features from $E_{p}$ and $E_{s}$ , respectively. They are utilized by the CASD blocks, whose details are introduced in the following section. Moreover, the CASD block is repeated by multiple times, e.g. twice, gradually completing the fusion between $F_{p}$ and $F_{s}$ , and forming a better aligned feature $F_{ps}$ . Finally, $F_{ps}$ is given to AFN from the side branch to take its effect. Besides, our CASD block can also output the predicted target parsing map $\hat{S}_{t}$ by constraining the cross attention matrix.
+
+
+Fig. 3. Illustrations of the cross attention based style distribution (CASD) block. On the right, self attention is performed on the source style features $F_{s}$ , giving the updated $F_{s}^{\prime}$ as the output. On the left, cross attention is computed between the coarsely aligned feature $F_{crs}$ and the updated style feature $F_{s}^{\prime}$ . The pose $F_{p}$ also joins the cross attention. And by constraining the cross attention matrix $AM$ , predicted target parsing maps $\hat{S}_{t}$ is generated. Note that $\alpha_{1-3}$ indicates the learnable scaling factors.
+
+# 3.2 Pre- and Post-Attention Style injection
+
+Since the source style $F_{s}^{i} \in \mathbb{R}^{1 \times 1 \times C}$ is independently encoded by a shared-weight encoder $E_{s}$ , where $i = 1,2,\dots ,N_{s}$ is the semantic index, they may not appropriate for style injection together. So we first combine $F_{s}^{i}$ from different semantic regions through an MLP, and give results to AdaIN ResBlks to roughly combine $F_{s}$ with $F_{p}$ , specifying the coarse fusion $F_{crs}$ reflecting the target pose $P_{t}$ , which then participates cross attention as queries in the CASD blocks.
+
+After the CASD blocks, we have $F_{ps}$ which is obviously superior to $F_{crs}$ , and is suitable for the utilization by Dec. Instead of giving $F_{ps}$ directly to Dec, we design an AFN ResBlks to employ it as a conditional feature. Within the block, an offset $\beta$ and a scaling factor $\gamma$ are first predicted. Then, they take effect through AFN, which performs the conditional normalization according to $\beta$ and $\gamma$ . Note that $F_{ps}$ , $\beta$ and $\gamma$ are in the same size.
+
+# 3.3 Cross Attention based Style Distribution Block
+
+The computation in CASD block includes two stages, which are self attention and cross attention stages, as is depicted in Fig 3. The two types of attention are carried out in sequence, and they together align the source style $F_{s}$ according to the target pose feature $F_{p}$ . We describe them in the following two sections.
+
+Self attention for Style Features The self attention is performed among $F_{s}^{i}$ , so that each $F_{s}^{i}$ of a particular semantic is connected with others $F_{s}^{j}$ where $j \neq i$ . We simplify the classic design on self attention module in transformer [33]. Traditionally, there are three learnable projection heads $W_{Q}$ , $W_{K}$ and $W_{V}$ , and they are in the same shape $W_{Q}, W_{K}, W_{V} \in \mathbb{R}^{C \times C}$ . These heads are responsible for mapping the input tokens $F_{s}$ into the query $Q$ , key $K$ and value $V$ . In our application, to reduce learnable parameters, we omit $W_{Q}$ and $W_{K}$ , and directly use $F_{s}$ as both query and key. However, we keep $W_{V}$ and it yields $V \in \mathbb{R}^{N_{s} \times C}$ in the same dimension of $F_{s}$ . The self attention, computing the update style feature $F_{s}^{att}$ , can be summarized into Eq (1).
+
+$$
+F _ {s} ^ {\text {a t t}} = \operatorname {A t t e n t i o n} (Q, K, V) = \operatorname {S o f t m a x} \left(Q K ^ {\mathrm {T}} / \sqrt {C}\right) V \tag {1}
+$$
+
+$$
+Q = F _ {s}, \quad K = F _ {s}, \quad V = F _ {s} W _ {V}
+$$
+
+Here the attention module essentially compares the similarities of different semantic styles, so that each $F_{s}^{i}$ in $F_{s}$ absorbs information from other style tokens $F_{s}^{j}$ . Note that we also follow the common designs in transformer. Particularly, there is a residual connection between $F_{s}$ and $F_{s}^{att}$ , so they are added, and given to later layers. The final style is denoted by $F_{s}^{\prime}$ , as is shown on the right of Fig 3. Moreover, different from traditional transformer, we employ Layer Instance Normalization (SW-LIN) proposed in [39] to replace LN for better synthesis.
+
+Cross Attention The cross attention module further adapts the source style $F_{s}^{\prime}$ into the required pose, shown on the left of Fig 3. Such attention is carried out across different domains, between the coarse fusion $F_{crs}$ output from AdaIN resblks and the style feature $F_{s}^{\prime}$ . Therefore, different from the previous self attention, its result $F_{ps}$ has spatial dimensions, and actually reflects how to distribute the source style under an intended pose. In this module, $F_{crs}$ from AdaIN ResBlks is treated as queries $Q$ . Specifically, there are totally $H \times W$ unique queries. Each of them is a $C$ -dim vector. $F_{s}^{\prime}$ provides the keys $K$ for comparison with $Q$ and values $V$ for soft selection.
+
+Here we aggregate the common attention computation as is shown in Eq (2). $F_{ps}^{att} \in \mathbb{R}^{H \times W \times C}$ is the updated amount on query after the attention, in the same size with $F_{crs}$ .
+
+$$
+\begin{array}{l} F _ {p s} ^ {a t t} = \operatorname {A t t e n t i o n} (Q, F _ {p}, K, V) = A M \cdot V \\ = \left(\operatorname {S o f t m a x} \left(\frac {Q K ^ {\mathrm {T}}}{\sqrt {C}} + \operatorname {P r o j} \left(F _ {p}\right)\right)\right) V \tag {2} \\ \end{array}
+$$
+
+Note that we set $Q = F_{crs}W_{Q}$ , $K = F_{s}'W_{K}$ and $V = F_{s}'W_{V}$ , so the attention actually combines the features $F_{crs}$ with source styles $F_{s}'$ . In Eq (2), the first term in the bracket indicates the regular attention matrix which exhaustively computes the similarity between every $Q$ - $K$ pair. It is of the shape $H \times W \times N_{s}$ and determines the possible belonging semantic for each position. Since there are projection heads $W_{Q}$ and $W_{K}$ to adjust query and key, the attention matrix is fully dynamic, which is harmful to model convergence. Our solution is to add the
+
+second term with the same shape as the first one, forming the augmented attention matrix $AM$ , and let it participate value routing. $\mathrm{Proj}(\cdot)$ is a linear projection head which directly outputs a routing scheme based only on $F_{p}$ . Therefore, it implies that the model is able to predict the target parsing map for each position, given the encoded pose feature $F_{p}$ . Some recent works like SPGNet [19] or PISE [43] has a separate training stage to generate the target parsing map according to the required pose. Our model has a similar intention, but it is more convenient with only a single training stage. In the following section, we add a constraint on the attention matrix to generate the predicted target parsing map.
+
+After the cross attention in Eq (2), we follow the routine in transformer, which first makes the element-wise summation between $F_{ps}^{att}$ and $F_{p}$ , then gives the result to an FFN, leading to a better pose feature $F_{ps}$ which combines the source style for the next stage.
+
+# 3.4 Learning Objectives
+
+Similar to the previous method [50,23], we employ the adversarial loss $L_{adv}$ , reconstruction loss $L_{rec}$ , perceptual loss $L_{perc}$ and contextual loss $L_{CX}$ as our learning objectives. Additionally, we also adopt an attention matrix cross-entropy loss $L_{AMCE}$ and an LPIPS loss $L_{LPIPS}$ to train our model. The full learning objectives are formulated in Eq (3),
+
+$$
+\begin{array}{l} L _ {f u l l} = \lambda_ {a d v} L _ {a d v} + \lambda_ {r e c} L _ {r e c} + \lambda_ {p e r c} L _ {p e r c} + \lambda_ {C X} L _ {C X} \\ + \lambda_ {A M C E} L _ {A M C E} + \lambda_ {L P I P S} L _ {L P I P S} \tag {3} \\ \end{array}
+$$
+
+where $\lambda_{adv}$ , $\lambda_{rec}$ , $\lambda_{perc}$ , $\lambda_{CX}$ , $\lambda_{AMCE}$ and $\lambda_{LPIPS}$ are hyper-parameters controlling the relative importance of these objectives. They are detailed as follows. Attention Matrix Cross-entropy Loss. To train our model with an evident object, we adopt cross-entropy loss to constrain the attention matrix $AM$ close to target parsing map $S_t$ , which is defined as:
+
+$$
+L _ {A M C E} = - \sum_ {i = 1} ^ {H} \sum_ {j = 1} ^ {W} \sum_ {c = 1} ^ {N _ {s}} S _ {t} (i, j, c) \log \left(A M (i, j, c)\right). \tag {4}
+$$
+
+where $i, j$ denote the position of spatial dimension in the attention matrix $AM$ , and $c$ denotes the position of semantic dimension in attention matrix $AM$ . By employing this loss in the training process, our model can generate the predicted target parsing map in a single stage.
+
+Adversarial loss. We adopt a pose discriminator $D_{p}$ and a style discriminator $D_{s}$ to help $G$ generate more realistic results in adversarial training. Specifically, real pose pairs $(P_{t}, I_{t})$ and fake pose pairs $(P_{t}, \hat{I}_{t})$ are feed into $D_{p}$ for pose consistency. Meanwhile, real image pairs $(I_{s}, I_{t})$ and fake image pairs $(I_{s}, \hat{I}_{t})$ are feed into $D_{s}$ for style consistency. Note that both discriminators are trained with $G$ in an end-to-end way to promote each other.
+
+$$
+\begin{array}{l} L _ {a d v} = \mathbb {E} _ {I _ {s}, I _ {t}, P _ {t}} \left[ \log \left(D _ {s} \left(I _ {s}, I _ {t}\right) \cdot D _ {p} \left(P _ {t}, I _ {t}\right)\right) \right] \\ + \mathbb {E} _ {I _ {s}, P _ {t}} \left[ \log \left(1 - D _ {s} \left(I _ {s}, G \left(I _ {s}, P _ {t}\right)\right)\right) \right. \tag {5} \\ \left. \cdot \left(1 - D _ {p} \left(P _ {t}, G \left(I _ {s}, P _ {t}\right)\right)\right) \right] \\ \end{array}
+$$
+
+Reconstruction and perceptual loss. The reconstruction loss $L_{rec}$ is used to encourage the generated image $\hat{I}_t$ to be similar with ground-truth $I_t$ at the pixel level, which is computed as $L_{rec} = \| \hat{I}_t - I_t\| _1$ . The perceptual loss calculates the $L_{1}$ distance between the features extracted from the pre-trained VGG-19 network [29]. It can be written as $L_{perc} = \sum_{i}\| \phi_{i}\left(\hat{I}_{t}\right) - \phi_{i}\left(I_{t}\right)\|_{1}$ , where $\phi_{i}$ is the feature map of the i-th layer of the pre-trained VGG-19 network.
+
+Contextual Loss. We also adopt contextual loss, which is first proposed in [22], aiming to measure the similarity between two non-aligned images for image transformation. It is computed in Eq (6).
+
+$$
+L _ {C X} = - \log \left(C X \left(F ^ {l} \left(\hat {I} _ {t}\right), F ^ {l} \left(I _ {t}\right)\right)\right) \tag {6}
+$$
+
+Here $F^l(\hat{I}_t)$ and $F^l(I_t)$ denotes the feature extracted from layer $l = \text{relu}\{3.2, 4.2\}$ of the pre-trained VGG-19 for images $\hat{I}_t$ and $I_t$ , respectively, and CX denotes the cosine similarity metric between features.
+
+LPIPS Loss. In order to reduce distortions and learn perceptual similarities, we integrate the LPIPS loss [45], which has been shown to better preserve image quality compared to the more standard perceptual loss:
+
+$$
+L _ {L P I P S} = \left\| F \left(\hat {I} _ {t}\right) - F \left(I _ {t}\right) \right\| _ {2} \tag {7}
+$$
+
+where $F(\cdot)$ denotes the perceptual feature extracted from pre-trained VGG-16 network.
+
+# 4 Experiments
+
+# 4.1 Experimental Setup
+
+Dataset. We carry out experiments on DeepFashion (In-shop Clothes Retrieval Benchmark) [18], which contains 52,712 high-quality person images with the resolution of $256 \times 256$ . Following the same data configuration in [50], we split this dataset into training and testing subsets with 101,966 and 8,570 pairs, respectively. Additionally, we use the segmentation masks obtained from the human parser [8]. Note that the person ID of the training and testing sets do not overlap. Evaluation Metrics. We employ four metrics SSIM [37], FID [10], LPIPS [45] and PSNR for evaluation. Peak Signal to Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM) is the most commonly used in image generation task with known ground truths. The former utilizes the mean square error to give an overall evaluation, while the latter calculates the global variance and mean to assess the structural similarity. Meanwhile, Learned Perceptual Image Patch Similarity (LPIPS) is another metric to compute the distance between the generations and ground truths in the perceptual domain. Besides, Fréchet Inception Distance (FID) is employed to measure the realism of the generated images. It calculates the Wasserstein-2 distance between the distributions of the generated and real data.
+
+
+Fig. 4. Qualitative comparison between our method and other state-of-the-arts. The target ground truths and the synthesized results from each models are listed in rows.
+
+Implementation Details. Our method is implemented in PyTorch and trained 2 NVIDIA Tesla-A100 GPUs with the batch size being equal to 16. We adopt Adam optimizer [14] with $\beta_{1} = 0.5$ , $\beta_{2} = 0.999$ to train our model for around 330k iterations, using the same epochs with other works [23]. The weights of the learning objectives are set as: $\lambda_{AMCE} = 0.1$ , $\lambda_{LPIPS} = 1$ , $\lambda_{rec} = 1$ , $\lambda_{perc} = 1$ , $\lambda_{adv} = 5$ and $\lambda_{CX} = 0.1$ , without tuning. The number of semantic parts is $N_{s} = 8$ , which includes the ordinary semantics as background, pants, hair, glove, face, dress, arms and legs. Furthermore, the learning rate is initially set to 0.001, and linearly decayed to 0 after 115k iterations. Following above configuration, we alternatively optimize the generator and two discriminators. We train our model for pose transfer task as described in Sec 3, after the convergence of training, we use the same trained model for all tasks, e.g., pose transfer, virtual try-on, head identity) swapping and parsing map generation.
+
+# 4.2 Pose Transfer
+
+In this section, we compare our method with several state-of-the-art methods, including PATN [50], GFLA [26], ADGAN [23], PISE [43], SPGNet [19] and CoCosNet [44]. Quantitative and qualitative results as well as user study are conducted to verify the effectiveness of our method. All the results are obtained by directly using the source code and well-trained models published by their authors. Since CoCosNet uses a different train/test split, we directly use its well-trained model on our test set.
+
+Quantitative comparison. The quantitative results are listed in Table 1. Notably, our method achieves the best performance on most metrics compared with the other methods, which can be attributed to the proposed CASD block.
+
+Table 1. Comparisons on metrics for image quality and user study. SSIM, FID, LPIPS and PSNR are the quantitative metrics for synthesized images. R2G, G2R and Jab are metrics computed from users' feedback.
+
+| Models | SSIM↑ | FID↓ | LPIPS↓ | PSNR↑ | R2G↑ | G2R↑ | Jab↑ |
| PATN [50] | 0.6709 | 20.7509 | 0.2562 | 31.14 | 19.14 | 31.78 | 0.26% |
| GFLA [26] | 0.7074 | 10.5730 | 0.2341 | 31.42 | 19.53 | 35.07 | 13.72% |
| ADGAN [23] | 0.6721 | 14.4580 | 0.2283 | 31.28 | 23.49 | 38.67 | 11.17% |
| PISE [43] | 0.6629 | 13.6100 | 0.2059 | 31.33 | - | - | 14.89% |
| SPGNet [19] | 0.6770 | 12.2430 | 0.2105 | 31.22 | 19.47 | 36.80 | 17.26% |
| CoCosNet [44] | 0.6746 | 14.6742 | 0.2437 | 31.07 | - | - | 13.73% |
| Ours | 0.7248 | 11.3732 | 0.1936 | 31.67 | 24.67 | 40.52 | 28.96% |
+
+Qualitative comparison. In Fig 4, we compare the generated results from different methods. It can be observed that our method produces more realistic and reasonable results (e.g., the second, third and penultimate rows). More importantly, our model can well retain the details from the source image (e.g., the fourth and last rows). Moreover, even if target pose is complex (e.g., the first row), our method can still generate it precisely.
+
+User study. While both quantitative and qualitative comparisons can evaluate the performance of the generated results in different aspects, human pose transfer tasks tend to be user-oriented. Therefore, we conduct a user study with 30 volunteers to evaluate the performance in terms of human perception. The user study consists of two parts. (i) Comparison with ground-truths. Following [19], we randomly select 30 real images and 30 generated images from test set and shuffle them. Volunteers are required to determine whether a given image is real or fake within a second. (ii) Comparison with the other methods, we present volunteers 30 random selected image pairs that include source image, target pose, ground-truth and images generated by our method and baselines. Volunteers are asked to select the most realistic and reasonable image with respect to the source image and ground truth. Note that we shuffle all the generated images for fairness. The results are shown in the right part of Table 1. Here we adopt three metrics, namely R2G: the percentage of the real images treated as the generated images; G2R: the percentage of the generated images treated as real images; Jab: the percentage of images judged to be the best among all models. Higher values of these three metrics mean better performance. We can observe that our model achieves the best results, especially about $11\%$ higher than the 2-nd best one on Jab.
+
+# 4.3 Ablation Study
+
+In this section, we perform ablation study to further verify our assumptions and evaluate the contribution of each component in our model. We implement 3 variants by alternatively removing a specific component from the full model (w/o self-attn, w/o $AM_{p}$ , w/o $L_{AMCE}$ ).
+
+
+Fig. 5. The qualitative results of ablation study. The ground truths and the synthesize images from each ablation model are listed in columns.
+
+Table 2. Quantitative ablations on each proposed component in the full model. The performances of the final model are given the last row. In the above three rows, we intentionally exclude one component from the full model. Details are given in Sec 4.3.
+
+| Model | SSIM↑ | FID↓ | LPIPS↓ | PSNR↑ |
| w/o self-attn | 0.7201 | 13.2462 | 0.2017 | 31.52 |
| w/o AMp | 0.7213 | 12.4265 | 0.1985 | 31.48 |
| w/o LAMCE | 0.7156 | 14.7513 | 0.2126 | 31.41 |
| Ours-Full | 0.7248 | 11.3732 | 0.1936 | 31.67 |
+
+W/o self-attn. This model removes self attention in CASD blocks, only uses cross attention, which directly feeds $F_{s}$ into cross attention as Key and Value.
+
+$\mathbf{W} / \mathbf{o}$ $AM_{p}$ . The model removes $AM_{p} = \mathrm{Proj}(Q)$ in CASD blocks in Eq (2), which will not let the model predict the attention matrix based on the target pose.
+
+$\mathbf{W} / \mathbf{o}$ $L_{AMCE}$ . The model does not adopt $L_{AMCE}$ loss defined in Eq (4) for training, so it can not be explicitly guided by the target parsing map during cross attention.
+
+Full model. It includes all components and achieves the best performance on all quantitative metrics, as is shown Table 2. Meanwhile, it also gives the best visual results as is shown in Fig 5. It's shown that by removing any parts of our proposed model would lead to a performance drop.
+
+
+Fig. 6. The visual comparisons with other state-of-the-art methods on virtual try-on.
+
+Table 3. Comparisons of the FID score and user study with other state-of-the-art methods on virtual try-on and head identity) swapping tasks.
+
+| Method | Upper | Cloth | Pants | Head |
| FID↓ | Jab↑ | FID↓ | Jab↑ | FID↓ | Jab↑ | FID↓ | Jab↑ |
| ADGAN | 14.3720 | 24.67% | 14.4446 | 29.67% | 14.4596 | 23.58% | | |
| PISE | 14.0537 | 22.92% | 14.2874 | 22.25% | 14.3647 | 30.75% | | |
| Ours | 12.5376 | 52.41% | 12.5456 | 48.08% | 12.6578 | 45.67% | | |
+
+# 4.4 Virtual Try-on and Head Swapping
+
+Benefiting from the semantic region style encoder, our model can also achieve controllable person image synthesis based on reference images by exchanging the channel feature of specific semantic region in the style features (e.g., upper-body transfer, lower-body transfer and head swapping) without further training. We compare our method with ADGAN [23] and PISE [43]. The visual comparisons are shown in Fig 6. We observe that our model can reconstruct target part and retain other remaining parts more faithfully. In addition, when transferring the lower-body, PISE cannot transfer the target pants to the source person, it will retain the shape of the source person's pants and only transfer the texture.
+
+For more comprehensive comparisons, quantitative comparison and user study are also conducted. The results are shown in Table 3. In the user study, we randomly select 40 results generated by our method and the other compared methods for each task, and then we invite 30 volunteers to select the most realistic results. Jab is the percentage of images judged to be the best among all methods.
+
+Table 4. Comparison of per-class IoU with SPGNet on the predicted target parsing maps.
+
+| Model | pants | hair | gloves | face | u-clothes | arms | legs | Bkg | Avg |
| SPGNet [19] | 42.18 | 66.51 | 9.36 | 62.46 | 67.87 | 58.46 | 44.13 | 84.65 | 61.89 |
| Ours | 49.02 | 65.87 | 5.50 | 67.24 | 76.72 | 59.90 | 50.81 | 90.28 | 66.34 |
+
+
+Fig. 7. Failure cases caused by incomprehensible garment (left) or pose (right).
+
+# 4.5 Target parsing map synthesis
+
+Moreover, to intuitively understand of our CASD blocks, we further show the predicted target parsing maps in Fig 1. It shows when given the source image and various target poses, our model can not only transfer the poses, but also synthesize the target parsing maps, though we do not separately build a model to do this. We list the Intersection over Union (IoU) metric between predictions from our method and [8] for all semantics in Table 4. For major semantics, we achieve higher IoU than SPGNet [19]. Note that our model gives the final synthesis images and target parsing map in one stage. The synthesized paired data can be used as training data for segmentation.
+
+# 5 Limitations
+
+Although our method produces impressive results in most cases, it still fails to generate incomprehensible garments and poses. As shown in Fig 7, a specific knot on a blouse fails to generate and a person in a rare pose can not be synthesized seamlessly. We believe that training the model with more various images will alleviate this problem.
+
+# 6 Conclusion
+
+This paper presents a cross attention based style distribution block for a single-stage controllable person image synthesis task, which has strong ability to align the source semantic styles with the target poses. The cross attention based style distribution block mainly consists of self and cross attention, which not only captures the source semantic styles accurately, but also aligns them to the target pose precisely. To achieve a clearer objective, the AMCE loss is proposed to constrain the attention matrix in cross attention by target parsing map. Extensive experiments and ablation studies show the satisfactory performance of our model, and the effectiveness of its components. Finally, we show that our model can be easily applied to virtual try-on and head identity) swapping tasks.
+
+# Acknowledgements
+
+This work is supported by the Science and Technology Commission of Shanghai Municipality No.19511120800, Natural Science Foundation of China No.61302125 and No.62102150, and ECNU Multifunctional Platform for Innovation(001).
+
+# References
+
+1. Balakrishnan, G., Zhao, A., Dalca, A.V., Durand, F., Guttag, J.: Synthesizing images of humans in unseen poses. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 8340-8348 (2018)
+2. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European Conference on Computer Vision. pp. 213-229. Springer (2020)
+3. Dong, H., Liang, X., Shen, X., Wu, B., Chen, B.C., Yin, J.: Fw-gan: Flow-navigated warping gan for video virtual try-on. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 1161-1170 (2019)
+4. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+5. Esser, P., Sutter, E., Ommer, B.: A variational u-net for conditional appearance and shape generation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 8857-8866 (2018)
+6. Ge, Y., Li, Z., Zhao, H., Yin, G., Yi, S., Wang, X., Li, H.: Fd-gan: Pose-guided feature distilling gan for robust person re-identification. arXiv preprint arXiv:1810.02936 (2018)
+7. Ge, Y., Song, Y., Zhang, R., Ge, C., Liu, W., Luo, P.: Parser-free virtual try-on via distilling appearance flows. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8485-8493 (2021)
+8. Gong, K., Liang, X., Zhang, D., Shen, X., Lin, L.: Look into person: Self-supervised structure-sensitive learning and a new benchmark for human parsing. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 932-940 (2017)
+9. Han, X., Wu, Z., Wu, Z., Yu, R., Davis, L.S.: Viton: An image-based virtual try-on network. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7543-7552 (2018)
+0. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems 30 (2017)
+1. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7132-7141 (2018)
+2. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1501-1510 (2017)
+3. Huang, Z., Wang, X., Huang, L., Huang, C., Wei, Y., Liu, W.: Cnet: Criss-cross attention for semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 603-612 (2019)
+4. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+5. Li, Y., Huang, C., Loy, C.C.: Dense intrinsic appearance flow for human pose transfer. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3693-3702 (2019)
+6. Liu, W., Piao, Z., Min, J., Luo, W., Ma, L., Gao, S.: Liquid warping gan: A unified framework for human motion imitation, appearance transfer and novel view synthesis. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 5904-5913 (2019)
+
+17. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030 (2021)
+18. Liu, Z., Luo, P., Qiu, S., Wang, X., Tang, X.: Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In: Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (June 2016)
+19. Lv, Z., Li, X., Li, X., Li, F., Lin, T., He, D., Zuo, W.: Learning semantic person image generation by region-adaptive normalization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10806-10815 (2021)
+20. Ma, L., Jia, X., Sun, Q., Schiele, B., Tuytelaars, T., Van Gool, L.: Pose guided person image generation. arXiv preprint arXiv:1705.09368 (2017)
+21. Ma, L., Sun, Q., Georgoulis, S., Van Gool, L., Schiele, B., Fritz, M.: Disentangled person image generation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 99-108 (2018)
+22. Mechrez, R., Talmi, I., Zelnik-Manor, L.: The contextual loss for image transformation with non-aligned data. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 768-783 (2018)
+23. Men, Y., Mao, Y., Jiang, Y., Ma, W.Y., Lian, Z.: Controllable person image synthesis with attribute-decomposed gan. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5084-5093 (2020)
+24. Park, T., Liu, M.Y., Wang, T.C., Zhu, J.Y.: Semantic image synthesis with spatially-adaptive normalization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2337-2346 (2019)
+25. Pumarola, A., Agudo, A., Sanfeliu, A., Moreno-Noguer, F.: Unsupervised person image synthesis in arbitrary poses. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 8620-8628 (2018)
+26. Ren, Y., Yu, X., Chen, J., Li, T.H., Li, G.: Deep image spatial transformation for person image generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7690-7699 (2020)
+27. Sanyal, S., Vorobiov, A., Bolkart, T., Loper, M., Mohler, B., Davis, L.S., Romero, J., Black, M.J.: Learning realistic human reposing using cyclic self-supervision with 3d shape, pose, and appearance consistency. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 11138-11147 (2021)
+28. Siarohin, A., Sangineto, E., Lathuiliere, S., Sebe, N.: Deformable gans for pose-based human image generation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3408-3416 (2018)
+29. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+30. Song, S., Zhang, W., Liu, J., Mei, T.: Unsupervised person image generation with semantic parsing transformation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2357-2366 (2019)
+31. Tang, H., Bai, S., Zhang, L., Torr, P.H., Sebe, N.: Xinggan for person image generation. In: European Conference on Computer Vision. pp. 717-734. Springer (2020)
+32. Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., Jégou, H.: Training data-efficient image transformers & distillation through attention. In: International Conference on Machine Learning. pp. 10347-10357. PMLR (2021)
+33. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+
+34. Wang, B., Zheng, H., Liang, X., Chen, Y., Lin, L., Yang, M.: Toward characteristic-preserving image-based virtual try-on network. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 589-604 (2018)
+35. Wang, W., Xie, E., Li, X., Fan, D.P., Song, K., Liang, D., Lu, T., Luo, P., Shao, L.: Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122 (2021)
+36. Wang, X., Girshick, R., Gupta, A., He, K.: Non-local neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7794-7803 (2018)
+37. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing 13(4), 600-612 (2004)
+38. Wei, L., Zhang, S., Gao, W., Tian, Q.: Person transfer gan to bridge domain gap for person re-identification. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 79-88 (2018)
+39. Xu, W., Long, C., Wang, R., Wang, G.: Drb-gan: A dynamic resblock generative adversarial network for artistic style transfer. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 6383-6392 (2021)
+40. Yang, C., Wang, Z., Zhu, X., Huang, C., Shi, J., Lin, D.: Pose guided human video generation. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 201-216 (2018)
+41. Yang, L., Wang, P., Liu, C., Gao, Z., Ren, P., Zhang, X., Wang, S., Ma, S., Hua, X., Gao, W.: Towards fine-grained human pose transfer with detail replenishing network. IEEE Transactions on Image Processing 30, 2422-2435 (2021)
+42. Yin, M., Sun, L., Li, Q.: Novel view synthesis on unpaired data by conditional deformable variational auto-encoder. In: European Conference on Computer Vision. pp. 87-103. Springer (2020)
+43. Zhang, J., Li, K., Lai, Y.K., Yang, J.: Pise: Person image synthesis and editing with decoupled gan. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7982-7990 (2021)
+44. Zhang, P., Zhang, B., Chen, D., Yuan, L., Wen, F.: Cross-domain correspondence learning for exemplar-based image translation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5143-5153 (2020)
+45. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 586-595 (2018)
+46. Zheng, S., Lu, J., Zhao, H., Zhu, X., Luo, Z., Wang, Y., Fu, Y., Feng, J., Xiang, T., Torr, P.H., et al.: Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6881-6890 (2021)
+47. Zheng, Z., Zheng, L., Yang, Y.: Unlabeled samples generated by gan improve the person re-identification baseline in vitro. In: Proceedings of the IEEE international conference on computer vision. pp. 3754-3762 (2017)
+48. Zhou, X., Zhang, B., Zhang, T., Zhang, P., Bao, J., Chen, D., Zhang, Z., Wen, F.: Cocosnet v2: Full-resolution correspondence learning for image translation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11465-11475 (2021)
+49. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J.: Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159 (2020)
+
+50. Zhu, Z., Huang, T., Shi, B., Yu, M., Wang, B., Bai, X.: Progressive pose attention transfer for person image generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2347-2356 (2019)
\ No newline at end of file
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/images.zip b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c2ad7ee210c17acf57b59057177bab5b61625405
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f3ea2d9ed93ea8fe47fdc85145f0f193d12908779316a3f01f2ecddab754c591
+size 509390
diff --git a/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/layout.json b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b0c2ef340a088b75bc0ff80f2176f5f5de26edf9
--- /dev/null
+++ b/crossattentionbasedstyledistributionforcontrollablepersonimagesynthesis/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7aa12b7cbe368a6b65b64da58b01e210acc1794fa694053022e11a120f47061c
+size 459075
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_content_list.json b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1dfa4261e915bb9be0ac7433b71449f9eb62d5f2
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:02fd0aa70ed3317100bb100746d612190b50fa05a78851aeb0b6e13377002d91
+size 83586
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_model.json b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f2df6d48f967402d3efd62f6afbe4d8cc8353da9
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:deef5b17313a06ebb754fcdaff31bfd2e469b91ac3b40b54712e4eae9daba92c
+size 101628
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_origin.pdf b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c7ff9b6e13dd10e280e8d41ec2ccb75c0804af22
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/2d221f78-40f9-41cc-b261-aa90e363b2b3_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cc4f804f29a41f97d10f24813df00772d991f6eebadf913cdf0ef4ead4e15574
+size 7667549
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/full.md b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..00f9238090d24711c39c457fa0bce661d844228a
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/full.md
@@ -0,0 +1,316 @@
+# Cross-Attention of Disentangled Modalities for 3D Human Mesh Recovery with Transformers
+
+Junhyeong Cho1
+
+Kim Youwang $^{2}$
+
+Tae-Hyun Oh $^{2,3,*}$
+
+$^{1}$ Department of CSE $^{2}$ Department of EE $^{3}$ Graduate School of AI Pohang University of Science and Technology (POSTECH), Korea {junhyeong99, youwang.kim, taehyun}@postech.ac.kr https://github.com/postech-ami/FastMETRO
+
+Abstract. Transformer encoder architectures have recently achieved state-of-the-art results on monocular 3D human mesh reconstruction, but they require a substantial number of parameters and expensive computations. Due to the large memory overhead and slow inference speed, it is difficult to deploy such models for practical use. In this paper, we propose a novel transformer encoder-decoder architecture for 3D human mesh reconstruction from a single image, called FastMETRO. We identify the performance bottleneck in the encoder-based transformers is caused by the token design which introduces high complexity interactions among input tokens. We disentangle the interactions via an encoder-decoder architecture, which allows our model to demand much fewer parameters and shorter inference time. In addition, we impose the prior knowledge of human body's morphological relationship via attention masking and mesh upsampling operations, which leads to faster convergence with higher accuracy. Our FastMETRO improves the Pareto-front of accuracy and efficiency, and clearly outperforms image-based methods on Human3.6M and 3DPW. Furthermore, we validate its generalizability on FreiHAND.
+
+# 1 Introduction
+
+3D human pose and shape estimation models aim to estimate 3D coordinates of human body joints and mesh vertices. These models can be deployed in a wide range of applications that require human behavior understanding, e.g., human motion analysis and human-computer interaction. To utilize such models for practical use, monocular methods [2,8,15,16,20-22,24,25,34,36,40,44] estimate the 3D joints and vertices without using 3D scanners or stereo cameras. This task is essentially challenging due to complex human body articulation, and becomes more difficult by occlusions and depth ambiguity in monocular settings.
+
+To deal with such challenges, state-of-the-art methods [24,25] exploit non-local relations among human body joints and mesh vertices via transformer encoder architectures. This leads to impressive improvements in accuracy by consuming a substantial number of parameters and expensive computations as trade-offs; efficiency is less taken into account, although it is crucial in practice.
+
+
+(a) Model Size $(\downarrow)$ vs. Reconstruction Error $(\downarrow)$
+
+
+(b) Inference Speed $(\uparrow)$ vs. Reconstruction Error $(\downarrow)$
+Fig.1. Comparison with encoder-based transformers [24, 25] and our models on Human3.6M [14]. Our FastMETRO substantially improves the Pareto-front of accuracy and efficiency. $\dagger$ indicates training for 60 epochs, and $*$ denotes training for 200 epochs.
+
+In this paper, we propose FastMETRO which employs a novel transformer encoder-decoder architecture for 3D human pose and shape estimation from an input image. Compared with the transformer encoders [24, 25], FastMETRO is more practical because it achieves competitive results with much fewer parameters and faster inference speed, as shown in Figure 1. Our architecture is motivated by the observation that the encoder-based methods overlook the importance of the token design which is a key-factor in accuracy and efficiency.
+
+The encoder-based transformers [24, 25] share similar transformer encoder architectures. They take $K$ joint and $N$ vertex tokens as input for the estimation of 3D human body joints and mesh vertices, where $K$ and $N$ denote the number of joints and vertices in a 3D human mesh, respectively. Each token is constructed by the concatenation of a global image feature vector $\mathbf{x} \in \mathbb{R}^C$ and 3D coordinates of a joint or vertex in the human mesh. This results in the input tokens of dimension $\mathbb{R}^{(K + N) \times (C + 3)}$ which are fed as input to the transformer encoders. This token design introduces the same sources of the performance bottleneck: 1) spatial information is lost in the global image feature $\mathbf{x}$ , and 2) the same image feature $\mathbf{x}$ is used in an overly-duplicated way. The former is caused by the average pooling operation to obtain the global image feature $\mathbf{x}$ . The latter leads to considerable inefficiency, since expensive computations are required to process mostly duplicated information, where distinctively informative signals are only in $0.15\%$ of the input tokens. Furthermore, the computational complexity of each transformer layer is quadratic as $O(L^2 C + LC^2)$ , where $L \geq K + N$ . Once either $L$ or $C$ is dominantly larger, it results in unfavorable efficiency. Both methods [24, 25] are such undesirable cases.
+
+
+Fig. 2. Overall architecture of FastMETRO. Our model estimates 3D coordinates of human body joints and mesh vertices from a single image. We extract image features via a CNN backbone, which are fed as input to our transformer encoder. In addition to image features produced by the encoder, our transformer decoder takes learnable joint and vertex tokens as input. To effectively learn non-local joint-vertex relations and local vertex-vertex relations, we mask self-attention of non-adjacent vertices according to the topology of human triangle mesh. Following [24, 25], we progressively reduce the hidden dimension sizes via linear projections in our transformer.
+
+In contrast, our FastMETRO does not concatenate an image feature vector for the construction of input tokens. As illustrated in Figure 2, we disentangle the image encoding part and mesh estimation part via an encoder-decoder architecture. Our joint and vertex tokens focus on certain image regions through cross-attention modules in the transformer decoder. In this way, the proposed method efficiently estimates the 3D coordinates of human body joints and mesh vertices from a 2D image. To effectively capture non-local joint-vertex relations and local vertex-vertex relations, we mask self-attentionions of non-adjacent vertices according to the topology of human triangle mesh. To avoid the redundancy caused by the spatial locality of human mesh vertices, we perform coarse-to-fine mesh upsampling as in [22, 24, 25]. By leveraging the prior knowledge of human body's morphological relationship, we substantially reduce optimization difficulty. This leads to faster convergence with higher accuracy.
+
+We present the proposed method with model-size variants by changing the number of transformer layers: FastMETRO-S, FastMETRO-M, FastMETRO-L. Compared with the encoder-based transformers [24, 25], FastMETRO-S requires only about $9\%$ of the parameters in the transformer architecture, but shows competitive results with much faster inference speed. In addition, the large variant (FastMETRO-L) achieves the state of the art on the Human3.6M [14] and 3DPW [32] datasets among image-based methods, which also demands fewer parameters and shorter inference time compared with the encoder-based methods. We demonstrate the effectiveness of the proposed method by conducting extensive experiments, and validate its generalizability by showing 3D hand mesh reconstruction results on the FreiHAND [47] dataset.
+
+Our contributions are summarized as follows:
+
+- We propose FastMETRO which employs a novel transformer encoder-decoder architecture for 3D human mesh recovery from a single image. Our method resolves the performance bottleneck in the encoder-based transformers, and improves the Pareto-front of accuracy and efficiency.
+- The proposed model converges much faster by reducing optimization difficulty. Our FastMETRO leverages the prior knowledge of human body's morphological relationship, e.g., masking attentions according to the human mesh topology.
+- We present model-size variants of our FastMETRO. The small variant shows competitive results with much fewer parameters and faster inference speed. The large variant clearly outperforms existing image-based methods on the Human3.6M and 3DPW datasets, which is also more lightweight and faster.
+
+# 2 Related Work
+
+Our proposed method aims to estimate the 3D coordinates of human mesh vertices from an input image by leveraging the attention mechanism in the transformer architecture. We briefly review relevant methods in this section.
+
+Human Mesh Reconstruction. The reconstruction methods belong to one of the two categories: parametric approach and non-parametric approach. The parametric approach learns to estimate the parameters of a human body model such as SMPL [29]. On the other hand, the non-parametric approach learns to directly regress the 3D coordinates of human mesh vertices. They obtain the 3D coordinates of human body joints via linear regression from the estimated mesh.
+
+The reconstruction methods in the parametric approach [2,8,11,15,16,20,21, 36,40,44] have shown stable performance in monocular 3D human mesh recovery. They have achieved the robustness to environment variations by exploiting the human body prior encoded in a human body model such as SMPL [29]. However, their regression targets are difficult for deep neural networks to learn; the pose space in the human body model is expressed by the 3D rotations of human body joints, where the regression of the 3D rotations is challenging [31].
+
+Recent advances in deep neural networks have enabled the non-parametric approach with promising performance [6, 22, 24, 25, 34]. Kolotouros et al. [22] propose a graph convolutional neural network (GCNN) [18] to effectively learn local vertex-vertex relations, where the graph structure is based on the topology of SMPL human triangle mesh [29]. They extract a global image feature vector through a CNN backbone, then construct vertex embeddings by concatenating the image feature vector with the 3D coordinates of vertices in the human mesh. After iterative updates via graph convolutional layers, they estimate the 3D locations of human mesh vertices. To improve the robustness to partial occlusions, Lin et al. [24, 25] propose transformer encoder architectures which effectively learn the non-local relations among human body joints and mesh vertices via the attention mechanism in the transformer. Their models, METRO [24] and Mesh Graphormer [25], follow the similar framework with the GCNN-based method [22]. They construct vertex tokens by attaching a global image feature vector to the 3D
+
+coordinates of vertices in the human mesh. After several updates via transformer encoder layers, they regress the 3D coordinates of human mesh vertices.
+
+Among the reconstruction methods, METRO [24] and Mesh Graphormer [25] are the most relevant work to our FastMETRO. We found that the token design in those methods leads to a substantial number of unnecessary parameters and computations. In their architectures, transformer encoders take all the burdens to learn complex relations among mesh vertices, along with the highly non-linear mapping between 2D space and 3D space. To resolve this issue, we disentangle the image-encoding and mesh-estimation parts via an encoder-decoder architecture. This makes FastMETRO more lightweight and faster, and allows our model to learn the complex relations more effectively.
+
+Transformers. Vaswani et al. [41] introduce a transformer architecture which effectively learns long-range relations through the attention mechanism in the transformer. This architecture has achieved impressive improvements in diverse computer vision tasks [3-5,7,12,17,24,25,27,28,30,38,43,45]. Dosovitskiy et al. [7] present a transformer encoder architecture, where a learnable token aggregates image features via self-attention for image classification. Carion et al. [3] propose a transformer encoder-decoder architecture, where learnable tokens focus on certain image regions via cross-attention for object detection. Those transformers have the most relevant architectures to our model.
+
+Our FastMETRO employs a transformer encoder-decoder architecture, whose decoupled structure is favorable to learn the complex relations between the heterogeneous modalities of 2D image and 3D mesh. Compared with the existing transformers [3-5, 7, 12, 17, 27, 30, 38, 43, 45], we progressively reduce hidden dimension sizes in the transformer architecture as in [24, 25]. Our separate decoder design enables FastMETRO to easily impose the human body prior by masking self-attention of decoder input tokens, which leads to stable optimization and higher accuracy. This is novel in transformer architectures.
+
+# 3 Method
+
+We propose a novel method, called Fast MEsh TRansfOrmer (FastMETRO). FastMETRO has a transformer encoder-decoder architecture for 3D human mesh recovery from an input image. The overview of our method is shown in Figure 2. The details of our transformer encoder and decoder are illustrated in Figure 3.
+
+# 3.1 Feature Extractor
+
+Given a single RGB image, our model extracts image features $\mathbf{X}_I \in \mathbb{R}^{H \times W \times C}$ through a CNN backbone, where $H \times W$ denotes the spatial dimension size and $C$ denotes the channel dimension size. A $1 \times 1$ convolution layer takes the image features $\mathbf{X}_I$ as input, and reduces the channel dimension size to $D$ . Then, a flatten operation produces flattened image features $\mathbf{X}_F \in \mathbb{R}^{HW \times D}$ . Note that we employ positional encodings for retaining spatial information in our transformer, as illustrated in Figure 3.
+
+
+(a) Transformer Encoder-Decoder Architecture
+Fig. 3. Details of our transformer architecture and 3D human body mesh. For simplicity, we illustrate the transformer without progressive dimensionality reduction. Note that the camera feature is not fed as input to the decoder. We mask attentions using the adjacency matrix obtained from the human triangle mesh of SMPL [29].
+
+
+(b) Human Body Joints and Mesh Topology
+
+# 3.2 Transformer with Progressive Dimensionality Reduction
+
+Following the encoder-based transformers [24, 25], FastMETRO progressively reduces the hidden dimension sizes in the transformer architecture via linear projections, as illustrated in Figure 2.
+
+Transformer Encoder. Our transformer encoder (Figure 3a) takes a learnable camera token and the flattened image features $\mathbf{X}_F$ as input. The camera token captures essential features to predict weak-perspective camera parameters through the attention mechanism in the transformer; the camera parameters are used for fitting the 3D estimated human mesh to the 2D input image. Given the camera token and image features, the transformer encoder produces a camera feature and aggregated image features $\mathbf{X}_A \in \mathbb{R}^{HW \times D}$ .
+
+Transformer Decoder. In addition to the image features $\mathbf{X}_A$ obtained from the encoder, our transformer decoder (Figure 3a) takes the set of learnable joint tokens and the set of learnable vertex tokens as input. Each token in the set of joint tokens $\mathcal{T}_J = \{\mathbf{t}_1^J,\mathbf{t}_2^J,\dots ,\mathbf{t}_K^J\}$ is used to estimate 3D coordinates of a human body joint, where $\mathbf{t}_i^J\in \mathbb{R}^D$ . The joint tokens correspond to the body joints in Figure 3b. Each token in the set of vertex tokens $\mathcal{T}_V = \{\mathbf{t}_1^V,\mathbf{t}_2^V,\dots ,\mathbf{t}_N^V\}$ is used to estimate 3D coordinates of a human mesh vertex, where $\mathbf{t}_j^V\in \mathbb{R}^D$ . The vertex tokens correspond to the mesh vertices in Figure 3b. Given the image features and tokens, the transformer decoder produces joint features $\mathbf{X}_J\in \mathbb{R}^{K\times D}$ and vertex features $\mathbf{X}_V\in \mathbb{R}^{N\times D}$ through self-attention and cross-attention modules. Our transformer decoder effectively captures non-local relations among human
+
+body joints and mesh vertices via self-attention, which improves the robustness to environment variations such as occlusions. Regarding the joint and vertex tokens, each focuses on its relevant image region via cross-attention.
+
+Attention Masking based on Human Mesh Topology. To effectively capture local vertex-vertex and non-local joint-vertex relations, we mask self-attention of non-adjacent vertices according to the topology of human triangle mesh in Figure 3b. Although we mask the attentions of non-adjacent vertices, the coverage of each vertex token increases as it goes through decoder layers in the similar way with iterative graph convolutions. Note that GraphCMR [22] and Mesh Graphormer [25] perform graph convolutions based on the human mesh topology, which demands additional learnable parameters and computations.
+
+# 3.3 Regressor and Mesh Upsampling
+
+3D Coordinates Regressor. Our regressor takes the joint features $\mathbf{X}_J$ and vertex features $\mathbf{X}_V$ as input, and estimates the 3D coordinates of human body joints and mesh vertices. As a result, 3D joint coordinates $\hat{\mathbf{J}}_{\mathrm{3D}} \in \mathbb{R}^{K \times 3}$ and 3D vertex coordinates $\hat{\mathbf{V}}_{\mathrm{3D}} \in \mathbb{R}^{N \times 3}$ are predicted.
+
+Coarse-to-Fine Mesh Upsampling. Following [22, 24, 25], our FastMETRO estimates a coarse mesh, then upsample the mesh. In this way, we avoid the redundancy caused by the spatial locality of human mesh vertices. As in [22], FastMETRO obtains the fine mesh output $\hat{\mathbf{V}}_{3\mathrm{D}}^{\prime} \in \mathbb{R}^{M \times 3}$ from the coarse mesh output $\hat{\mathbf{V}}_{3\mathrm{D}}$ by performing matrix multiplication with the upsampling matrix $\mathbf{U} \in \mathbb{R}^{M \times N}$ , i.e., $\hat{\mathbf{V}}_{3\mathrm{D}}^{\prime} = \mathbf{U}\hat{\mathbf{V}}_{3\mathrm{D}}$ , where the upsampling matrix $\mathbf{U}$ is pre-computed by the sampling algorithm in [37].
+
+# 3.4 Training FastMETRO
+
+3D Vertex Regression Loss. To train our model for the regression of 3D mesh vertices, we use $L1$ loss function. This regression loss $L_{\mathrm{3D}}^V$ is computed by
+
+$$
+L _ {\mathrm {3 D}} ^ {V} = \frac {1}{M} \| \hat {\mathbf {V}} _ {\mathrm {3 D}} ^ {\prime} - \bar {\mathbf {V}} _ {\mathrm {3 D}} \| _ {1}, \tag {1}
+$$
+
+where $\bar{\mathbf{V}}_{3\mathrm{D}}\in \mathbb{R}^{M\times 3}$ denotes the ground-truth 3D vertex coordinates.
+
+3D Joint Regression Loss. In addition to the estimated 3D joints $\hat{\mathbf{J}}_{\mathrm{3D}}$ , we also obtain 3D joints $\hat{\mathbf{J}}_{\mathrm{3D}}^{\prime} \in \mathbb{R}^{K \times 3}$ regressed from the fine mesh $\hat{\mathbf{V}}_{\mathrm{3D}}^{\prime}$ , which is the common practice in the literature [6,8,16,20-22,24,25,34,40,44]. The regressed joints $\hat{\mathbf{J}}_{\mathrm{3D}}^{\prime}$ are computed by the matrix multiplication of the joint regression matrix $\mathbf{R} \in \mathbb{R}^{K \times M}$ and the fine mesh $\hat{\mathbf{V}}_{\mathrm{3D}}^{\prime}$ , i.e., $\hat{\mathbf{J}}_{\mathrm{3D}}^{\prime} = \mathbf{R}\hat{\mathbf{V}}_{\mathrm{3D}}^{\prime}$ , where the regression matrix $\mathbf{R}$ is pre-defined in SMPL [29]. To train our model for the regression of 3D body joints, we use $L1$ loss function. This regression loss $L_{\mathrm{3D}}^{J}$ is computed by
+
+$$
+L _ {\mathrm {3 D}} ^ {J} = \frac {1}{K} \left(\| \hat {\mathbf {J}} _ {\mathrm {3 D}} - \bar {\mathbf {J}} _ {\mathrm {3 D}} \| _ {1} + \| \hat {\mathbf {J}} _ {\mathrm {3 D}} ^ {\prime} - \bar {\mathbf {J}} _ {\mathrm {3 D}} \| _ {1}\right), \tag {2}
+$$
+
+where $\bar{\mathbf{J}}_{3\mathrm{D}}\in \mathbb{R}^{K\times 3}$ denotes the ground-truth 3D joint coordinates.
+
+Table 1. Configurations for the variants of FastMETRO. Each has the same transformer architecture with a different number of layers. Only transformer parts are described.
+
+| Model | #Params | Time (ms) | Enc-1 & Dec-1 | Enc-2 & Dec-2 |
| #Layers | Dimension | #Layers | Dimension |
| FastMETRO-S | 9.2M | 9.6 | 1 | 512 | 1 | 128 |
| FastMETRO-M | 17.1M | 15.0 | 2 | 512 | 2 | 128 |
| FastMETRO-L | 24.9M | 20.8 | 3 | 512 | 3 | 128 |
+
+2D Joint Projection Loss. Following the literature [8, 16, 20-22, 24, 25, 40, 44], for the alignment between the 2D input image and the 3D reconstructed human mesh, we train our model to estimate weak-perspective camera parameters $\{s, \mathbf{t}\}$ ; a scaling factor $s \in \mathbb{R}$ and a 2D translation vector $\mathbf{t} \in \mathbb{R}^2$ . The weak-perspective camera parameters are estimated from the camera feature obtained by the transformer encoder. Using the camera parameters, we get 2D body joints via an orthographic projection of the estimated 3D body joints. The projected 2D body joints are computed by
+
+$$
+\hat {\mathbf {J}} _ {2 \mathrm {D}} = s \Pi (\hat {\mathbf {J}} _ {3 \mathrm {D}}) + \mathbf {t}, \tag {3}
+$$
+
+$$
+\mathbf {\hat {J}} _ {2 \mathrm {D}} ^ {\prime} = s \Pi (\mathbf {\hat {J}} _ {3 \mathrm {D}} ^ {\prime}) + \mathbf {t}, \tag {4}
+$$
+
+where $\Pi (\cdot)$ denotes the orthographic projection; $\left[ \begin{array}{ccc}1 & 0 & 0\\ 0 & 1 & 0 \end{array} \right]^{\top}\in \mathbb{R}^{3\times 2}$ is used for this projection in FastMETRO. To train our model with the projection of 3D body joints onto the 2D image, we use $L1$ loss function. This projection loss $L_{2\mathrm{D}}^J$ is computed by
+
+$$
+L _ {2 \mathrm {D}} ^ {J} = \frac {1}{K} \left(\| \hat {\mathbf {J}} _ {2 \mathrm {D}} - \bar {\mathbf {J}} _ {2 \mathrm {D}} \| _ {1} + \| \hat {\mathbf {J}} _ {2 \mathrm {D}} ^ {\prime} - \bar {\mathbf {J}} _ {2 \mathrm {D}} \| _ {1}\right), \tag {5}
+$$
+
+where $\bar{\mathbf{J}}_{2\mathrm{D}}\in \mathbb{R}^{K\times 2}$ denotes the ground-truth 2D joint coordinates.
+
+Total Loss. Following the literature [6, 8, 16, 19-22, 24, 25, 34, 40, 44], we train our model with multiple 3D and 2D training datasets to improve its accuracy and robustness. This total loss $L_{\mathrm{total}}$ is computed by
+
+$$
+L _ {\mathrm {t o t a l}} = \alpha \left(\lambda_ {\mathrm {3 D}} ^ {V} L _ {\mathrm {3 D}} ^ {V} + \lambda_ {\mathrm {3 D}} ^ {J} L _ {\mathrm {3 D}} ^ {J}\right) + \beta \lambda_ {\mathrm {2 D}} ^ {J} L _ {\mathrm {2 D}} ^ {J}, \tag {6}
+$$
+
+where $\lambda_{\mathrm{3D}}^{V}, \lambda_{\mathrm{3D}}^{J}, \lambda_{\mathrm{2D}}^{J} > 0$ are loss coefficients and $\alpha, \beta \in \{0,1\}$ are binary flags which denote the availability of ground-truth 3D and 2D coordinates.
+
+# 4 Implementation Details
+
+We implement our proposed method with three variants: FastMETRO-S, FastMETRO-M, FastMETRO-L. They have the same architecture with a different number of layers in the transformer encoder and decoder. Table 1 shows the configuration for each variant. Our transformer encoder and decoder are initialized with Xavier Initialization [9]. Please refer to the supplementary material for complete implementation details.
+
+Table 2. Comparison with transformers for monocular 3D human mesh recovery on Human3.6M [14]. † and * indicate training for 60 epochs and 200 epochs, respectively.
+
+| Model | CNN Backbone | Transformer | Overall | PA-MPJPE ↓ |
| #Params | Time (ms) | #Params | Time (ms) | #Params | FPS |
| METRO-R50* [24] | 23.5M | 7.5 | 102.3M | 24.2 | 125.8M | 31.5 | 40.6 |
| METRO-H64† [24] | 128.1M | 49.0 | 102.3M | 24.2 | 230.4M | 13.7 | 38.0 |
| METRO-H64* [24] | 128.1M | 49.0 | 102.3M | 24.2 | 230.4M | 13.7 | 36.7 |
| MeshGraphormer-H64† [25] | 128.1M | 49.0 | 98.4M | 24.5 | 226.5M | 13.6 | 35.8 |
| MeshGraphormer-H64* [25] | 128.1M | 49.0 | 98.4M | 24.5 | 226.5M | 13.6 | 34.5 |
| FastMETRO-S-R50† | 23.5M | 7.5 | 9.2M | 9.6 | 32.7M | 58.5 | 39.4 |
| FastMETRO-M-R50† | 23.5M | 7.5 | 17.1M | 15.0 | 40.6M | 44.4 | 38.6 |
| FastMETRO-L-R50† | 23.5M | 7.5 | 24.9M | 20.8 | 48.4M | 35.3 | 37.3 |
| FastMETRO-L-H64† | 128.1M | 49.0 | 24.9M | 20.8 | 153.0M | 14.3 | 33.7 |
+
+
+(a) Model Size $(\downarrow)$ vs. Inference Speed $(\uparrow)$
+
+
+(b) Convergence Curve
+Fig. 4. Comparison with encoder-based transformers [24, 25] and our proposed models on Human3.6M [14]. The small variant of our FastMETRO shows much faster inference speed, and its large variant converges faster than the transformer encoders.
+
+# 5 Experiments
+
+# 5.1 Datasets
+
+Following the encoder-based transformers [24, 25], we train our FastMETRO with Human3.6M [14], UP-3D [23], MuCo-3DHP [33], COCO [26] and MPII [1] training datasets, and evaluate the model on P2 protocol in Human3.6M. Then, we fine-tune our model with 3DPW [32] training dataset, and evaluate the model on its test dataset.
+
+Following the common practice [6,24,25,34], we employ the pseudo 3D human mesh obtained by SMPLify-X [35] to train our model with Human3.6M [14]; there is no available ground-truth 3D human mesh in the Human3.6M training dataset due to the license issue. For fair comparison, we employ the ground-truth 3D human body joints in Human3.6M during the evaluation of our model. Regarding the experiments on 3DPW [32], we use its training dataset for fine-tuning our model as in the encoder-based transformers [24,25].
+
+Table 3. Comparison with the state-of-the-art monocular 3D human pose and mesh recovery methods on 3DPW [32] and Human3.6M [14] among image-based methods.
+
+| Model | 3DPW | Human3.6M |
| MPVPE ↓ | MPJPE ↓ | PA-MPJPE ↓ | MPJPE ↓ | PA-MPJPE ↓ |
| HMR-R50 [16] | - | 130.0 | 76.7 | 88.0 | 56.8 |
| GraphCMR-R50 [22] | - | - | 70.2 | - | 50.1 |
| SPIN-R50 [21] | 116.4 | 96.9 | 59.2 | 62.5 | 41.1 |
| I2LMeshNet-R50 [34] | - | 93.2 | 57.7 | 55.7 | 41.1 |
| PyMAF-R50 [44] | 110.1 | 92.8 | 58.9 | 57.7 | 40.5 |
| ROMP-R50 [40] | 105.6 | 89.3 | 53.5 | - | - |
| ROMP-H32 [40] | 103.1 | 85.5 | 53.3 | - | - |
| PARE-R50 [20] | 99.7 | 82.9 | 52.3 | - | - |
| METRO-R50 [24] | - | - | - | 56.5 | 40.6 |
| DSR-R50 [8] | 99.5 | 85.7 | 51.7 | 60.9 | 40.3 |
| METRO-H64 [24] | 88.2 | 77.1 | 47.9 | 54.0 | 36.7 |
| PARE-H32 [20] | 88.6 | 74.5 | 46.5 | - | - |
| MeshGraphormer-H64 [25] | 87.7 | 74.7 | 45.6 | 51.2 | 34.5 |
| FastMETRO-S-R50 | 91.9 | 79.6 | 49.3 | 55.7 | 39.4 |
| FastMETRO-M-R50 | 91.2 | 78.5 | 48.4 | 55.1 | 38.6 |
| FastMETRO-L-R50 | 90.6 | 77.9 | 48.3 | 53.9 | 37.3 |
| FastMETRO-L-H64 | 84.1 | 73.5 | 44.6 | 52.2 | 33.7 |
+
+# 5.2 Evaluation Metrics
+
+We evaluate our FastMETRO using three evaluation metrics: MPJPE [14], PA-MPJPE [46], MPVPE [36]. The unit of each metric is millimeter.
+
+MPJPE. This metric denotes Mean-Per-Joint-Position-Error. It measures the Euclidean distances between the predicted and ground-truth joint coordinates.
+
+PA-MPJPE. This metric is often called Reconstruction Error. It measures MPJPE after 3D alignment using Procrustes Analysis (PA) [10].
+
+MPVPE. This metric denotes Mean-Per-Vertex-Position-Error. It measures the Euclidean distances between the predicted and ground-truth vertex coordinates.
+
+# 5.3 Experimental Results
+
+We evaluate the model-size variants of our FastMETRO on the 3DPW [32] and Human3.6M [14] datasets. In this paper, the inference time is measured using a single NVIDIA V100 GPU with a batch size of 1.
+
+Comparison with Encoder-Based Transformers. In Table 2, we compare our models with METRO [24] and Mesh Graphomer [25] on the Human3.6M [14] dataset. Note that encoder-based transformers [24, 25] are implemented with ResNet-50 [13] (R50) or HRNet-W64 [42] (H64). FastMETRO-S outperforms METRO when both models employ the same CNN backbone (R50), although our model demands only $8.99\%$ of the parameters in the transformer architecture. Regarding the overall inference speed, our model is $1.86 \times$ faster. It is worth noting that FastMETRO-L-R50 achieves similar results with METRO-H64, but our model is $2.58 \times$ faster. FastMETRO-L outperforms Mesh Graphomer when both models employ the same CNN backbone (H64), while our model demands only $25.30\%$ of the parameters in the transformer architecture. Also, our model converges much faster than the encoder-based methods as shown in Figure 4.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Fig. 5. Qualitative results of our FastMETRO on Human3.6M [14] and 3DPW [32]. We visualize the 3D human mesh estimated by FastMETRO-L-H64. By leveraging the attention mechanism in the transformer, our model is robust to partial occlusions.
+
+
+
+
+
+Comparison with Image-Based Methods. In Table 3, we compare our FastMETRO with the image-based methods for 3D human mesh reconstruction on 3DPW [32] and Human3.6M [14]. Note that existing methods are implemented with ResNet-50 [13] (R50) or HRNet-W32 [42] (H32) or HRNet-W64 [42] (H64). When all models employ R50 as their CNN backbones, FastMETRO-S achieves the best results without iterative fitting procedures or test-time optimizations. FastMETRO-L-H64 achieves the state of the art in every evaluation metric on the 3DPW dataset and PA-MPJPE metric on the Human3.6M dataset.
+
+Visualization of Self-Attentions. In Figure 6, the first and second rows show the visualization of the attention scores in self-attention between a specified body joint and mesh vertices. We obtain the scores by averaging attention scores from all attention heads of all multi-head self-attention modules in our transformer decoder. As shown in Figure 6, our FastMETRO effectively captures the non-local relations among joints and vertices via self-attention in the transformer. This improves the robustness to environment variations such as occlusions.
+
+Visualization of Cross-Attentions. In Figure 6, the third and fourth rows show the visualization of the attention scores in cross-attentions between a specified body joint and image regions. We obtain the scores by averaging attention scores from all attention heads of all multi-head cross-attention modules in our transformer decoder. As shown in Figure 6, the input tokens used in our
+
+
+Fig. 6. Qualitative results of FastMETRO-L-H64 on COCO [26]. We visualize the attentions scores in self-attention (top two rows) and cross-attentions (bottom two rows). The brighter lines or regions indicate higher attention scores.
+
+transformer decoder focus on their relevant image regions. By leveraging the cross-attention between disentangled modalities, our FastMETRO effectively learns to regress the 3D coordinates of joints and vertices from a 2D image.
+
+# 5.4 Ablation Study
+
+We analyze the effects of different components in our FastMETRO as shown in Table 4. Please refer to the supplementary material for more experiments.
+
+Attention Masking. To effectively learn the local relations among mesh vertices, GraphCMR [22] and Mesh Graphormer [25] perform graph convolutions based on the topology of SMPL human triangle mesh [29]. For the same goal, we mask self-attention of non-adjacent vertices according to the topology. When we evaluate our model without masking the attentions, the regression accuracy drops as shown in the first row of Table 4. This demonstrates that masking the attentions of non-adjacent vertices is effective. To compare the effects of attention masking with graph convolutions, we train our model using graph convolutions without masking the attentions. As shown in the second row of Table 4, we obtain similar results but this requires more parameters. We also evaluate our model when we mask the attentions in half attention heads, i.e., there is no attention masking in other half attention heads. In this case, we get similar results using the same number of parameters as shown in the third row of Table 4.
+
+Table 4. Ablation study of our FastMETRO on Human3.6M [14]. The effects of different components are evaluated. The default model is FastMETRO-S-R50.
+
+| Model | #Params | Human3.6M |
| MPJPE ↓ | PA-MPJPE ↓ |
| w/o attention masking | 32.7M | 58.0 | 40.7 |
| w/o attention masking + w/ graph convolutions | 33.1M | 56.6 | 39.4 |
| w/ attention masking in half attention heads | 32.7M | 55.8 | 39.4 |
| w/ learnable upsampling layers | 45.4M | 58.1 | 41.1 |
| w/o progressive dimensionality reduction | 39.5M | 55.5 | 39.6 |
| FastMETRO-S-R50 | 32.7M | 55.7 | 39.4 |
+
+Coarse-to-Fine Mesh Upsampling. The existing transformers [24, 25] also first estimate a coarse mesh, then upsample the mesh to obtain a fine mesh. They employ two learnable linear layers for the upsampling. In our FastMETRO, we use the pre-computed upsampling matrix $\mathbf{U}$ to reduce optimization difficulty as in [22]; this upsampling matrix is a sparse matrix which has only about $25K$ non-zero elements. When we perform the mesh upsampling using learnable linear layers instead of the matrix $\mathbf{U}$ , the regression accuracy drops as shown in the fourth row of Table 4, although it demands much more parameters.
+
+Progressive Dimensionality Reduction. Following the existing transformer encoders [24, 25], we also progressively reduce the hidden dimension sizes in our transformer via linear projections. To evaluate its effectiveness, we train our model using the same number of transformer layers but without progressive dimensionality reduction, i.e., hidden dimension sizes in all transformer layers are the same. As shown in the fifth row of Table 4, we obtain similar results but this requires much more parameters. This demonstrates that the dimensionality reduction is helpful for our model to achieve decent results using fewer parameters. Generalizability. Our model can reconstruct any arbitrary 3D objects by changing the number of input tokens used in the transformer decoder. Note that we can employ learnable layers for coarse-to-fine mesh upsampling without masking attentions. For 3D hand mesh reconstruction, there is a pre-computed upsampling matrix and a human hand model such as MANO [39]. Thus, we can leverage the
+
+matrix for mesh upsampling and mask self-attention of non-adjacent vertices in the same way with 3D human mesh recovery. As illustrated in Figure 7, we can obtain an adjacency matrix and construct joint and vertex tokens from the human hand mesh topology. To validate the generalizability of our method, we train FastMETRO-L-H64 on the FreiHAND [47] training dataset and evaluate the model. As shown in Table 5, our proposed model achieves competitive results on FreiHAND.
+
+
+Fig. 7. Hand Joints and Mesh Topology.
+
+Table 5. Comparison with transformers for monocular 3D hand mesh recovery on FreiHAND [14]. Test-time augmentation is not applied to these transformers.
+
+| Model | Transformer
+#Params | Overall
+#Params | FreiHAND |
| PA-MPJPE ↓ | F@15mm ↑ |
| METRO-H64 [24] | 102.3M | 230.4M | 6.8 | 0.981 |
| FastMETRO-L-H64 | 24.9M | 153.0M | 6.5 | 0.982 |
+
+
+
+
+Fig. 8. Qualitative results of our FastMETRO on FreiHAND [47]. We visualize the 3D hand mesh estimated by FastMETRO-L-H64. By leveraging the attention mechanism in the transformer, our model is robust to partial occlusions.
+
+
+
+
+
+
+
+
+
+# 6 Conclusion
+
+We identify the performance bottleneck in the encoder-based transformers is due to the design of input tokens, and resolve this issue via an encoder-decoder architecture. This allows our model to demand much fewer parameters and shorter inference time, which is more appropriate for practical use. The proposed method leverages the human body prior encoded in SMPL human mesh, which reduces optimization difficulty and leads to faster convergence with higher accuracy. To be specific, we mask self-attention of non-adjacent vertices and perform coarse-to-fine mesh upsampling. We demonstrate that our method improves the Pareto-front of accuracy and efficiency. Our FastMETRO achieves the robustness to occlusions by capturing non-local relations among body joints and mesh vertices, which outperforms image-based methods on the Human3.6M and 3DPW datasets. A limitation is that a substantial number of samples are required to train our model as in the encoder-based transformers.
+
+Acknowledgments. This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2022-0-00290, Visual Intelligence for Space-Time Understanding and Generation based on Multi-layered Visual Common Sense; and No. 2019-0-01906, Artificial Intelligence Graduate School Program (POSTECH)).
+
+# References
+
+1. Andriluka, M., Pishchulin, L., Gehler, P., Schiele, B.: 2D Human Pose Estimation: New Benchmark and State of the Art Analysis. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2014) 9
+2. Bogo, F., Kanazawa, A., Lassner, C., Gehler, P., Romero, J., Black, M.J.: Keep it SMPL: Automatic Estimation of 3D Human Pose and Shape from a Single Image. In: Proceedings of the European Conference on Computer Vision (ECCV) (2016) 1, 4
+3. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-End Object Detection with Transformers. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 213-229 (2020) 5
+4. Cho, J., Yoon, Y., Kwak, S.: Collaborative Transformers for Grounded Situation Recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022) 5
+5. Cho, J., Yoon, Y., Lee, H., Kwak, S.: Grounded Situation Recognition with Transformers. In: Proceedings of the British Machine Vision Conference (BMVC) (2021) 5
+6. Choi, H., Moon, G., Lee, K.M.: Pose2Mesh: Graph Convolutional Network for 3D Human Pose and Mesh Recovery from a 2D Human Pose. In: Proceedings of the European Conference on Computer Vision (ECCV) (2020) 4, 7, 8, 9
+7. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N.: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In: International Conference on Learning Representations (ICLR) (2021) 5
+8. Dwivedi, S.K., Athanasiou, N., Kocabas, M., Black, M.J.: Learning to Regress Bodies from Images using Differentiable Semantic Rendering. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 1, 4, 7, 8, 10
+9. Glorot, X., Bengio, Y.: Understanding the difficulty of training deep feedforward neural networks. In: Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. pp. 249-256 (2010) 8
+0. Gower, J.C.: Generalized procrustes analysis. Psychometrika 40, 33-51 (1975) 10
+1. Guan, P., Weiss, A., Balan, A.O., Black, M.J.: Estimating Human Shape and Pose from a Single Image. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV) (2009) 4
+2. Guo, L., Liu, J., Zhu, X., Yao, P., Lu, S., Lu, H.: Normalized and Geometry-Aware Self-Attention Network for Image Captioning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2020) 5
+3. He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian: Deep Residual Learning for Image Recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 770-778 (2016) 10, 11
+4. Ionescu, C., Papava, D., Olaru, V., Sminchisescu, C.: Human3.6M: Large Scale Datasets and Predictive Methods for 3D Human Sensing in Natural Environments. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) 36(7), 1325-1339 (2014) 2, 3, 9, 10, 11, 13, 14
+5. Jiang, W., Kolotouros, N., Pavlakos, G., Zhou, X., Daniilidis, K.: Coherent Reconstruction of Multiple Humans from a Single Image. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2020) 1, 4
+
+16. Kanazawa, A., Black, M.J., Jacobs, D.W., Malik, J.: End-to-end Recovery of Human Shape and Pose. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 1, 4, 7, 8, 10
+17. Kim, B., Lee, J., Kang, J., Kim, E.S., Kim, H.J.: HOTR: End-to-End Human-Object Interaction Detection with Transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 74-83 (2021) 5
+18. Kipf, T.N., Welling, M.: Semi-Supervised Classification with Graph Convolutional Networks. In: International Conference on Learning Representations (ICLR) (2017) 4
+19. Kocabas, M., Athanasiou, N., Black, M.J.: VIBE: Video Inference for Human Body Pose and Shape Estimation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2020) 8
+20. Kocabas, M., Huang, C.H.P., Hilliges, O., Black, M.J.: PARE: Part Attention Regressor for 3D Human Body Estimation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 1, 4, 7, 8, 10
+21. Kolotouros, N., Pavlakos, G., Black, M.J., Daniilidis, K.: Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2019) 1, 4, 7, 8, 10
+22. Kolotouros, N., Pavlakos, G., Daniilidis, K.: Convolutional Mesh Regression for Single-Image Human Shape Reconstruction. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 1, 3, 4, 7, 8, 10, 12, 13
+23. Lassner, C., Romero, J., Kiefel, M., Bogo, F., Black, M.J., Gehler, P.V.: Unite the People: Closing the Loop Between 3D and 2D Human Representations. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 9
+24. Lin, K., Wang, L., Liu, Z.: End-to-End Human Pose and Mesh Reconstruction with Transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 1954-1963 (2021) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14
+25. Lin, K., Wang, L., Liu, Z.: Mesh Graphormer. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 12939-12948 (2021) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13
+26. Lin, T.Y., Maire, M., Belongie, S., Bourdev, L., Girshick, R., Hays, J., Perona, P., Ramanan, D., Zitnick, C.L., Dollar, P.: Microsoft COCO: Common Objects in Context. In: Proceedings of the European Conference on Computer Vision (ECCV) (2014) 9, 12
+27. Liu, S., Lin, T., He, D., Li, F., Deng, R., Li, X., Ding, E., Wang, H.: Paint Transformer: Feed Forward Neural Painting with Stroke Prediction. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 6598-6607 (2021) 5
+28. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 5
+29. Loper, M., Mahmood, N., Romero, J., Pons-Moll, G., Black, M.J.: SMPL: A Skinned Multi-Person Linear Model. ACM Transactions on Graphics (SIGGRAPH Asia) 34(6), 248 (2015) 4, 6, 7, 12
+
+30. Lu, Y., Rai, H., Chang, J., Knyazev, B., Yu, G., Shekhar, S., Taylor, G.W., Volkovs, M.: Context-Aware Scene Graph Generation with Seq2Seq Transformers. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). pp. 15931-15941 (2021) 5
+31. Mahendran, S., Ali, H., Vidal, R.: A Mixed Classification-Regression Framework for 3D Pose Estimation from 2D Images. In: Proceedings of the British Machine Vision Conference (BMVC) (2018) 4
+32. Marcard, T.v., Henschel, R., Black, M.J., Rosenhahn, B., Pons-Moll, G.: Recovering Accurate 3D Human Pose in The Wild Using IMUs and a Moving Camera. In: Proceedings of the European Conference on Computer Vision (ECCV) (2018) 3, 9, 10, 11
+33. Mehta, D., Sotnychenko, O., Mueller, F., Xu, W., Sridhar, S., Pons-Moll, G., Theobalt, C.: Single-Shot Multi-Person 3D Pose Estimation from Monocular RGB. In: International Conference on 3D Vision (3DV) (2018) 9
+34. Moon, G., Lee, K.M.: I2L-MeshNet: Image-to-Lixel Prediction Network for Accurate 3D Human Pose and Mesh Estimation from a Single RGB Image. In: Proceedings of the European Conference on Computer Vision (ECCV) (2020) 1, 4, 7, 8, 9, 10
+35. Pavlakos, G., Choutas, V., Ghorbani, N., Bolkart, T., Osman, A.A.A., Tzionas, D., Black, M.J.: Expressive Body Capture: 3D Hands, Face, and Body from a Single Image. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 9
+36. Pavlakos, G., Zhu, L., Zhou, X., Daniilidis, K.: Learning to Estimate 3D Human Pose and Shape from a Single Color Image. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 1, 4, 10
+37. Ranjan, A., Bolkart, T., Sanyal, S., Black, M.J.: Generating 3D Faces using Convolutional Mesh Autoencoders. In: Proceedings of the European Conference on Computer Vision (ECCV) (2018) 7
+38. Rao, Y., Zhao, W., Liu, B., Lu, J., Zhou, J., Hsieh, C.J.: DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification. In: Advances in Neural Information Processing Systems (NIPS) (2021) 5
+39. Romero, J., Tzionas, D., Black, M.J.: Embodied Hands: Modeling and Capturing Hands and Bodies Together. ACM Transactions on Graphics, (Proc. SIGGRAPH Asia) 36(6) (2017) 13
+40. Sun, Y., Bao, Q., Liu, W., Fu, Y., Black, M.J., Mei, T.: Monocular, One-Stage, Regression of Multiple 3D People. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 1, 4, 7, 8, 10
+41. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is All you Need. In: Advances in Neural Information Processing Systems (NIPS) (2017) 5
+42. Wang, J., Sun, K., Cheng, T., Jiang, B., Deng, C., Zhao, Y., Liu, D., Mu, Y., Tan, M., Wang, X., Liu, W., Xiao, B.: Deep High-Resolution Representation Learning for Visual Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) (2019) 10, 11
+43. Wang, Y., Xu, Z., Wang, X., Shen, C., Cheng, B., Shen, H., Xia, H.: End-to-End Video Instance Segmentation with Transformers. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 8741-8750 (2021) 5
+44. Zhang, H., Tian, Y., Zhou, X., Ouyang, W., Liu, Y., Wang, L., Sun, Z.: PyMAF: 3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 1, 4, 7, 8, 10
+
+45. Zheng, C., Zhu, S., Mendieta, M., Yang, T., Chen, C., Ding, Z.: 3D Human Pose Estimation with Spatial and Temporal Transformers. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) 5
+46. Zhou, X., Zhu, M., Pavlakos, G., Leonardos, S., Derpanis, K.G., Daniilidis, K.: MonoCap: Monocular Human Motion Capture using a CNN Coupled with a Geometric Prior. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) (2018) 10
+47. Zimmermann, C., Ceylan, D., Yang, J., Russell, B., Argus, M., Brox, T.: FreiHAND: A Dataset for Markerless Capture of Hand Pose and Shape from Single RGB Images. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2019) 3, 13, 14
\ No newline at end of file
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/images.zip b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..a5969939899fdc4285a3246ab09a576ba10dcdd4
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb72af86e13f3cee8584b1fded9bd952de4d242d45094b28f309ab5a28741867
+size 770905
diff --git a/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/layout.json b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c1e82b312308d6f9ceb055c745dd6dc096b012b1
--- /dev/null
+++ b/crossattentionofdisentangledmodalitiesfor3dhumanmeshrecoverywithtransformers/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8610a4467118c63621a5cc306d2163329c12b4cf0be2d3ee8a7a42314d2fc61
+size 417917
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_content_list.json b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f8e6467e3ae13053dd550a17a4e83baa096e5ee2
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9915acc30e8393962e27877741e80fbcf0955715d183cb8ebd2537db3f870aba
+size 86202
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_model.json b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e508bf7f3397ff10069b8804fb680526a4bb8bda
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9c8d9bf20eb656974dc75eafd28820473b144f8eaee07a33de94d885b145173
+size 105882
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_origin.pdf b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..78be8fa351fd8f4fa1852aaaa98de2b4597a0e84
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/b3c44955-1862-4a3c-8b7c-15ec9fc76ee7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cc89f18defde56699ec516e5a7f2bc8eba81fbc975e871366e6f779923301d02
+size 857047
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/full.md b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f6a9d2bfb6683f6efbb75665fcff63b98ea492dc
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/full.md
@@ -0,0 +1,282 @@
+# Cross-Domain Cross-Set Few-Shot Learning via Learning Compact and Aligned Representations
+
+Wentao Chen $^{1,2}$ , Zhang Zhang $^{2,3}$ , Wei Wang $^{2,3}$ , Liang Wang $^{2,3}$ , Zilei Wang $^{1}$ , and Tieniu Tan $^{1,2,3}$
+
+1 University of Science and Technology of China, Hefei, China
+$^{2}$ Center for Research on Intelligent Perception and Computing, NLPR, CASIA, Beijing, China
+3 University of Chinese Academy of Sciences, Beijing, China
+wentao.chen@cripac.ia.ac.cn, zlwang@ustc.edu.cn
+{zzhang, wangwei, wangliang, tint}@nlpr.ia.ac.cn
+
+Abstract. Few-shot learning (FSL) aims to recognize novel queries with only a few support samples through leveraging prior knowledge from a base dataset. In this paper, we consider the domain shift problem in FSL and aim to address the domain gap between the support set and the query set. Different from previous cross-domain FSL work (CD-FSL) that considers the domain shift between base and novel classes, the new problem, termed cross-domain cross-set FSL (CDSC-FSL), requires few-shot learners not only to adapt to the new domain, but also to be consistent between different domains within each novel class. To this end, we propose a novel approach, namely stabPA, to learn prototypical compact and cross-domain aligned representations, so that the domain shift and few-shot learning can be addressed simultaneously. We evaluate our approach on two new CDCS-FSL benchmarks built from the Domain-Net and Office-Home datasets respectively. Remarkably, our approach outperforms multiple elaborated baselines by a large margin, e.g., improving 5-shot accuracy by 6.0 points on average on DomainNet. Code is available at https://github.com/WentaoChen0813/CDCS-FSL.
+
+Keywords: cross-domain cross-set few-shot learning, prototypical alignment
+
+# 1 Introduction
+
+Learning a new concept with a very limited number of examples is easy for human beings. However, it is quite difficult for current deep learning models, which usually require plenty of labeled data to learn generalizable and discriminative representations. To bridge the gap between humans and machines, few-shot learning (FSL) has been recently proposed [42,28].
+
+Similar to human beings, most FSL algorithms leverage prior knowledge from known classes to assist recognizing novel concepts. Typically, a FSL algorithm is composed of two phases: (i) pre-train a model on a base set that contains a large number of seen classes (called meta-training phase); (ii) transfer the
+
+pre-trained model to novel classes with a small labeled support set and test it with a query set (meta-testing phase). Despite great progresses on FSL algorithms [9,29,42,37], most previous studies adopt a single domain assumption, where all images in both meta-training and meta-testing phases are from a single domain. Such assumption, however, may be easily broken in real-world applications. Considering a concrete example of online shopping, a clothing retailer commonly shows several high-quality pictures taken by photographers for each fashion product (support set), while customers may use their cellphone photos (query set) to match the displayed pictures of their expected products. In such case, there is a distinct domain gap between the support set and the query set. Similar example can be found in security surveillance: given the low-quality picture of a suspect captured at night (query set), the surveillance system is highly expected to recognize its identity based on a few high-quality registered photos (e.g., ID card). With such domain gap, FSL models will face more challenges besides limited support data.
+
+In this paper, we consider the above problem in FSL and propose a new setting to address the domain gap between the support set and the query set. Following previous FSL work, a large base set from the source domain is available for meta-training. Differently, during meta-testing, only the support set or the query set is from the source domain, while the other is from a different target domain. Some recent studies also consider the cross-domain few-shot learning problem (CD-FSL) [15,39,26]. However, the domain shift in CD-FSL occurs between the meta-training and meta-testing phases. In other words, both the support and query sets in the meta-testing phase are still from the same domain (pictorial illustration is given in Figure 1 (a)). To distinguish the considered setting from CD-FSL, we name this setting as cross-domain cross-set few-shot learning (CDCS-FSL), as the support set and the query set are across different domains. Compared to CD-FSL, the domain gap within each novel class imposes more requirements to learn a well-aligned feature space. Nevertheless, in terms of the above setting, it is nearly intractable to conquer the domain shift due to the very limited samples of the target domain, e.g., the target domain may contain only one support (or query) image. Thus, we follow the CD-FSL literature [26] to use unlabeled auxiliary data from the target domain to assist model training. Note that we do not suppose that the auxiliary data are from novel classes. Therefore, we can collect these data from some common-seen classes (e.g., base classes) without any annotation costs.
+
+One may notice that re-collecting a few support samples from the same domain as the query set can 'simply' eliminate the domain gap. However, it may be intractable to re-collect support samples in some real few-shot applications, e.g., re-collecting ID photos for all persons is difficult. Besides, users sometimes not only want to get the class labels, but more importantly they'd like to retrieve the support images themselves (like the high-quality fashion pictures). Therefore, the CDCS-FSL setting can not be simply transferred into previous FSL and CD-FSL settings.
+
+
+Fig. 1. Problem setup and motivation. (a) CD-FSL considers the domain shift between the meta-training and meta-testing phases, while CDCS-FSL considers the domain shift between the support set and the query set in the meta-testing phase. Following previous CD-FSL work [26], unlabeled target domain data are used in CDCS-FSL to assistant model training. (b) We propose a bi-directional prototypical alignment framework to address CDCS-FSL, which pushes feature vectors of one domain to be gathered around the corresponding prototype in the other domain bi-directionally, and separates feature vectors from different classes.
+
+To address the CDCS-FSL problem, we propose a simple but effective bidirectional prototypical alignment framework to learn compact and cross-domain aligned representations, which is illustrated in Figure 1 (b). The main idea of our approach is derived from two intuitive insights: (i) we need aligned representations to alleviate the domain shift between the source and target domains, and (ii) compact representations are desirable to learn a center-clustered class space, so that a small support set can better represent a new class. Specifically, given the labeled base set in the source domain and the unlabeled auxiliary set in the target domain, we first assign pseudo labels to the unlabeled data considering that pseudo labels can preserve the coarse semantic similarity with the visual concepts in source domain. Then, we minimize the point-to-set distance between the prototype (class center) in one domain and the corresponding feature vectors in the other domain bi-directionally. As results, the feature vectors of the source (or target) domain will be gathered around the prototype in the other domain, thus reducing the domain gap and intra-class variance simultaneously. Moreover, the inter-class distances are maximized to attain a more separable feature space. Furthermore, inspired by the fact that data augmentation even with strong transformations generally does not change sample semantics, we augment samples in each domain, and suppose that the augmented samples between different domains should also be aligned. Since these augmented samples enrich the data diversity, they can further encourage to learn the underlying invariance and strengthen the cross-domain alignment.
+
+Totally, we summarize all the above steps into one approach termed "Strongly Augmented Bi-directional Prototypical Alignment", or $stabPA$ . We evaluate its
+
+effectiveness on two new CDCS-FSL benchmarks built from the DomainNet [25] and Office-Home [40] datasets. Remarkably, the proposed stabPA achieves the best performance over both benchmarks and outperforms other baselines with a large margin, e.g., improving 5-shot accuracy by 6.0 points on average on the DomainNet dataset.
+
+In summary, our contributions are three-fold:
+
+- We consider a new FSL setting, CDCS-FSL, where a domain gap exists between the support set and the query set.
+- We propose a novel approach, namely stabPA, to address the CDCS-FSL problem, of which the key is to learn prototypical compact and domain aligned representations.
+- Extensive experiments demonstrate that stabPA can learn discriminative and generalizable representations and outperforms all baselines by a large margin on two CDCS-FSL benchmarks.
+
+# 2 Related Work
+
+FSL aims to learn new classes with very few labeled examples. Most studies follow a meta-learning paradigm [41], where a meta-learner is trained on a series of training tasks (episodes) so as to enable fast adaptation to new tasks. The meta-learner can take various forms, such as an LSTM network [28], initial network parameters [9], or closed-form solvers [29]. Recent advances in pre-training techniques spawn another FSL paradigm. In [4], the authors show that a simple pre-training and fine-tuning baseline can achieve competitive performance with respect to the SOTA FSL models. In [37,5], self-supervised pre-training techniques have proven to be useful for FSL. Our approach also follows the pre-training paradigm, and we further expect the learned representations to be compact and cross-domain aligned to address the CDCS-FSL problem.
+
+CD-FSL [15,39,26,43,20,14,10] considers the domain shift problem between the base classes and the novel classes. Due to such domain gap, [4] show that meta-learning approaches fail to adapt to novel classes. To alleviate this problem, [39] propose a feature-wise transformation layer to learn rich representations that can generalize better to other domains. However, they need to access multiple labeled data sources with extra data collection costs. [26] solve this problem by exploiting additional unlabeled target data with self-supervised pre-training techniques. Alternatively, [14] propose to utilize the semantic information of class labels to minimize the distance between source and target domains. Without the need for extra data or language annotations, [43] augment training tasks in an adversarial way to improve the generalization capability.
+
+Using target domain images to alleviate domain shift is related to the field of domain adaptation (DA). Early efforts align the marginal distribution of each domain by minimizing a pre-defined discrepancy, such as $\mathcal{H}\Delta\mathcal{H}$ -divergence [1] or Maximum Mean Discrepancy (MMD) [13]. Recently, adversarial-based methods adopt a discriminator [12] to approximate the domain discrepancy, and learn domain-invariant distribution at image level [17], feature level [21] or output
+
+level [38]. Another line of studies assign pseudo labels to unlabeled target data [49,47,48], and directly align the feature distribution within each class. Although these DA methods are related to our work, they usually assume that the testing stage shares the same class space as the training stage, which is broken by the setting of FSL. Open-set DA [24,31] and Universal DA [30,45] consider the existence of unseen classes. However, they merely mark them as 'unknown'. In this work, we are more interested in addressing the domain shift for these unseen novel classes within a FSL assumption.
+
+# 3 Problem Setup
+
+Formally, a FSL task often adopts a setting of N-way-K-shot classification, which aims to discriminate between N novel classes with K exemplars per class. Given a support set $\mathcal{S} = \{(x_i,y_i)\}_{i = 1}^{N\times K}$ where $x_{i}\in \mathcal{X}_{\mathcal{N}}$ denotes a data sample in novel classes and $y_{i}\in Y_{\mathcal{N}}$ is the class label, the goal of FSL is to learn a mapping function $\phi :\phi (x_q)\to y_q$ which classifies a query sample $x_{q}$ in the query set $\mathcal{Q}$ to the class label $y_{q}\in Y_{\mathcal{N}}$ . Besides $\mathcal{S}$ and $\mathcal{Q}$ , a large labeled dataset $\mathcal{B}\subset \mathcal{X}_{\mathcal{B}}\times \mathcal{Y}_{\mathcal{B}}$ (termed base set) is often provided for meta-training, where $\mathcal{X}_{\mathcal{B}}$ and $\mathcal{Y}_{\mathcal{B}}$ do not overlap with $\mathcal{X}_{\mathcal{N}}$ and $\mathcal{Y}_{\mathcal{N}}$ .
+
+Conventional FSL studies assume the three sets $\mathcal{S}$ , $\mathcal{Q}$ and $\mathcal{B}$ are from the same domain. In this paper, we consider the domain gap between the support set and the query set (only one is from the same domain as the base set, namely the source domain $\mathcal{D}_s$ , and the other is from a new target domain $\mathcal{D}_t$ ). Specifically, this setting has two situations:
+
+(i) $\mathcal{D}_s - \mathcal{D}_t$ : the support set is from the source domain and the query set is from the target domain, i.e., $\mathcal{S} \subset \mathcal{D}_s$ and $\mathcal{Q} \subset \mathcal{D}_t$ .
+(ii) $\mathcal{D}_t - \mathcal{D}_s$ : the support set is from the target domain and the query set is from the source domain, i.e., $\mathcal{S} \subset \mathcal{D}_t$ and $\mathcal{Q} \subset \mathcal{D}_s$ .
+
+As the support set and the query set are across different domains, we name this setting as cross-domain cross-set few-shot learning (CDCS-FSL). Besides the above three sets, to facilitate crossing the domain gap, an unlabeled auxiliary set $\mathcal{U}$ from the target domain is available in the meta-training phase, where the data from novel classes are manually removed to promise they are not seen in meta-training.
+
+# 4 Approach
+
+Briefly, our approach contains two stages: 1) In the meta-training stage, we train a feature extractor $f: x_i \to f(x_i)$ with the base set $\mathcal{B}$ and the unlabeled auxiliary set $\mathcal{U}$ ; 2) In the meta-testing stage, we fix the feature extractor and train a linear classification head $g: f(x_i) \to y_i$ on the support set $\mathcal{S}$ , and the entire model $\phi = g \circ f$ is used to predict the labels for the query set $\mathcal{Q}$ . The framework of our approach is illustrated in Figure 2.
+
+
+Fig. 2. Framework. In the meta-training stage, we train a feature extractor within the bi-directional prototypical alignment framework to learn compact and aligned representations. In the meta-testing stage, we fix the feature extractor and train a new classification head with the support set, and then evaluate the model on the query set.
+
+# 4.1 Bi-directional Prototypical Alignment
+
+A straightforward way to align feature distributions is through estimating class centers (prototypes) in both source and target domains. With the labeled base data, it is easy to estimate prototypes for the source domain. However, it is difficult to estimate prototypes in the target domain with only unlabeled data available. To address this issue, we propose to assign pseudo labels to the unlabeled data and then use the pseudo labels to approximate prototypes. The insight is that the pseudo labels can preserve the coarse semantic similarity even under domain or category shift (e.g., a painting tiger could be more likely to be pseudo-labeled as a cat rather than a tree). Aggregating samples with the same pseudo label can extract the shared semantics across different domains.
+
+Specifically, given the source domain base set $\mathcal{B}$ and the target domain unlabeled set $\mathcal{U}$ , we first assign pseudo labels to the unlabeled samples with an initial classifier $\phi_0$ trained on the base set and obtain $\hat{\mathcal{U}} = \{(x_i,\hat{y}_i)|x_i\in \mathcal{U}\}$ , where $\hat{y}_i = \phi_0(x_i)$ is the pseudo label. Then, we obtain the source prototypes $\{p_k^s\}_{k = 1}^{|\mathcal{V}_B|}$ and the target prototypes $\{p_k^t\}_{k = 1}^{|\mathcal{V}_B|}$ by averaging the feature vectors with the same label (or pseudo label). It should be noted that the prototypes are estimated on the entire datasets $\mathcal{B}$ and $\hat{\mathcal{U}}$ , and adjusted together with the update of the feature extractor and pseudo labels (details can be found below).
+
+With the obtained prototypes, directly minimizing the point-to-point distance between two prototypes $p_k^s$ and $p_k^t$ can easily reduce the domain gap for the class $k$ . However, this may make the feature distribution of different classes mix together and the discrimination capability of the learned representations is still insufficient. To overcome these drawbacks, we propose to minimize the point-to-set distance across domains in a bi-directional way. That is, we minimize the distance between the prototype in one domain and the corresponding feature vectors in the other domain, and meanwhile maximize the feature distance between different classes. In this way, we can not only align features across
+
+domains, but also simultaneously obtain compact feature distributions for both domains to suit the requirement of few-shot learning.
+
+Concretely, for a source sample $(x_i^s,y_i^s)\in \mathcal{B}$ of the $q$ -th class (i.e., $y_{i}^{s} = q$ ), we minimize its feature distance to the prototype $p_q^t$ in the target domain, and meanwhile maximize its distances to the prototypes of other classes. Here, a softmax loss function for the source-to-target alignment is formulated as:
+
+$$
+\ell_ {s - t} \left(x _ {i} ^ {s}, y _ {i} ^ {s}\right) = - \log \frac {\exp \left(- \left| | f \left(x _ {i} ^ {s}\right) - p _ {q} ^ {t} \right| ^ {2} / \tau\right)}{\sum_ {k = 1} ^ {| y _ {B} |} \exp \left(- \left| | f \left(x _ {i} ^ {s}\right) - p _ {k} ^ {t} \right| ^ {2} / \tau\right)}, \tag {1}
+$$
+
+where $\tau$ is a temperature factor. To get a better feature space for the target domain, a similar target-to-source alignment loss is applied for each target sample $(x_{i}^{t},\hat{y}_{i}^{t})\in \hat{\mathcal{U}}$ with $\hat{y}_i^t = q$ :
+
+$$
+\ell_ {t - s} \left(x _ {i} ^ {t}, \hat {y} _ {i} ^ {t}\right) = - \log \frac {\exp \left(- | | f \left(x _ {i} ^ {t}\right) - p _ {q} ^ {s} | | ^ {2} / \tau\right)}{\sum_ {k = 1} ^ {| \mathcal {Y} _ {\mathfrak {B}} |} \exp \left(- | | f \left(x _ {i} ^ {t}\right) - p _ {k} ^ {s} | | ^ {2} / \tau\right)}. \tag {2}
+$$
+
+Since the initial pseudo labels are more likely to be incorrect, we gradually increase the weights of these two losses following the principle of curriculum learning [2]. For the source-to-target alignment, the loss weight starts from zero and converges to one, formulated as:
+
+$$
+w (t) = \frac {2}{1 + \exp (- t / T _ {\max })} - 1, \tag {3}
+$$
+
+where $t$ is the current training step and $T_{max}$ is the maximum training step. For the target-to-source alignment, since the pseudo labels become more confident along with the training process, a natural curriculum is achieved by setting a confidence threshold to filter out the target samples with low confidence pseudo labels [33].
+
+Together, the total loss for the bi-directional prototypical alignment is
+
+$$
+\ell_ {b \mathrm {P A}} = \frac {1}{| \mathcal {B} |} \sum_ {i = 1} ^ {| \mathcal {B} |} w (t) \ell_ {s - t} \left(x _ {i} ^ {s}, y _ {i} ^ {s}\right) + \frac {1}{| \hat {\mathcal {U}} |} \sum_ {i = 1} ^ {| \hat {\mathcal {U}} |} \mathbb {1} \left(p \left(\hat {y} _ {i} ^ {t}\right) > \beta\right) \ell_ {t - s} \left(x _ {i} ^ {t}, \hat {y} _ {i} ^ {t}\right), \tag {4}
+$$
+
+where $p(\cdot)$ is the confidence of a pseudo label, and $\beta$ is the confidence threshold below which the data samples will be dropped.
+
+Updating Pseudo Label. The pseudo labels are initially predicted by a classifier $\phi_0$ pre-trained on the base set $\mathcal{B}$ . As the representations are updated, we update the pseudo labels by re-training a classifier $\phi_t = h \circ f$ based on the current feature extractor $f$ , where $h$ is a linear classification head for the base classes. The final pseudo labels are updated by linear interpolation between the predictions of the initial classifier $\phi_0$ and the online updated classifier $\phi_t$ :
+
+$$
+\hat {y} _ {i} = \arg \max _ {k \in \mathcal {Y} _ {\mathcal {B}}} \lambda \phi_ {0} (k | x _ {i}) + (1 - \lambda) \phi_ {t} (k | x _ {i}), \tag {5}
+$$
+
+where $\lambda$ is the interpolation coefficient. The combination of these two classifiers makes it possible to rectify the label noise of the initial classifier, and meanwhile
+
+inhibit the rapid change of pseudo labels of online classifier especially in the early training stage.
+
+Generating Prototypes. Note that we are intended to estimate the prototypes on the entire dataset and update them with representation learning. For the source domain, instead of calculating the mean value of intra-class samples in the feature space, a cheaper way is to approximate prototypes with the normalized weights of the classification head $h$ , as the classifier weights tend to align with class centers in order to reduce classification errors [27]. Specifically, we set the source prototypes as $p_k^s = W_k$ , where $W_k$ is the normalized classification weight for the $k$ -th class. For the target domain, we adopt the momentum technique to update prototypes. The prototypes are initialized as zeros. At each training step, we first estimate the prototypes using target samples in current batch with their pseudo labels. Then, we update the target prototype $p_k^t$ as:
+
+$$
+p _ {k} ^ {t} \leftarrow m p _ {k} ^ {t} + (1 - m) \frac {1}{n _ {k}} \sum_ {i = 1} ^ {| \hat {\mathcal {U}} _ {b} |} \mathbb {1} \left(\hat {y} _ {i} ^ {t} = k\right) f \left(x _ {i} ^ {t}\right), \tag {6}
+$$
+
+where $n_k$ is the number of the target samples classified into the $k$ -th class in a target batch $\hat{\mathcal{U}}_b$ , and $m$ is the momentum term controlling the update speed.
+
+# 4.2 stabPA
+
+Strong data augmentation has proved to be effective for learning generalizable representations, especially in self-supervised representation learning studies [16,3]. Given a sample $x$ , strong data augmentation generates additional data points $\{\widetilde{x}_i\}_{i=1}^n$ by applying various intensive image transformations. The assumption behind strong data augmentation is that the image transformations do not change the semantics of original samples.
+
+In this work, we further hypothesize that strongly augmented intra-class samples in different domains can also be aligned. It is expected that strong data augmentation can further strengthen the learning of cross-domain representations, since stronger augmentation provides more diverse data samples and makes the learned aligned representations more robust for various transformations in both the source and target domains.
+
+Following this idea, we extend the bi-directional prototypical alignment with strong data augmentation and the entire framework is termed $stab\mathrm{PA}$ . Specifically, for a source sample $(x_i^s,y_i^s)$ and a target sample $(x_i^t,\hat{y}_i^t)$ , we generate their augmented versions $(\widetilde{x}_i^s,y_i^s)$ and $(\widetilde{x}_i^t,\hat{y}_i^t)$ . Within the bi-directional prototypical alignment framework, we minimize the feature distance of a strongly augmented image to its corresponding prototype in the other domain, and maximize its distances to the prototypes of other classes. Totally, the $stab\mathrm{PA}$ loss is
+
+$$
+\ell_ {s t a b \mathrm {P A}} = \frac {1}{| \widetilde {\mathcal {B}} |} \sum_ {i = 1} ^ {| \widetilde {\mathcal {B}} |} w (t) \ell_ {s - t} \left(\widetilde {x} _ {i} ^ {s}, y _ {i} ^ {s}\right) + \frac {1}{| \widetilde {\mathcal {U}} |} \sum_ {i = 1} ^ {| \widetilde {\mathcal {U}} |} \mathbb {1} \left(p \left(\hat {y} _ {i} ^ {t}\right) > \beta\right) \ell_ {t - s} \left(\widetilde {x} _ {i} ^ {t}, \hat {y} _ {i} ^ {t}\right), \tag {7}
+$$
+
+where $\widetilde{\mathcal{B}}$ and $\widetilde{\mathcal{U}}$ are the augmented base set and unlabeled auxiliary set, respectively.
+
+To perform strong data augmentation, we apply random crop, Cutout [8], and RandAugment [7]. RandAugment comprises 14 different transformations and randomly selects a fraction of transformations for each sample. In our implementation, the magnitude for each transformation is also randomly selected, which is similar to [33].
+
+# 5 Experiments
+
+# 5.1 Datasets
+
+DomainNet. DomainNet [25] is a large-scale multi-domain image dataset. It contains 345 classes in 6 different domains. In experiments, we choose the real domain as the source domain and choose one domain from painting, clipart and sketch as the target domain. We randomly split the classes into 3 parts: base set (228 classes), validation set (33 classes) and novel set (65 classes), and discard 19 classes with too few samples.
+
+Office-Home. Office-Home [40] contains 65 object classes usually found in office and home settings. We randomly select 40 classes as the base set, 10 classes as the validation set, and 15 classes as the novel set. There are 4 domains for each class: real, product, clipart and art. We set the source domain as real and choose the target domain from the other three domains.
+
+In both datasets, we construct the unlabeled auxiliary set by collecting data from the base and validation sets of the target domain and removing their labels. These unlabeled data combined with the labeled base set are used for metatraining. The validation sets in both domains are used to tune hyper-parameters. Reported results are averaged across 600 test episodes from the novel set.
+
+# 5.2 Comparison Results
+
+We compare our approach to a broad range of related methods. Methods in the first group [32,34,19,37,46,39,43,23,6] do not use the unlabeled auxiliary data during meta-training, while methods in the second group [11,35,36,33,26,18] utilize the unlabeled target images to facilitate crossing the domain gap. Note that methods in the second group are only different in representation learning, and adopt the same evaluation paradigm as ours, i.e., training a linear classifier on the support set. We also implement a baseline method, termed $stab\mathrm{PA}^{-}$ , where we do not apply domain alignment and only train the feature extractor on augmented source images, which is also equivalent to applying strong augmentation to Tian et al. [37]. We set $\beta = 0.5$ , $\lambda = 0.2$ and $m = 0.1$ as default for our approach. All compared methods are implemented with the same backbone and optimizer. Implementation details including augmentation techniques can be found in the appendix.
+
+The comparison results are shown in Tables 1 and 2. The 'r-r' setting denotes all images are from the source domain, and thus is not available for methods in
+
+Table 1. Comparison to baselines on the DomainNet dataset. We denote 'r' as real, 'p' as painting, 'c' as clipart and 's' as sketch. We report 5-way 1-shot and 5-way 5-shot accuracies with $95\%$ confidence interval.
+
+| Method | 5-way 1-shot |
| r-r | r-p | p-r | r-c | c-r | r-s | s-r |
| ProtoNet [32] | 63.43±0.90 | 45.36±0.81 | 45.25±0.97 | 44.65±0.81 | 47.50±0.95 | 39.28±0.77 | 42.85±0.89 |
| RelationNet [34] | 59.49±0.91 | 42.69±0.77 | 43.04±0.97 | 44.12±0.81 | 45.86±0.95 | 36.52±0.73 | 41.29±0.96 |
| MetaOptNet [19] | 61.12±0.89 | 44.02±0.77 | 44.31±0.94 | 42.46±0.80 | 46.15±0.98 | 36.37±0.72 | 40.27±0.95 |
| Tian et al. [37] | 67.18±0.87 | 46.69±0.86 | 46.57±0.99 | 48.30±0.85 | 49.66±0.98 | 40.23±0.73 | 41.90±0.86 |
| DeepEMD [46] | 67.15±0.87 | 47.60±0.87 | 47.86±1.04 | 49.02±0.83 | 50.89±1.00 | 42.75±0.79 | 46.02±0.93 |
| ProtoNet+FWT [39] | 62.38±0.89 | 44.40±0.80 | 45.32±0.97 | 43.95±0.80 | 46.32±0.92 | 39.28±0.74 | 42.18±0.95 |
| ProtoNet+ATA [43] | 61.97±0.87 | 45.59±0.84 | 45.90±0.94 | 44.28±0.83 | 47.69±0.90 | 39.87±0.81 | 43.64±0.95 |
| S2M2 [23] | 67.07±0.84 | 46.84±0.82 | 47.03±0.95 | 47.75±0.83 | 48.27±0.91 | 39.78±0.76 | 40.11±0.91 |
| Meta-Baseline [6] | 69.46±0.91 | 48.76±0.85 | 48.90±1.12 | 49.96±0.85 | 52.67±1.08 | 43.08±0.80 | 46.22±1.04 |
| stabPA-(Ours) | 68.48±0.87 | 48.65±0.89 | 49.14±0.88 | 45.86±0.85 | 48.31±0.92 | 41.74±0.78 | 42.17±0.95 |
| DANN [11] | - | 45.94±0.84 | 46.85±0.97 | 47.31±0.86 | 50.02±0.94 | 42.44±0.79 | 43.66±0.92 |
| PCT [35] | - | 47.14±0.89 | 47.31±1.04 | 50.04±0.85 | 49.83±0.98 | 39.10±0.76 | 39.92±0.95 |
| Mean Teacher [36] | - | 46.92±0.83 | 46.84±0.96 | 48.48±0.81 | 49.60±0.97 | 43.39±0.81 | 44.52±0.89 |
| FixMatch [33] | - | 48.86±0.87 | 49.15±0.93 | 48.70±0.82 | 49.18±0.93 | 44.48±0.80 | 45.97±0.95 |
| STARTUP [26] | - | 47.53±0.88 | 47.58±0.98 | 49.24±0.87 | 51.32±0.98 | 43.78±0.82 | 45.23±0.96 |
| DDN [18] | - | 48.83±0.84 | 48.11±0.91 | 48.25±0.83 | 48.46±0.93 | 43.60±0.79 | 43.99±0.91 |
| stabPA (Ours) | - | 53.86±0.89 | 54.44±1.00 | 56.12±0.83 | 56.57±1.02 | 50.85±0.86 | 51.71±1.01 |
| 5-way 5-shot |
| ProtoNet [32] | 82.79±0.58 | 57.23±0.79 | 65.60±0.95 | 58.04±0.81 | 65.91±0.78 | 51.68±0.81 | 59.46±0.85 |
| RelationNet [34] | 77.68±0.62 | 52.63±0.74 | 61.18±0.90 | 57.24±0.80 | 62.65±0.81 | 47.32±0.75 | 56.39±0.88 |
| MetaOptNet [19] | 80.93±0.60 | 56.34±0.76 | 63.20±0.89 | 57.92±0.79 | 63.51±0.82 | 48.20±0.79 | 55.65±0.85 |
| Tian et al. [37] | 84.50±0.55 | 56.87±0.84 | 63.90±0.95 | 59.67±0.84 | 65.33±0.80 | 50.41±0.80 | 56.95±0.84 |
| DeepEMD [46] | 82.79±0.56 | 56.62±0.78 | 63.86±0.93 | 60.43±0.82 | 67.46±0.78 | 51.66±0.80 | 60.39±0.87 |
| ProtoNet+FWT [39] | 82.42±0.55 | 57.18±0.77 | 65.64±0.93 | 57.42±0.77 | 65.11±0.83 | 50.69±0.77 | 59.58±0.84 |
| ProtoNet+ATA [43] | 81.96±0.57 | 57.69±0.83 | 64.96±0.93 | 56.90±0.84 | 64.08±0.86 | 51.67±0.80 | 60.78±0.86 |
| S2M2 [23] | 85.79±0.52 | 58.79±0.81 | 65.67±0.90 | 60.63±0.83 | 63.57±0.88 | 49.43±0.79 | 54.45±0.89 |
| Meta-Baseline [6] | 83.74±0.58 | 56.07±0.79 | 65.70±0.99 | 58.84±0.80 | 67.89±0.91 | 50.27±0.76 | 61.88±0.94 |
| stabPA-(Ours) | 85.98±0.51 | 59.92±0.85 | 67.10±0.93 | 57.10±0.88 | 62.90±0.83 | 51.03±0.85 | 57.11±0.93 |
| DANN [11] | - | 56.83±0.86 | 64.29±0.94 | 59.42±0.84 | 66.87±0.78 | 53.47±0.75 | 60.14±0.81 |
| PCT [35] | - | 56.38±0.87 | 64.03±0.99 | 61.15±0.80 | 66.19±0.82 | 46.77±0.74 | 53.91±0.90 |
| Mean Teacher [36] | - | 57.74±0.84 | 64.97±0.94 | 61.54±0.84 | 67.39±0.89 | 54.57±0.79 | 60.04±0.86 |
| FixMatch [33] | - | 61.62±0.79 | 67.46±0.89 | 61.94±0.82 | 66.72±0.81 | 55.26±0.83 | 62.46±0.87 |
| STARTUP [26] | - | 58.13±0.82 | 65.27±0.92 | 61.51±0.86 | 67.95±0.78 | 54.89±0.81 | 61.97±0.88 |
| DDN [18] | - | 61.98±0.82 | 67.69±0.88 | 61.07±0.84 | 65.58±0.79 | 54.35±0.83 | 60.37±0.88 |
| stabPA (Ours) | - | 65.65±0.74 | 73.63±0.82 | 67.32±0.80 | 74.41±0.76 | 61.37±0.82 | 68.93±0.87 |
+
+the second group. In Table 1, we can see that the performance of conventional FSL methods drops quickly when there is a domain shift between support and query sets. The proposed stabPA leveraging unlabeled target images for domain alignment can alleviate this problem, improving the previous best FSL baseline [6] by $7.05\%$ across 6 CSCS-FSL situations. Similar results can be found on the Office-Home dataset in Table 2, where the stabPA outperforms the previous best FSL method, S2M2 [23], by $3.90\%$ on average. When comparing our approach with methods in the second group, we find that the stabPA outperforms them in all situations, improving 5-shot accuracy by $5.98\%$ over the previous best method FixMatch [33] on DomainNet. These improvements indicate that
+
+Table 2. Comparison results on Office-Home. We denote 'r' as real, 'p' as product, 'c' as clipart and 'a' as art. Accuracies are reported with $95\%$ confidence intervals.
+
+| Method | 5-way 1-shot |
| r-r | r-p | p-r | r-c | c-r | r-a | a-r |
| ProtoNet [32] | 35.24±0.63 | 30.72±0.62 | 30.27±0.62 | 28.52±0.58 | 28.44±0.63 | 26.80±0.47 | 27.31±0.58 |
| RelationNet [34] | 34.86±0.63 | 28.28±0.62 | 27.59±0.56 | 27.66±0.58 | 25.86±0.60 | 25.98±0.54 | 27.83±0.63 |
| MetaOptNet [19] | 36.77±0.65 | 33.34±0.69 | 33.28±0.65 | 28.78±0.53 | 28.70±0.64 | 29.45±0.69 | 28.36±0.64 |
| Tian et al. [37] | 39.53±0.67 | 33.88±0.69 | 33.98±0.67 | 30.44±0.60 | 30.86±0.66 | 30.26±0.57 | 30.30±0.62 |
| DeepEMD [46] | 41.19±0.71 | 34.27±0.72 | 35.19±0.71 | 30.92±0.62 | 31.82±0.70 | 31.05±0.59 | 31.07±0.63 |
| ProtoNet+FWT [39] | 35.43±0.64 | 32.18±0.67 | 30.92±0.61 | 28.75±0.62 | 27.93±0.63 | 27.58±0.52 | 28.37±0.65 |
| ProtoNet+ATA [43] | 35.67±0.66 | 31.56±0.68 | 30.40±0.62 | 27.20±0.56 | 26.61±0.62 | 27.88±0.55 | 28.48±0.65 |
| S2M2 [23] | 41.92±0.68 | 35.46±0.74 | 35.21±0.70 | 31.84±0.66 | 31.96±0.66 | 30.36±0.59 | 30.88±0.65 |
| Meta-Baseline [6] | 38.88±0.67 | 33.44±0.72 | 33.73±0.68 | 30.41±0.61 | 30.43±0.67 | 30.00±0.58 | 30.31±0.64 |
| stabPA-(Ours) | 43.43±0.69 | 35.16±0.72 | 35.74±0.68 | 31.16±0.66 | 30.44±0.64 | 32.09±0.62 | 31.71±0.67 |
| DANN [11] | - | 33.41±0.71 | 33.60±0.66 | 30.98±0.64 | 30.81±0.70 | 31.67±0.60 | 32.07±0.64 |
| PCT [35] | - | 35.53±0.73 | 35.58±0.71 | 28.83±0.58 | 28.44±0.67 | 31.56±0.58 | 31.59±0.65 |
| Mean Teacher [36] | - | 33.24±0.70 | 33.13±0.67 | 31.34±0.62 | 30.91±0.67 | 30.98±0.60 | 31.57±0.61 |
| FixMatch [33] | - | 36.05±0.73 | 35.83±0.76 | 33.79±0.64 | 33.20±0.74 | 31.81±0.60 | 32.32±0.66 |
| STARTUP [26] | - | 34.62±0.74 | 34.80±0.68 | 30.70±0.63 | 30.17±0.68 | 32.06±0.59 | 32.40±0.66 |
| stabPA (Ours) | - | 38.02±0.76 | 38.09±0.82 | 35.44±0.76 | 34.74±0.76 | 34.81±0.69 | 35.18±0.72 |
| 5-way 5-shot |
| ProtoNet [32] | 49.21±0.59 | 39.74±0.64 | 38.98±0.64 | 34.81±0.59 | 35.85±0.59 | 34.56±0.58 | 36.27±0.66 |
| RelationNet [34] | 47.02±0.57 | 33.95±0.60 | 32.78±0.59 | 33.58±0.60 | 30.15±0.55 | 30.44±0.55 | 35.42±0.70 |
| MetaOptNet [19] | 52.00±0.59 | 43.21±0.69 | 42.97±0.63 | 36.48±0.57 | 36.56±0.65 | 36.75±0.63 | 38.48±0.68 |
| Tian et al.[37] | 56.89±0.61 | 45.79±0.69 | 44.27±0.63 | 38.27±0.64 | 38.99±0.63 | 38.80±0.61 | 41.56±0.72 |
| DeepEMD [46] | 58.76±0.61 | 47.47±0.71 | 45.39±0.65 | 38.87±0.63 | 40.06±0.66 | 39.20±0.58 | 41.62±0.72 |
| ProtoNet+FWT [39] | 51.40±0.61 | 41.50±0.68 | 40.32±0.60 | 36.07±0.62 | 35.80±0.60 | 34.60±0.56 | 37.36±0.67 |
| ProtoNet+ATA [43] | 51.19±0.63 | 41.19±0.68 | 38.06±0.61 | 32.74±0.56 | 33.98±0.67 | 35.36±0.56 | 36.87±0.68 |
| S2M2 [23] | 60.82±0.58 | 47.84±0.70 | 46.32±0.67 | 40.09±0.66 | 41.63±0.64 | 40.01±0.60 | 42.68±0.67 |
| Meta-Baseline [6] | 55.75±0.60 | 45.33±0.73 | 42.62±0.63 | 37.29±0.60 | 38.21±0.66 | 38.35±0.62 | 41.54±0.71 |
| stabPA-(Ours) | 61.87±0.57 | 48.02±0.73 | 46.27±0.67 | 38.22±0.66 | 39.88±0.63 | 41.75±0.59 | 44.09±0.69 |
| DANN [11] | - | 45.09±0.48 | 42.71±0.65 | 39.11±0.61 | 39.49±0.69 | 41.40±0.59 | 43.68±0.73 |
| PCT [35] | - | 48.06±0.68 | 46.25±0.64 | 34.10±0.58 | 35.59±0.66 | 40.85±0.58 | 43.30±0.74 |
| Mean Teacher [36] | - | 44.80±0.69 | 43.16±0.61 | 39.30±0.61 | 39.37±0.66 | 39.98±0.60 | 42.50±0.68 |
| FixMatch [33] | - | 48.45±0.70 | 47.17±0.68 | 43.13±0.67 | 43.20±0.69 | 41.48±0.60 | 44.68±0.72 |
| STARTUP [26] | - | 47.18±0.71 | 45.00±0.64 | 38.10±0.62 | 38.84±0.70 | 41.94±0.63 | 44.71±0.73 |
| stabPA (Ours) | - | 49.83±0.67 | 50.78±0.74 | 44.02±0.71 | 45.55±0.70 | 45.64±0.63 | 48.97±0.69 |
+
+the proposed bi-directional prototypical alignment is an effective approach to leveraging unlabeled images to reduce domain gap for CDCS-FSL.
+
+# 5.3 Analysis
+
+Has stabPA learned compact and aligned representations? To verify whether stabPA indeed learns compact and aligned representations, we visualize the feature distributions through the meta-training process using t-SNE [22]. From Figure 3 (a)-(d), it can be seen that in the beginning, samples from different classes are heavily mixed. There are no distinct classification boundaries between classes. Besides, samples from two domains are far away from each other, indicating the existence of a considerable domain shift (such as the classes in green and orange). However, as training continues, samples from the same class begin
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(g)
+Fig. 3. (a)-(d) t-SNE visualization of feature distribution at different training epochs. Samples of the same class are painted in similar colors, where darker triangles represent source samples and lighter reverted triangles represent target samples (best viewed in color). Class centers are marked in black border. (e) Domain distance on novel classes. (f)-(g) Separability among novel classes in the source and target domains. Separability is represented by the average distance ratio, the lower the better.
+
+to aggregate together, and the margins between different classes are increasing. In other words, compact feature representation can be obtained by the $stabPA$ . Moreover, we can see that samples from different domains are grouped into their ground-truth classes, even though no label information is given for the target domain data. These observations demonstrate that $stabPA$ is indeed capable to learn compact and aligned representations.
+
+Can stabPA learn generalizable representations for novel classes? To validate the generalization capability of the representations learned by stabPA, we propose two quantitative metrics, Prototype Distance (PD) and Average Distance Ratio (ADR), which indicate the domain distance and class separability among novel classes, respectively. A small PD value means the two domains are well aligned to each other, and a ADR less than 1 indicates most samples are classified into their ground-truth classes. Detailed definitions about these two metrics can be found in the appendix.
+
+We compare stabPA with a FSL baseline [37] that does not leverage target images, and the BasicPA which aligns two domains by simply minimizing the point-to-point distance between prototypes in two domains [44]. The results are presented in Figure 3 (e)-(g). It is noticed that all these methods can achieve lower domain distance as training processes, and BasicPA gets the lowest domain distance at the end. However, BasicPA does not improve the class separability as much as our approach, as shown in Figure 3 (f)-(g). The inferior class separability can be understood that BasicPA merely aims to reduce the feature distance
+
+Table 3. The influence of the number of unlabeled samples and the number of base classes in the auxiliary set. We report average accuracy on DomainNet over 6 situations.
+
+ | FixMatch [33] | number of samples | number of base classes |
| 10% | 40% | 70% | 100% | 0% | 10% | 40% | 70% | 100% |
| 1-shot | 47.72 | 51.76 | 52.97 | 53.42 | 53.92 | 50.74 | 51.59 | 52.48 | 53.24 | 53.92 |
| 5-shot | 62.58 | 65.96 | 67.56 | 67.96 | 68.55 | 65.04 | 65.68 | 67.07 | 67.87 | 68.55 |
+
+Table 4. Pseudo label accuracy on DomainNet real-painting.
+
+ | fixed | epoch=0 | 10 | 20 | 30 | 40 | 50 |
| Top-1 | 23.5 | 4.9 | 24.2 | 30.8 | 34.4 | 35.9 | 37.2 |
| Top-5 | 40.0 | 14.4 | 41.9 | 48.2 | 51.4 | 52.8 | 53.9 |
+
+between two domains, without taking account of the intra-class variance and inter-class distances in each domain. Instead of aligning centers adopted by BasicPA, the proposed stabPA considers the feature-to-prototype distances across different domains and classes, so the domain alignment and class separability can be improved at the same time.
+
+Number of unlabeled target data. To test the robustness to the number of unlabeled samples, we gradually drop data from the auxiliary set in two ways: (i) randomly drop samples from the auxiliary set, (ii) select a subset of base classes and then manually remove samples that are from the selected classes. Table 3 shows the average accuracy of $stabPA$ on DomainNet over 6 situations. Unsurprisingly, decreasing the number of samples will lead to performance drop (about 2.4 points from $100\%$ to $10\%$ ). However, with only $10\%$ samples remained, our approach still outperforms FixMatch which uses $100\%$ auxiliary data. We can also see that removing whole classes leads to more performance drop than randomly removing samples, probably due to the class imbalance problem caused by the former. Nevertheless, the difference is very small (about 0.3 points), indicating that our approach is robust to the number of base classes.
+
+Pseudo label accuracy. In Table 4, we show the pseudo label accuracies of the target domain images obtained by the fixed classifier and the online classifier during the training process. We can see that the fixed classifier is better than the online classifier at the early training epochs. However, as the training goes on, the online classifier gets more accurate and outperforms the fixed classifier. This is because the online classifier is updated along the representation alignment process and gradually fits the data distribution of the target domain. After training with 50 epochs, the online classifier achieves $53.9\%$ top-5 accuracy. To further improve the reliability of pseudo labels, we set a threshold to filter out pseudo labels with low confidence. Therefore, the actual pseudo label accuracy is higher than $53.9\%$ .
+
+Table 5. Ablation studies on DomainNet with $95\%$ confidence interval.
+
+| \( \ell_{s-t} \) | \( \ell_{t-s} \) | aug | real-sketch | sketch-real |
| 1-shot | 5-shot | 1-shot | 5-shot |
| × | × | × | 40.23±0.73 | 50.41±0.80 | 41.90±0.86 | 56.95±0.84 |
| × | × | ✓ | 41.74±0.78 | 51.03±0.85 | 42.17±0.95 | 57.11±0.93 |
| ✓ | × | × | 42.86±0.78 | 52.16±0.78 | 44.83±0.95 | 60.87±0.91 |
| × | ✓ | × | 44.20±0.77 | 54.83±0.79 | 44.45±0.92 | 61.97±0.90 |
| ✓ | ✓ | × | 47.01±0.84 | 56.68±0.81 | 47.59±1.00 | 64.32±0.86 |
| ✓ | ✓ | ✓ | 50.85±0.86 | 61.37±0.82 | 51.71±1.01 | 68.93±0.87 |
+
+Ablation studies. We conduct ablation studies on key components of the proposed stabPA. The results on DomainNet are shown in Table 5. As all key components are removed (the first row), our approach is similar to Tian et al. [37] that trains feature extractor with only the source data. When the unlabeled target data are available, applying either source-to-target alignment or target-to-source alignment can improve the performance evidently. Interestingly, we can see that the target-to-source alignment is more effective than the source-to-target alignment (about 1.2 points on average). This is probably because the source prototypes estimated by the ground truth labels are more accurate than the target prototypes estimated by the pseudo labels. Improving the quality of target prototypes may reduce this gap. Combining these two alignments together, we can get better results, indicating that the two alignments are complementary to each other. Finally, the best results are obtained by combining the strong data augmentation techniques, verifying that strong data augmentation can further strengthen the cross-domain alignment.
+
+# 6 Conclusions
+
+In this work, we have investigated a new problem in FSL, namely CDCS-FSL, where a domain gap exists between the support set and query set. To tackle this problem, we have proposed stabPA, a prototype-based domain alignment framework to learn compact and cross-domain aligned representations. On two widely-used multi-domain datasets, we have compared our approach to multiple elaborated baselines. Extensive experimental results have demonstrated the advantages of our approach. Through more in-depth analysis, we have validated the generalization capability of the representations learned by stabPA and the effectiveness of each component of the proposed model.
+
+# Acknowledgements
+
+This work was supported in part by the National Natural Science Foundation of China under Grants 61721004, 61976214, 62076078, 62176246 and in part by the CAS-AIR.
+
+# References
+
+1. Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A., Pereira, F., Vaughan, J.W.: A theory of learning from different domains. Machine Learning 79(1), 151-175 (2010)
+2. Bengio, Y., Louradour, J., Collobert, R., Weston, J.: Curriculum learning. In: International Conference on Machine Learning (2009)
+3. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: International Conference on Machine Learning. pp. 1597-1607. PMLR (2020)
+4. Chen, W.Y., Liu, Y.C., Kira, Z., Wang, Y.C.F., Huang, J.B.: A closer look at few-shot classification. In: International Conference on Learning Representations (2019)
+5. Chen, W., Si, C., Wang, W., Wang, L., Wang, Z., Tan, T.: Few-shot learning with part discovery and augmentation from unlabeled images. arXiv preprint arXiv:2105.11874 (2021)
+6. Chen, Y., Liu, Z., Xu, H., Darrell, T., Wang, X.: Meta-baseline: Exploring simple meta-learning for few-shot learning. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9062-9071 (2021)
+7. Cubuk, E.D., Zoph, B., Shlens, J., Le, Q.V.: Randaugment: Practical automated data augmentation with a reduced search space. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 702-703 (2020)
+8. DeVries, T., Taylor, G.W.: Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552 (2017)
+9. Finn, C., Abbeel, P., Levine, S.: Model-agnostic meta-learning for fast adaptation of deep networks. In: International Conference on Machine Learning. pp. 1126-1135. PMLR (2017)
+0. Fu, Y., Fu, Y., Jiang, Y.G.: Meta-fdmixup: Cross-domain few-shot learning guided by labeled target data. In: ACMMM (2021)
+1. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. The Journal of Machine Learning Research 17(1), 2096-2030 (2016)
+2. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. Advances in Neural Information Processing Systems 27 (2014)
+3. Gretton, A., Borgwardt, K., Rasch, M., Schölkopf, B., Smola, A.: A kernel method for the two-sample-problem. NeurIPS (2006)
+4. Guan, J., Zhang, M., Lu, Z.: Large-scale cross-domain few-shot learning. In: ACCV (2020)
+5. Guo, Y., Codella, N.C., Karlinsky, L., Codella, J.V., Smith, J.R., Saenko, K., Rosing, T., Feris, R.: A broader study of cross-domain few-shot learning. In: Proceedings of the European conference on computer vision (ECCV). pp. 124-141. Springer (2020)
+6. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9729-9738 (2020)
+7. Hoffman, J., Tzeng, E., Park, T., Zhu, J.Y., Isola, P., Saenko, K., Efros, A., Darrell, T.: Cycada: Cycle-consistent adversarial domain adaptation. In: International Conference on Machine Learning. pp. 1989-1998. PMLR (2018)
+
+18. Islam, A., Chen, C.F.R., Panda, R., Karlinsky, L., Feris, R., Radke, R.J.: Dynamic distillation network for cross-domain few-shot recognition with unlabeled data. Advances in Neural Information Processing Systems 34, 3584-3595 (2021)
+19. Lee, K., Maji, S., Ravichandran, A., Soatto, S.: Meta-learning with differentiable convex optimization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2019)
+20. Liang, H., Zhang, Q., Dai, P., Lu, J.: Boosting the generalization capability in cross-domain few-shot learning via noise-enhanced supervised autoencoder. In: ICCV (2021)
+21. Long, M., CAO, Z., Wang, J., Jordan, M.I.: Conditional adversarial domain adaptation. In: Advances in Neural Information Processing Systems (2018)
+22. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of Machine Learning Research 9(11) (2008)
+23. Mangla, P., Kumari, N., Sinha, A., Singh, M., Krishnamurthy, B., Balasubramanian, V.N.: Charting the right manifold: Manifold mixup for few-shot learning. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 2218-2227 (2020)
+24. Panareda Busto, P., Gall, J.: Open set domain adaptation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 754-763 (2017)
+25. Peng, X., Bai, Q., Xia, X., Huang, Z., Saenko, K., Wang, B.: Moment matching for multi-source domain adaptation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 1406-1415 (2019)
+26. Phoo, C.P., Hariharan, B.: Self-training for few-shot transfer across extreme task differences. In: International Conference on Learning Representations (2021)
+27. Qiao, S., Liu, C., Shen, W., Yuille, A.L.: Few-shot image recognition by predicting parameters from activations. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7229-7238 (2018)
+28. Ravi, S., Larochelle, H.: Optimization as a model for few-shot learning. In: International Conference on Learning Representations (2017)
+29. Rusu, A.A., Rao, D., Sygnowski, J., Vinyals, O., Pascanu, R., Osindero, S., Hadsell, R.: Meta-learning with latent embedding optimization. In: International Conference on Learning Representations (2019)
+30. Saito, K., Kim, D., Sclaroff, S., Saenko, K.: Universal domain adaptation through self supervision. arXiv preprint arXiv:2002.07953 (2020)
+31. Saito, K., Yamamoto, S., Ushiku, Y., Harada, T.: Open set domain adaptation by backpropagation. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 153-168 (2018)
+32. Snell, J., Swersky, K., Zemel, R.: Prototypical networks for few-shot learning. In: Advances in Neural Information Processing Systems. vol. 30 (2017)
+33. Sohn, K., Berthelot, D., Li, C.L., Zhang, Z., Carlini, N., Cubuk, E.D., Kurakin, A., Zhang, H., Raffel, C.: Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685 (2020)
+34. Sung, F., Yang, Y., Zhang, L., Xiang, T., Torr, P.H., Hospedales, T.M.: Learning to compare: Relation network for few-shot learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1199-1208 (2018)
+35. Tanwisuth, K., FAN, X., Zheng, H., Zhang, S., Zhang, H., Chen, B., Zhou, M.: A prototype-oriented framework for unsupervised domain adaptation. In: NeurIPS (2021)
+36. Tarvainen, A., Valpola, H.: Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In: Advances in Neural Information Processing Systems. vol. 30 (2017)
+
+37. Tian, Y., Wang, Y., Krishnan, D., Tenenbaum, J.B., Isola, P.: Rethinking few-shot image classification: a good embedding is all you need? In: Proceedings of the European Conference on Computer Vision (ECCV) (2020)
+38. Tsai, Y.H., Hung, W.C., Schulter, S., Sohn, K., Yang, M.H., Chandraker, M.: Learning to adapt structured output space for semantic segmentation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7472-7481 (2018)
+39. Tseng, H.Y., Lee, H.Y., Huang, J.B., Yang, M.H.: Cross-domain few-shot classification via learned feature-wise transformation. In: ICLR (2020)
+40. Venkateswara, H., Eusebio, J., Chakraborty, S., Panchanathan, S.: Deep hashing network for unsupervised domain adaptation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 5018-5027 (2017)
+41. Vilalta, R., Drissi, Y.: A perspective view and survey of meta-learning. Artificial Intelligence Review 18(2), 77-95 (2002)
+42. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. Advances in neural information processing systems 29, 3630-3638 (2016)
+43. Wang, H., Deng, Z.H.: Cross-domain few-shot classification via adversarial task augmentation. In: IJCAI (2021)
+44. Xie, S., Zheng, Z., Chen, L., Chen, C.: Learning semantic representations for unsupervised domain adaptation. In: International Conference on Machine Learning. pp. 5423-5432. PMLR (2018)
+45. You, K., Long, M., Cao, Z., Wang, J., Jordan, M.I.: Universal domain adaptation. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 2720-2729 (2019)
+46. Zhang, C., Cai, Y., Lin, G., Shen, C.: Deepemd: Few-shot image classification with differentiable earth mover's distance and structured classifiers. In: IEEE/CVF Conference on Computer Vision and Pattern Recognition (June 2020)
+47. Zhang, P., Zhang, B., Zhang, T., Chen, D., Wang, Y., Wen, F.: Prototypical pseudo label denoising and target structure learning for domain adaptive semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12414-12424 (2021)
+48. Zhang, Q., Zhang, J., Liu, W., Tao, D.: Category anchor-guided unsupervised domain adaptation for semantic segmentation. In: Advances in Neural Information Processing Systems. vol. 32 (2019)
+49. Zheng, Z., Yang, Y.: Rectifying pseudo label learning via uncertainty estimation for domain adaptive semantic segmentation. International Journal of Computer Vision 129(4), 1106-1120 (2021)
\ No newline at end of file
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/images.zip b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9b5497d87a76355b5c37f9bc3ad48f9281b4ac24
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:70d185267e5c93c8562864ba08c7447682aba2dbf273434302b29ca5f7c4fde4
+size 734978
diff --git a/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/layout.json b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..97fa2d26c22017c385e44cba8a8ee8f92518e061
--- /dev/null
+++ b/crossdomaincrosssetfewshotlearningvialearningcompactandalignedrepresentations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eeae71d326b4b704fe8f22091c79e4d9690acc2dd6104a6ec42c9ef425bf4bf3
+size 414640
diff --git a/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_content_list.json b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..dc70d35b263a52ec593c3d0a79c55cf8473fd748
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab889d6d4894d1b1083171783e86ef5c23e9f8ddfe25c5d1615f3f0dacaf23c4
+size 94809
diff --git a/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_model.json b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..67a8fbedd88b95cfa2d9c8e907a15ba10ba27086
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c1d91053fa71d4be77b528988ab0959e9b1c4dc2ba9357e3bae2844a43e90aeb
+size 122622
diff --git a/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_origin.pdf b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..64764af745f4732c8e8c2b9086d3e3f8b756e427
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/77836be1-3f6d-4a4f-a564-eff2bdc3f958_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85cdc5f5429fd0618536d4c1efa83c80738adc3fe0e41cf5c10f4d30f63bd8fd
+size 3388591
diff --git a/crossdomainensembledistillationfordomaingeneralization/full.md b/crossdomainensembledistillationfordomaingeneralization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0f84d906814f55226d258a55f4855e29a5dec72f
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/full.md
@@ -0,0 +1,354 @@
+# Cross-Domain Ensemble Distillation for Domain Generalization
+
+Kyungmoon Lee $^{1,2}$
+
+Sungyeon Kim
+
+Suha Kwak²
+
+$^{1}$ NALBI Inc, Seoul, Korea $^{2}$ POSTECH, Pohang, Korea kyungmoon@nalbi.ai, {sungyeon.kim, suha.kwak}@postech.ac.kr http://cvlab.postech.ac.kr/research/XDED/
+
+Abstract. Domain generalization is the task of learning models that generalize to unseen target domains. We propose a simple yet effective method for domain generalization, named cross-domain ensemble distillation (XDED), that learns domain-invariant features while encouraging the model to converge to flat minima, which recently turned out to be a sufficient condition for domain generalization. To this end, our method generates an ensemble of the output logits from training data with the same label but from different domains and then penalizes each output for the mismatch with the ensemble. Also, we present a de-stylization technique that standardizes features to encourage the model to produce style-consistent predictions even in an arbitrary target domain. Our method greatly improves generalization capability in public benchmarks for cross-domain image classification, cross-dataset person re-ID, and cross-dataset semantic segmentation. Moreover, we show that models learned by our method are robust against adversarial attacks and unseen corruptions.
+
+Keywords: domain generalization, knowledge distillation, flat minima
+
+# 1 Introduction
+
+Deep neural networks (DNNs) have brought remarkable advances in a number of research areas such as image classification [43], image synthesis [24], and reinforcement learning [54]. The huge success of DNNs depends heavily on the assumption that training and test data are sampled under the independent and identically distributed (i.i.d.) condition. However, this assumption often does not hold in real-world scenarios; a large error occurs due to the discrepancy between training and test data, also known as the domain shift problem. As a solution to this problem, domain generalization, the task of learning models that generalize to unseen target domains, is in the spotlight. A key to the success of domain generalization is to learn invariant features across domains. To this end, most previous methods align feature distributions of multiple domains by adversarial training [48,49], minimizing the dissimilarity between the distributions of source domains [55], or contrastive learning [40]. Then, a classifier is trained to predict the labels for the aligned source features in hopes that it will also generalize well
+
+
+Fig. 1: Illustration of cross-domain ensemble distillation (XDED). Although the four images share the same class label, their predictions manifest different inter-class relations due to the visual gap between domains. XDED constructs an ensemble by averaging all predictions and matches it with each prediction.
+
+for any target domain. However, this approach often drops performance when the target domain differs substantially from the source domains as the model is prone to overfit to the source domains.
+
+Meanwhile, the relationship between the geometry of loss landscapes and generalization ability has attracted increasing attention [18,20,36,38]. In particular, converging to flat minima in loss landscapes is known as a key to achieve robustness against the loss landscape shift between training and test datasets. Inspired by the observation that higher posterior entropy helps a model converge to flat minima [10,60,89], entropy regularization techniques like self-knowledge distillation [87] and entropy maximization [9] have been proposed to increase entropy rather than forcing a model to completely fit training data (i.e., one-hot labels) to induce low entropy. Since the degree of loss landscape shift is generally expected to be bigger in the case of domain generalization, it is more important to converge to flat minima in domain generalization. However, the benefit of flat minima in the context of domain generalization has not been actively studied yet.
+
+In this paper, we propose a novel method, named cross-domain ensemble distillation (XDED), that learns domain-invariant features while encouraging convergence to flat minima for domain generalization. Specifically, XDED generates an ensemble of the output logits for the data with the same label but from different domains, and then penalizes each output for the mismatch with the ensemble (Fig. 1). By doing so, it enables a model to learn domain-invariant features by enforcing prediction consistency between the data with the same label but from different domains. Also, XDED increases the posterior entropy of
+
+each output distribution, which helps the model converge to flat minima as the entropy regularization does. To the best of our knowledge, XDED is the first to achieve these two objectives simultaneously for domain generalization, and this contribution leads to significant performance improvement.
+
+Since XDED is still limited to exploiting the information of only source domains, there is further room to reduce the domain gap with the target domain. Hence, we also introduce a de-stylization technique well-suited to domain generalization, called UniStyle. UniStyle suppresses domain-specific style bias simply by standardizing intermediate feature maps of input image during both training and test time. Thanks to UniStyle, our model produces style-consistent predictions not only for the source domains but also for the target domain, which greatly reduces the domain gap and boosts the effect of XDED.
+
+Based on the recent theoretical result on the relationship between the domain generalization and the flatness of local minima [8], we first empirically show that the proposed framework can improve generalization capability by achieving two goals: promoting flat minima and reducing the domain gap. Next, we further demonstrate the superiority of our method through extensive experimental results. On the standard public benchmarks for cross-domain image classification, XDED significantly enhances generalization ability in both multi-source and single-source settings. We also validate the effectiveness of our method in various domain generalization scenarios by showing the non-trivial improvement on the DomainBed [26], cross-dataset person re-ID [90,91], and cross-dataset semantic segmentation experiments. Moreover, we demonstrate that models learned by our method also help achieve robustness against adversarial attacks and unseen image corruptions.
+
+# 2 Related Work
+
+Domain generalization. The goal of domain generalization is to learn domain-invariant features that well generalize to unseen target domains. For the purpose, existing methods match feature distributions of different domains by adversarial feature alignment [48,49] or reducing the difference between feature distributions of diverse source domains [55]. Recently, meta-learning frameworks [2,16,47] have been introduced to simulate the domain shift by dividing the meta-train and meta-test domains from source domains. Also, data augmentation methods have been proposed to generate more diverse data beyond those of given source domains [37,41,66,77,93]. Most similar to our framework, ensemble methods for domain generalization have been proposed [79,65,94]. They all train multiple modules such as exemplar SVMs [79], domain-specific BN [34] layers [65] or classifiers [94], and exploit the ensemble of learned modules for prediction in testing. However, we remark that our XDED utilizes the ensemble of model predictions as the soft label and transfers it to the model itself. Therefore, it does not demand any additional module during both training and testing.
+
+Knowledge distillation (KD). KD was originally studied to transfer the knowledge of a deep model to a shallow model for model compression [31].
+
+It has been also used for other purposes such as metric learning [59,42] and network regularization [78,87,84]. In particular for network regularization, self-knowledge distillation (self-KD) has been studied; it distills knowledge from the model itself and enforces prediction consistency between a sample and its perturbed one or other samples. KD has been used for domain adaptation [52,19], and such method trains several teacher models from the source domains and distills the ensemble of their predictions to the student model. It unfortunately requires large memory due to multiple teachers, and are difficult to be extended to domain generalization as they demand target images in training. In contrast, our method improves generalization capability of a model on unseen domains without the need for target images and additional teacher models.
+
+Flat minima in loss landscapes. Recent analyses have revealed that finding flat minima is crucial for model generalization [38,18,20]. In this context, multiple methods have been proposed to promote flat minima in loss landscapes since flat minima have an advantage over sharp minima in robustness against the loss landscape shift between training and test data. Among literature on ways of promoting flat minima (e.g., weight averaging [35,8] and training strategies [20,10]), we focus on the high entropy-seeking approaches, on which XDED is based. Maximum Entropy [60,9] maximizes the entropy of an output distribution from a classifier. Similarly, KD-based methods also aim at inducing high entropy of the output distribution by penalizing the mismatch with the output distribution from that of another classifier such as differently initialized peer networks [89] or subnetworks within a network itself [87]. Although SWAD [8] has introduced the importance of flat minima in the area of domain generalization, we remark that SWAD belongs to weight averaging but does not focus on learning domain-invariant features, whereas XDED belongs to entropy regularization as well as is designed for learning domain-invariant features.
+
+Bias towards styles. Recent studies [6,22] revealed that DNNs overly depend on a strong bias towards styles, and it is also confirmed in the domain generalization literature [12,95,37] that a visual domain is highly correlated to feature statistics. Hence, previous work defines image styles as the bias and attempts to remove the bias by style augmentation in the space of feature statistics [95,37], using another model that is intentionally biased to styles [56], or minimizing a whitening loss [12]. Distinct from these techniques, we show that a simple yet effective de-stylization technique leads to a smaller divergence measure between target and source domains without bells and whistles.
+
+# 3 Our Method
+
+# 3.1 Cross-Domain Ensemble Distillation
+
+Review of knowledge distillation (KD). The goal of KD [31] is to transfer knowledge of a teacher model $t$ to a student model $s$ , usually a wide and deep model to a smaller one, for the purposes of model compression or model regularization. Given input data point $x$ and its label $y \in \{1, \dots, C\}$ , we denote
+
+the output logit of model as $z(x) = [z_1(x), \dots, z_C(x)]$ . The posterior predictive distribution of $x$ is then formulated as:
+
+$$
+P (y | x; \theta , \tau) = \frac {\exp \left(z _ {y} (x) / \tau\right)}{\sum_ {i = 1} ^ {C} \exp \left(z _ {i} (x) / \tau\right)}, \tag {1}
+$$
+
+where the model is parameterized by $\theta$ and $\tau$ is a temperature scaling parameter. KD enforces to match the predictive distributions of $s$ and $t$ . Specifically, it is achieved by minimizing the Kullback-Leibler (KL) divergence between their predictive distributions as follows:
+
+$$
+\mathcal {L} _ {\mathrm {K D}} (X; \theta_ {s}, \tau) = \sum_ {x _ {i} \in X} \sum_ {c = 1} ^ {C} D _ {K L} \left(P \left(c \mid x _ {i}; \theta_ {t}, \tau\right) | | P \left(c \mid x _ {i}; \theta_ {s}, \tau\right)\right), \tag {2}
+$$
+
+where $X$ is a batch of input data, $\theta_t$ and $\theta_s$ are the parameters of a teacher and a student, respectively.
+
+Cross-domain ensemble distillation. We propose a new KD method for domain generalization, called cross-domain ensemble distillation (XDED). XDED aims to construct the domain-invariant knowledge from the data of multiple domains. Specifically, XDED generates an ensemble of logits from the data with the same label but from different domains. Next, XDED penalizes each logit for the mismatch with the ensemble which is not biased towards a specific domain, which encourages learning domain-invariant features. Unlike the conventional KD, XDED does not require an additional network that increases training complexity (e.g., extra parameters and training time) but distills the ensemble constructed by multiple samples to the model itself in the form of self-KD.
+
+Formally, let $X_{y}$ denote the set of samples that have the same class label $y$ in a mini-batch. Then, we obtain an ensemble of logits from $X_{y}$ by simply taking an average as:
+
+$$
+\bar {z} \left(X _ {y}\right) = \sum_ {x _ {i} \in X _ {y}} \frac {z \left(x _ {i}\right)}{\left| X _ {y} \right|}. \tag {3}
+$$
+
+Then, the predictive distribution for the ensemble created from data $X_{y}$ is as:
+
+$$
+\bar {P} (c \mid X _ {y}; \theta , \tau) = \frac {\exp \left(\bar {z} _ {c} \left(X _ {y}\right) / \tau\right)}{\sum_ {i = 1} ^ {C} \exp \left(\bar {z} _ {i} \left(X _ {y}\right) / \tau\right)}, \tag {4}
+$$
+
+The loss function of XDED is defined as follows:
+
+$$
+\mathcal {L} _ {\mathrm {X D E D}} \left(X _ {y}; \theta , \tau\right) = \sum_ {x _ {i} \in X _ {y}} \sum_ {c = 1} ^ {C} D _ {K L} (\bar {P} (c | X _ {y}; \hat {\theta}, \tau) | | P (c | x _ {i}; \theta , \tau)), \tag {5}
+$$
+
+where $\hat{\theta}$ is a fixed copy of the parameter $\theta$ . Following [53,84], we stop the gradient to be propagated through $\hat{\theta}$ to prevent the model from falling into some trivial
+
+solutions. To sum up, we set our objective function as
+
+$$
+\min _ {\theta} L _ {\theta} = \mathcal {L} _ {\mathrm {C E}} (X, Y; \theta) + \lambda \sum_ {y \in Y} \mathcal {L} _ {\mathrm {X D E D}} \left(X _ {y}; \theta , \tau\right), \tag {6}
+$$
+
+where $X$ is a batch of input images, $Y$ is a batch of corresponding class labels, $\mathcal{L}_{\mathrm{CE}}$ denotes the vanilla cross-entropy loss, and $\lambda$ is a hyperparameter to balance $\mathcal{L}_{\mathrm{CE}}$ and $\mathcal{L}_{\mathrm{XDED}}$ . $\lambda$ and $\tau$ are 5.0 and 4.0 throughout this paper.
+
+# 3.2 UniStyle: removing and unifying style bias
+
+To further regularize the model to produce style-consistent predictions, we propose a de-stylization technique that is well-suited to domain generalization. As source domain styles are not expected to appear at test time, we propose UniStyle to prevent the model from being biased towards the domain-specific styles, which reduces the domain gap with the target domain.
+
+More specifically, following existing methods based on style transfer [17,32,70], we first represent a neural style as statistics of intermediate feature maps from the feature extractor. Formally, let $F \in \mathbb{R}^{C \times H \times W}$ denote an intermediate feature map of an image. Then, a neural style of the image is represented as the combination of channel-wise mean $\mu(F) \in \mathbb{R}^C$ and standard deviation $\sigma(F) \in \mathbb{R}^C$ of $F$ as:
+
+$$
+\mu_ {c} (F) = \frac {1}{H W} \sum_ {h = 1} ^ {H} \sum_ {w = 1} ^ {W} F _ {c, h, w}, \tag {7}
+$$
+
+and
+
+$$
+\sigma_ {c} (F) = \sqrt {\frac {1}{H W} \sum_ {h = 1} ^ {H} \sum_ {w = 1} ^ {W} \left(F _ {c , h , w} - \mu_ {c} (F)\right) ^ {2}}, \tag {8}
+$$
+
+where $\mu(F) = [\mu_1(F), \dots, \mu_C(F)]$ and $\sigma(F) = [\sigma_1(F), \dots, \sigma_C(F)]$ . Next, we simply standardize each feature to have constant channel-wise statistics, $\mu_W$ and $\sigma_W$ as:
+
+$$
+\operatorname {U n i S t y l e} (F) = \sigma_ {W} \frac {F - \mu (F)}{\sigma (F)} + \mu_ {W}, \tag {9}
+$$
+
+where $\mu_W = 0$ and $\sigma_W = 1$ (i.e., zero-mean standardization). Technically, UniStyle is a special case of InstanceNorm (IN) [70]. Nevertheless, we remark that UniStyle aims to remove domain-specific information without any learnable parameters to reduce the domain gap while IN learns channel-wise scaling and bias parameters for style transfer. Also, note that we empirically observed that UniStyle is effective when being applied at multiple early layers, which is aligned with recent studies [17,32] suggesting that the style information is usually captured at the early layers. $^1$
+
+Table 1: Comparison of the entropy values. When each model is converged, the entropy value is calculated by averaging over all training samples.
+
+| Methods | OfficeHome (Clipart) | PACS (Cartoon) |
| Entropy | Accuracy | Entropy | Accuracy |
| ResNet-18 | 0.25 | 49.4 | 0.01 | 75.9 |
| MixStyle [95] | 0.35 | 53.4 | 0.03 | 78.8 |
| XDED | 0.92 | 55.2 | 0.38 | 81.7 |
+
+# 3.3 Analysis of Our Method
+
+In this section, we analyze the effectiveness of XDED, especially through the link to the theoretical result and the supporting empirical evidences. We first begin with a theorem related to domain adaptation [3,4], which shows that the expected risk on the target domain is bounded by that on the source domain and the divergence between these domains. To find a model parameter $\theta \in \Theta$ for domain generalization, Cha et al. [8] considered a robust empirical loss:
+
+$$
+\hat {\varepsilon} _ {S} ^ {\gamma} (\theta) := \max _ {| | \Delta | | \leq \gamma} \hat {\varepsilon} _ {S} (\theta + \Delta) \tag {10}
+$$
+
+where $\hat{\varepsilon}_S(\theta)$ is an empirical risk over source domains $S$ and $\gamma$ is a radius which defines neighbor parameters of $\theta$ . Then, Cha et al. [8] proved that finding flat minima reduces the domain gap through the theorem below:
+
+Theorem 1. Consider a set of $N$ covers $\{\Theta_k\}_{k=1}^N$ such that the hypothesis space $\Theta \subset \cup_k^N \Theta_k$ where $\text{diam}(\Theta) := \sup_{\theta, \theta' \in \Theta} ||\theta - \theta'|_2, N := \lceil (\text{diam}(\Theta) / \gamma)^d \rceil$ and $d$ is dimension of $\Theta$ . Let $v_k$ be a VC dimension of each $\Theta_k$ . Then, for any $\theta \in \Theta$ , the following bound holds with probability at least $1 - \delta$ ,
+
+$$
+\varepsilon_ {T} (\theta) < \hat {\varepsilon} _ {S} ^ {\gamma} (\theta) + \frac {1}{2 I} \sum_ {i = 1} ^ {I} D i v (S _ {i}, T) + \max _ {k \in [ 1, N ]} \sqrt {\frac {v _ {k} \ln (m / v _ {k}) + \ln (N / \delta)}{m}}, \tag {11}
+$$
+
+where $m = nI$ is the number of training samples and $\text{Div}(S_i, T)$ is the divergence between the source domain $S_i$ and the target domain $T$ .
+
+We remark that, in Eq. (11), the test loss $\varepsilon_T(\theta)$ is bounded by three terms: (1) the robust empirical loss $\hat{\varepsilon}_S^\gamma (\theta)$ , (2) the divergence $\mathrm{Div}(S_i,T)$ , and (3) a confidence bound depending on the radius $\gamma$ and the number of training samples $m$ . In the rest of this section, according to the above theorem, we provide a theoretical interpretation that our method enhances the generalization ability by lowering both $\hat{\varepsilon}_S^\gamma (\theta)$ and $\mathrm{Div}(S_i,T)$ with the empirical evidences.
+
+Promoting flat minima. We remark that XDED is motivated by recent entropy regularization methods [9,87,89] in pursuit of flat minima. It has been empirically demonstrated that these methods promote flat minima by inducing higher posterior entropy. It can be interpreted as relaxing the training procedure to learn richer information encoded in soft labels, which helps the model converge to flat minima more than forcing the model to completely fit one-hot
+
+
+Fig. 2: Train/Test losses versus the weight perturbation while varying the standard deviation of the added Gaussian noise. Note that the results are produced with the target domain (Art of PACS) and the rest source domains, and the loss values are log-scaled.
+
+
+Fig.3: Comparison to existing methods promoting flat minima. Each model is evaluated on Cartoon of PACS after being trained on the rest source domains. Left: The divergence $(\mathcal{A}$ -distance) between the source domains and the target domain, Right: Generalization performance on the target domain.
+
+
+
+labels. In this context, we also demonstrate that XDED clearly induces higher entropy as shown in Table 1. Considering that XDED is motivated by the observation that different domains manifest different inter-class relations due to the domain gap (Fig. 1), this is natural since our ensembles would integrate meaningful inter-class relations from multiple domains and the model learned with them would be led towards high entropy.
+
+Next, to investigate whether the model learned with XDED converges to flat minima indeed, we quantify the flatness of the local minima where the model converged by measuring the increase of loss values between $\theta$ and its neighborhoods, assuming that the model converged in flat minima would have smaller increases. Following [8,9,87,89], we measure the losses of the learned models before and after adding Gaussian noises to model parameters while varying the standard deviation of the noise $\sigma_{\epsilon}$ (i.e., $\mathcal{L}_{\mathrm{CE}}(X,Y;\theta +\epsilon)$ where $\epsilon \sim N(0,\sigma_{\epsilon})$ ) with 100 runs. As a result, XDED demonstrates its robustness against the weight perturbation with smaller loss increases as shown in Fig. 2.
+
+Domain-invariant feature learning. Here, we highlight that XDED also learns domain-invariant features via regularizing the consistency between the
+
+predictions from the data with the same label but from different domains and their ensemble. Thus, we compare XDED with existing methods promoting flat minima, which are dedicated to the flatness of local minima only. Specifically, to examine the effectiveness in reducing the divergence $\mathrm{Div}(S_i,T)$ , we measure $\mathcal{A}$ -distance [3,39]. Due to the computational intractability, we calculated an approximated one [50,56] $^2$ As shown in Fig. 3 (Left), we observe that the existing methods promoting flat minima fail to reduce the distance while XDED clearly lowers the distance and UniStyle further enhances the result. Naturally, that result is connected to the quantitative superiority of our framework over existing flat minima-promoting methods (Fig. 3 (Right)).
+
+# 4 Experiments
+
+# 4.1 Generalization in image classification
+
+Multi-source domain generalization. Specifically, for a fair comparison, we follow the leave-one-domain-out protocol [45] where we train a model on three domains and evaluate it on the remaining domain. For the benchmark datasets, we employ the PACS [45] and OfficeHome [72] that are widely-used benchmarks for domain generalization in image classification. PACS contains 9,991 images of 7 classes over 4 domains: Art Painting, Cartoon, Photo, and Sketch. OfficeHome includes 15,500 images of 65 classes over 4 domains: Artistic, Clipart, Product, and Real. We use ResNet-18 [27] as the backbone, and our UniStyle is applied to output feature maps of the first and second residual blocks for PACS and the first one only for OfficeHome.
+
+Results. As summarized in Table. 2, we observe that our method not only significantly enhances the vanilla but also outperforms the latest competing methods. In particular, our method outperforms the second-best method on Cartoon of PACS and Clipart of OfficeHome by about $4.0\%$ and $2.0\%$ , respectively. These results justify the superiority of our method, which is simple yet effective.
+
+Single-source domain generalization Thanks to the simple design of our proposed method, which does not explicitly require domain labels, our method can be transparently incorporated with single-source domain generalization where we only have access to a single source domain during training. Therefore, to further evaluate the impact of our method on single-source domain generalization, our model is trained on each single domain of PACS and evaluated on the remaining target domains.
+
+Results. As shown in Table. 3, our model, on average, significantly outperforms other baselines by $8.7\%$ in average accuracy. Besides, in all cases except for the case of $C \to S$ , our model shows its superiority in performance. We believe this interesting result stems from the fact that our method is still able to help the model converge to flat minima and exploit the fine-grained relations between intra-domain samples even if only a single source domain is given.
+
+Table 2: Leave-one-domain-out generalization results on PACS and OfficeHome.
+
+ | PACS | OfficeHome |
| Methods | Art | Cartoon | Photo | Sketch | Avg. | Artistic | Clipart | Product | Real | Avg. |
| ResNet-18 | 77.0 | 75.9 | 96.0 | 69.2 | 79.5 | 58.9 | 49.4 | 74.3 | 76.2 | 64.7 |
| MMD-AE [48] | 75.2 | 72.7 | 96.0 | 64.2 | 77.0 | 56.5 | 47.3 | 72.1 | 74.8 | 62.7 |
| JiGen [7] | 79.4 | 75.3 | 96.0 | 71.6 | 80.5 | 53.0 | 47.4 | 71.4 | 72.7 | 61.2 |
| CrossGrad [66] | 79.8 | 76.8 | 96.0 | 70.2 | 80.7 | 58.4 | 49.4 | 73.9 | 75.8 | 64.4 |
| MASF [16] | 80.2 | 77.1 | 94.9 | 71.6 | 81.0 | - | - | - | - | - |
| Epi-FCR [47] | 82.1 | 77.0 | 93.9 | 73.0 | 81.5 | - | - | - | - | - |
| EISNet [74] | 81.8 | 76.4 | 95.9 | 74.3 | 82.1 | - | - | - | - | - |
| L2A-OT [93] | 83.3 | 78.2 | 96.2 | 73.6 | 82.8 | 60.6 | 50.1 | 74.8 | 77.0 | 65.6 |
| SagNet [56] | 83.5 | 77.6 | 95.4 | 76.3 | 83.2 | 60.2 | 45.3 | 70.4 | 73.3 | 62.3 |
| SelfReg [40] | 82.3 | 78.4 | 96.2 | 77.4 | 83.6 | - | - | - | - | - |
| MixStyle [95] | 84.1 | 78.8 | 96.1 | 75.9 | 83.7 | 58.7 | 53.4 | 74.2 | 75.9 | 65.5 |
| L2D [75] | 81.4 | 79.5 | 95.5 | 80.5 | 84.2 | - | - | - | - | - |
| FACT [77] | 85.3 | 78.3 | 95.1 | 79.1 | 84.5 | 60.3 | 54.8 | 74.4 | 76.5 | 66.5 |
| DSON [65] | 84.6 | 77.6 | 95.8 | 82.2 | 85.1 | 59.3 | 45.7 | 71.8 | 74.6 | 62.9 |
| RSC [33] | 83.4 | 80.3 | 95.9 | 80.8 | 85.1 | 58.4 | 47.9 | 71.6 | 74.5 | 63.1 |
| StyleNeophile [37] | 84.4 | 79.2 | 94.9 | 83.2 | 85.4 | 59.5 | 55.0 | 73.5 | 75.5 | 65.8 |
| Ours | 85.6 | 84.2 | 96.5 | 79.1 | 86.4 | 60.8 | 57.1 | 75.3 | 76.5 | 67.4 |
+
+Table 3: Single-source domain generalization accuracy (%) on PACS with a ResNet-18. (A: Art Painting, C: Cartoon, S:Sketch, P:Photo).
+
+| Methods | A → C | A → S | A → P | C → A | C → S | C → P | S → A | S → C | S → P | P → A | P → C | P → S | Avg. |
| ResNet-18 | 62.3 | 49.0 | 95.2 | 65.7 | 60.7 | 83.6 | 28.0 | 54.5 | 35.6 | 64.1 | 23.6 | 29.1 | 54.3 |
| JiGen [7] | 57.0 | 50.0 | 96.1 | 65.3 | 65.9 | 85.5 | 26.6 | 41.1 | 42.8 | 62.4 | 27.2 | 35.5 | 54.6 |
| MixStyle [95] | 65.5 | 49.8 | 96.7 | 69.9 | 64.5 | 85.3 | 27.1 | 50.9 | 32.6 | 67.7 | 38.9 | 39.1 | 57.4 |
| RSC [33] | 62.5 | 53.1 | 96.2 | 68.9 | 70.3 | 85.8 | 37.9 | 56.3 | 47.4 | 66.3 | 26.4 | 32.0 | 58.6 |
| SelfReg [40] | 65.2 | 55.9 | 96.6 | 72.0 | 70.0 | 87.5 | 37.1 | 54.0 | 46.0 | 67.7 | 28.9 | 33.7 | 59.5 |
| SagNet [56] | 67.1 | 56.8 | 95.7 | 72.1 | 69.2 | 85.7 | 41.1 | 62.9 | 46.2 | 69.8 | 35.1 | 40.7 | 61.9 |
| Ours | 74.6 | 58.1 | 96.8 | 74.4 | 69.6 | 87.6 | 43.3 | 65.6 | 50.3 | 71.4 | 54.3 | 51.5 | 66.5 |
+
+DomainBed. We also conduct extensive experiments on the DomainBed [26] which is a testbed for domain generalization to compare state-of-the-art methods across several benchmark datasets. The rationale behind the DomainBed is that the domain generalization performances are too much dependent on the hyperparameter tuning. For a fair comparison, we follow its standard protocols for training and evaluation.
+
+Results. As shown in Table. 4, our method generally shows competitive performances and ranks second out of 15 methods on average accuracy. In particular, on CMNIST, our method substantially outperforms other competing methods. Since CMNIST is designed to simulate the domain shift by correlating the digit colors with the class labels, we conjecture that our improvement on CMNIST is attributed to the de-stylization effect of UniStyle, which would help the model decorrelate between the colors and labels.
+
+Table 4: Domain generalization accuracy (\%) on DomainBed. The column "Terra" stands for TerraIncognita dataset. Note that we adopt leave-one-domain-out cross-validation as a model selection criteria.
+
+| Model selection: leave-one-domain-out cross-validation |
| Methods | CMNIST | RMNIST | VLCS | PACS | OfficeHome | Terra | Avg. |
| ERM [71] | 36.7 | 97.7 | 77.2 | 83.0 | 65.7 | 41.4 | 66.9 |
| IRM [1] | 40.3 | 97.0 | 76.3 | 81.5 | 64.3 | 41.2 | 66.7 |
| GroupDRO [64] | 36.8 | 97.6 | 77.9 | 83.5 | 65.2 | 44.9 | 66.7 |
| Mixup [86] | 33.4 | 97.8 | 77.7 | 83.2 | 67.0 | 48.7 | 67.9 |
| MLDG [46] | 36.7 | 97.6 | 77.2 | 82.9 | 66.1 | 46.2 | 67.7 |
| CORAL [68] | 39.7 | 97.8 | 78.7 | 82.6 | 68.5 | 46.3 | 68.9 |
| MMD [48] | 36.8 | 97.8 | 77.3 | 83.2 | 60.2 | 46.5 | 66.9 |
| DANN [21] | 40.7 | 97.6 | 76.9 | 81.0 | 64.9 | 44.4 | 67.5 |
| CDANN [49] | 39.1 | 97.5 | 77.5 | 78.8 | 64.3 | 39.9 | 66.1 |
| MTL [5] | 35.0 | 97.8 | 76.6 | 83.7 | 65.7 | 44.9 | 67.2 |
| SagNet [56] | 36.5 | 94.0 | 77.5 | 82.3 | 67.6 | 47.2 | 67.5 |
| ARM [88] | 36.8 | 98.1 | 76.6 | 81.7 | 64.4 | 42.6 | 66.7 |
| VREx [44] | 36.9 | 93.6 | 76.7 | 81.3 | 64.9 | 37.3 | 65.1 |
| RSC [33] | 36.5 | 97.6 | 77.5 | 82.6 | 65.8 | 40.0 | 66.6 |
| Ours | 46.5 | 97.7 | 74.8 | 83.8 | 65.0 | 42.5 | 68.4 |
+
+Table 5: Generalization results on the cross-dataset person re-ID.
+
+| Methods | Market → Duke | Duke → Market |
| mAP | R@1 | mAP | R@1 |
| ResNet-50 | 19.3 | 35.4 | 20.4 | 45.2 |
| RandomErase [92] | 14.3 | 27.8 | 16.1 | 38.5 |
| DropBlock [23] | 18.2 | 33.2 | 19.7 | 45.3 |
| MixStyle [95] | 23.4 | 43.3 | 24.7 | 53.0 |
| StyleNeophile [37] | 26.3 | 46.5 | 27.2 | 55.0 |
| Ours | 27.4 | 49.3 | 30.1 | 59.0 |
+
+# 4.2 Generalization in person re-ID
+
+In this section, we further evaluate our method on person re-identification (re-ID), which is to match pedestrians across non-overlapping camera views.
+
+Experimental setup. Here, we address domain generalization for person re-ID, where the test data is collected from cameras of the unseen dataset rather than from those of the training dataset. Specifically, the model trained to match people in the source dataset is evaluated by how well it matches pedestrian data of the unseen test set, which are disjoint from the source dataset. For datasets, we adopt two widely-used benchmarks: Market1501 (Market) [90] and DukeMTMC-reID (Duke) [62,91]. We use 32,668 images of 1,501 identities collected from 6 cameras and 36,411 images of 1,812 identities from 8 cameras for Market1501 and Duke, respectively. As for performance measures, we adopt mean average precision (mAP) and Recall@K (R@K). Following the prior work [95], we adopt ResNet-50 [27] as a backbone architecture. In these experiments, we apply UniStyle to the 1st, 2nd, and 3rd residual blocks of a model.
+
+Table 6: mIoU (%) results on the cross-dataset semantic segmentation. GTA5 is for training, and Cityscapes, SYNTHIA, BDD, and Mapillary are test sets.
+
+| Methods (GTA5) | Cityscapes | BDD | Mapillary | SYNTHIA |
| DeepLabV3+ [11] | 28.9 | 25.1 | 28.1 | 26.2 |
| SW [58] | 29.9 | 27.4 | 29.7 | 27.6 |
| DRPC [82] | 37.4 | 32.1 | 34.1 | 28.0 |
| RobustNet [12] | 36.5 | 35.2 | 40.3 | 28.3 |
| Ours | 39.2 | 32.4 | 37.1 | 28.0 |
+
+Comparison to other regularization methods. As shown in Table. 5, our method substantially outperforms other methods in mAP and Recall@1. Although RandomErase and Dropout are effective for learning discriminative features, they fail to improve performance when encountering unseen domain data. Furthermore, by exploiting inter-class relations provided by different cameras, our method shows its superiority over MixStyle and StyleNeophile which are designed for domain generalization but utilizes one-hot labels only.
+
+# 4.3 Generalization in semantic segmentation
+
+Experimental setup. Lastly, to investigate whether our method can be extended to the dense prediction task, evaluation on semantic segmentation is addressed here. Following the mainstream protocol, we train models on a synthetic dataset and evaluate them on several datasets which mainly belong to real-world. Specifically, we adopt GTA5 [61] as a source dataset which consists of 24,966 images. For target datasets, Cityscapes [13], BDD [81], and Mapillary [57] are real-world datasets whose image sizes are 5,000, 10,000, and 25,000, respectively. Lastly, SYNTHIA [63] has 9,400 images. Note that ResNet-50 is used as the backbone and the common 19 classes are used across all datasets.
+
+Results. We remark that XDED constructs an ensemble by simply averaging all the logits from the pixels whose gt is the same in a mini-batch. As shown in Table 6, ours outperforms the competing methods overall, even if those are dedicated to this task only. We show that our method can be extended to the pixel-wise classification with little modification on XDED. Also, the results support our claim that our method is simple yet effective in a wide range of tasks.
+
+# 4.4 In-depth Analysis
+
+Ablation study. To investigate the impact of each component in our method, we conduct an ablation study which is summarized in Table 7. The result reveals that two components are complementary and consistently help the model improve the generalization ability. For image classification, XDED contributes most to the performance, and UniStyle boosts the effect of XDED. On both domains, XDED uniformly improves the vanilla method by about $6\%$ , whereas UniStyle shows different degrees of improvement. It is because the image style discrepancy between domains in OfficeHome is less severe than that in PACS.
+
+Table 7: Ablation study of the proposed components on cross-domain tasks of image classification (Accuracy) and person re-ID (mAP).
+
+| Methods | Art | Clipart | Market → Duke |
| Vanilla | 77.0 | 49.4 | 19.3 |
| w/ UniStyle | 81.2 | 50.4 | 26.2 |
| w/ XDED | 83.3 | 55.2 | 24.2 |
| Ours | 85.6 | 57.1 | 27.4 |
+
+
+Fig. 4: Visualization results of the loss landscapes incorporating the vanilla method and XDED on the PACS dataset. Note that each loss landscape is visualized on the data of source domains, not the data of the marked target domain. Blue and red surfaces are from the vanilla method and XDED, respectively.
+
+
+
+
+
+
+
+Table 8: Multi-source domain generalization accuracy (%) on Photo of PACS before and after applying given adversarial attacks.
+
+| Methods | Photo | w/ FGSM | w/ PGD |
| ResNet-18 | 96.0 | 39.6 | 16.3 |
| Label smoothing [69] | 95.6 | 43.5 | 20.2 |
| Mixup [86] | 95.8 | 46.5 | 21.9 |
| Manifold mixup [73] | 93.5 | 46.6 | 23.8 |
| MixStyle [95] | 96.1 | 41.4 | 22.7 |
| Ours | 96.5 | 55.4 | 30.4 |
+
+Interestingly, for the task of person re-ID, UniStyle reveals more impact than does XDED. Due to the inherent characteristics of the task itself, the effect of XDED on collecting meaningful knowledge of the same pedestrian from different cameras may become less significant.
+
+Loss surface visualization. To further illustrate how XDED leads to flat minima in the loss landscapes, we provide qualitative results that visualize the loss landscapes. Following [9], we plot the loss landscapes on data of source domains per each case by perturbing the model parameters across the first and second Hessian eigenvectors which are provided by PyHessian [80] which is a framework for Hessian-based analysis of neural networks. As shown in Fig. 4, we observe that the loss landscapes incorporating XDED clearly become flatter than those incorporating the vanilla method for all cases. We argue that these qualitative results also consistently support that XDED promotes flat minima.
+
+Robustness to adversarial examples. Recent studies have demonstrated that convergence on flat minima strengthens the adversarial robustness [76,67].
+
+Table 9: Average classification error (%) on the corruption benchmarks.
+
+| Methods | CIFAR-10-C | CIFAR-100-C |
| 40-2 WRN [85] | 26.9 | 53.3 |
| Cutout [15] | 26.8 | 53.5 |
| Mixup [86] | 22.3 | 50.4 |
| CutMix [83] | 27.1 | 52.9 |
| AutoAug [14] | 23.9 | 49.6 |
| AugMix [29] | 11.2 | 35.9 |
| Ours | 18.5 | 46.6 |
+
+To revalidate that our method promotes flat minima, we evaluate the adversarial robustness of learned models. Specifically, we trained models on source domains and added adversarial perturbations on images of the unseen target domain by using existing adversarial attack methods: FGSM [25] and PGD [51]. Table 8 shows that our method outperforms other regularization methods in terms of robustness against both unseen data and adversarial attacks. Considering that adversarial attacks are made to maximize the loss value, we argue that our superiority in adversarial robustness is also attributed to the capability of promoting flat minima as desired, even though our method has no direct connection to adversarial training.
+
+Results on corruption benchmarks. We further measure the resilience of learned models to unseen corruptions. Following the protocol provided by [28], we trained models on the original training dataset, and evaluated them on the test dataset constructed by corrupting the original test dataset through predefined corruption types. Table. 9 shows that our method outperforms all regularization methods except AugMix [30]. Considering AugMix is a state of the art that is dedicated to corruption robustness while ours is not, we argue that our method still shows its significant robustness against unseen corruptions.
+
+# 5 Conclusion
+
+We have presented a simple yet effective framework for domain generalization. XDED first generates an ensemble of output distributions for the data with the same label but from different domains, and then penalizes each output distribution for the mismatch with the ensemble in the form of self-knowledge distillation. With this approach, our model can learn domain-invariant features and also easily converges to flat minima. Besides, the proposed UniStyle suppresses domain-specific style bias to boost the effect of XDED and encourage style-consistent predictions. Furthermore, we empirically validate the generalization ability of the proposed method from the perspective of flat minima and reduced divergence between source and target. Through extensive experimental results, we demonstrate the superiority of the proposed framework.
+
+Acknowledgement. This work was supported by the NRF grant and the IITP grant funded by Ministry of Science and ICT, Korea (NRF-2021R1A2C3012728, IITP-2019-0-01906, IITP-2022-0-00926, IITP-2022-0-00290).
+
+# References
+
+1. Arjovsky, M., Bottou, L., Gulrajani, I., Lopez-Paz, D.: Invariant risk minimization. arXiv preprint arXiv:1907.02893 (2019) 11
+2. Balaji, Y., Sankaranarayanan, S., Chellappa, R.: Metareg: Towards domain generalization using meta-regularization. In: Proc. Neural Information Processing Systems (NeurIPS) (2018) 3
+3. Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A., Pereira, F., Vaughan, J.W.: A theory of learning from different domains. Machine learning (2010) 7, 9
+4. Ben-David, S., Blitzer, J., Crammer, K., Pereira, F., et al.: Analysis of representations for domain adaptation. In: Proc. Neural Information Processing Systems (NeurIPS) (2007) 7
+5. Blanchard, G., Deshmukh, A.A., Dogan, U., Lee, G., Scott, C.: Domain generalization by marginal transfer learning. Journal of Machine Learning Research (JMLR) (2021) 11
+6. Brendel, W., Bethge, M.: Approximating cnns with bag-of-local-features models works surprisingly well on imagenet. In: Proc. International Conference on Learning Representations (ICLR) (2019) 4
+7. Carlucci, F.M., D'Innocente, A., Bucci, S., Caputo, B., Tommasi, T.: Domain generalization by solving jigsaw puzzles. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 10
+8. Cha, J., Chun, S., Lee, K., Cho, H.C., Park, S., Lee, Y., Park, S.: Swad: Domain generalization by seeking flat minima. In: Proc. Neural Information Processing Systems (NeurIPS) (2021) 3, 4, 7, 8
+9. Cha, S., Hsu, H., Hwang, T., Calmon, F.P., Moon, T.: Cpr: Classifier-projection regularization for continual learning. In: Proc. International Conference on Learning Representations (ICLR) (2021) 2, 4, 7, 8, 13
+10. Chaudhari, P., Choromanska, A., Soatto, S., LeCun, Y., Baldassi, C., Borgs, C., Chayes, J., Sagun, L., Zecchina, R.: Entropy-sgd: Biasing gradient descent into wide valleys. In: Proc. International Conference on Learning Representations (ICLR) (2017) 2, 4
+11. Chen, L.C., Zhu, Y., Papandreou, G., Schroff, F., Adam, H.: Encoder-decoder with atrous separable convolution for semantic image segmentation. In: Proc. European Conference on Computer Vision (ECCV) (2018) 12
+12. Choi, S., Jung, S., Yun, H., Kim, J.T., Kim, S., Choo, J.: Robustnet: Improving domain generalization in urban-scene segmentation via instance selective whitening. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2021) 4, 12
+13. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016) 12
+14. Cubuk, E.D., Zoph, B., Mane, D., Vasudevan, V., Le, Q.V.: Autoaugment: Learning augmentation policies from data (2019) 14
+15. DeVries, T., Taylor, G.W.: Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552 (2017) 14
+16. Dou, Q., Coelho de Castro, D., Kamnitsas, K., Glocker, B.: Domain generalization via model-agnostic learning of semantic features. In: Proc. Neural Information Processing Systems (NeurIPS) (2019) 3, 10
+
+17. Dumoulin, V., Shlens, J., Kudlur, M.: A learned representation for artistic style. In: Proc. International Conference on Learning Representations (ICLR) (2017) 6
+18. Dziugaite, G.K., Roy, D.M.: Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In: Proc. The Conference on Uncertainty in Artificial Intelligence (UAI) (2017) 2, 4
+19. Feng, H.Z., You, Z., Chen, M., Zhang, T., Zhu, M., Wu, F., Wu, C., Chen, W.: Kd3a: Unsupervised multi-source decentralized domain adaptation via knowledge distillation. In: Proc. International Conference on Machine Learning (ICML) (2021) 4
+20. Foret, P., Kleiner, A., Mobahi, H., Neyshabur, B.: Sharpness-aware minimization for efficiently improving generalization. In: Proc. International Conference on Learning Representations (ICLR) (2021) 2, 4
+21. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. Journal of Machine Learning Research (JMLR) (2016) 11
+22. Geirhos, R., Rubisch, P., Michaelis, C., Bethge, M., Wichmann, F.A., Brendel, W.: Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In: Proc. International Conference on Learning Representations (ICLR) (2019) 4
+23. Ghiasi, G., Lin, T.Y., Le, Q.V.: Dropout: A regularization method for convolutional networks. In: Proc. Neural Information Processing Systems (NeurIPS) (2018) 11
+24. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: Proc. Neural Information Processing Systems (NeurIPS) (2014) 1
+25. Goodfellow, I.J., Shlens, J., Szegedy, C.: Explaining and harnessing adversarial examples. In: Proc. International Conference on Learning Representations (ICLR) (2014) 14
+26. Gulrajani, I., Lopez-Paz, D.: In search of lost domain generalization. In: Proc. International Conference on Learning Representations (ICLR) (2021) 3, 10
+27. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (June 2016) 9, 11
+28. Hendrycks, D., Dietterich, T.: Benchmarking neural network robustness to common corruptions and perturbations. In: Proc. International Conference on Learning Representations (ICLR) (2019) 14
+29. Hendrycks, D., Mu, N., Cubuk, E.D., Zoph, B., Gilmer, J., Lakshminarayanan, B.: Augmix: A simple data processing method to improve robustness and uncertainty (2020) 14
+30. Hendrycks, D., Mu, N., Cubuk, E.D., Zoph, B., Gilmer, J., Lakshminarayanan, B.: Augmix: A simple data processing method to improve robustness and uncertainty. In: Proc. International Conference on Learning Representations (ICLR) (2020) 14
+31. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015) 3, 4
+32. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2017) 6
+33. Huang, Z., Wang, H., Xing, E.P., Huang, D.: Self-challenging improves cross-domain generalization. In: Proc. European Conference on Computer Vision (ECCV) (2020) 10, 11
+
+34. Ioffe, S., Szegedy, C.: Batch normalization: Accelerating deep network training by reducing internal covariate shift. In: Proc. International Conference on Machine Learning (ICML) (2015) 3
+35. Izmailov, P., Podoprikhin, D., Garipov, T., Vetrov, D., Wilson, A.G.: Averaging weights leads to wider optima and better generalization. In: Proc. The Conference on Uncertainty in Artificial Intelligence (UAI) (2018) 4
+36. Jiang, Y., Neyshabur, B., Mobahi, H., Krishnan, D., Bengio, S.: Fantastic generalization measures and where to find them. In: Proc. International Conference on Learning Representations (ICLR) (2020) 2
+37. Kang, J., Lee, S., Kim, N., Kwak, S.: Style neophile: Constantly seeking novel styles for domain generalization. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2022) 3, 4, 10, 11
+38. Keskar, N.S., Mudigere, D., Nocedal, J., Smelyanskiy, M., Tang, P.T.P.: On large-batch training for deep learning: Generalization gap and sharp minima. In: Proc. International Conference on Learning Representations (ICLR) (2017) 2, 4
+39. Kifer, D., Ben-David, S., Gehrke, J.: Detecting change in data streams. In: In Very Large Databases (VLDB) (2004) 9
+40. Kim, D., Park, S., Kim, J., Lee, J.: Selfreg: Self-supervised contrastive regularization for domain generalization. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2021) 1, 10
+41. Kim, N., Son, T., Lan, C., Zeng, W., Kwak, S.: Wedge: Web-image assisted domain generalization for semantic segmentation. arXiv preprint arXiv:2109.14196 (2021) 3
+42. Kim, S., Kim, D., Cho, M., Kwak, S.: Embedding transfer with label relaxation for improved metric learning. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2021) 4
+43. Krizhevsky, A., Sutskever, I., Hinton, G.E.: ImageNet classification with deep convolutional neural networks. In: Proc. Neural Information Processing Systems (NeurIPS) (2012) 1
+44. Krueger, D., Caballero, E., Jacobsen, J.H., Zhang, A., Binas, J., Zhang, D., Le Priol, R., Courville, A.: Out-of-distribution generalization via risk extrapolation (rex). In: Proc. International Conference on Machine Learning (ICML) (2021) 11
+45. Li, D., Yang, Y., Song, Y.Z., Hospedales, T.M.: Deeper, broader and artier domain generalization. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2017) 9
+46. Li, D., Yang, Y., Song, Y.Z., Hospedales, T.M.: Learning to generalize: Meta-learning for domain generalization. In: Proc. AAAI Conference on Artificial Intelligence (AAAI) (2018) 11
+47. Li, D., Zhang, J., Yang, Y., Liu, C., Song, Y.Z., Hospedales, T.M.: Episodic training for domain generalization. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2019) 3, 10
+48. Li, H., Pan, S.J., Wang, S., Kot, A.C.: Domain generalization with adversarial feature learning. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 1, 3, 10, 11
+49. Li, Y., Tian, X., Gong, M., Liu, Y., Liu, T., Zhang, K., Tao, D.: Deep domain generalization via conditional invariant adversarial networks. In: Proc. European Conference on Computer Vision (ECCV) (2018) 1, 3, 11
+50. Long, M., Cao, Y., Wang, J., Jordan, M.: Learning transferable features with deep adaptation networks. In: Proc. International Conference on Machine Learning (ICML) (2015) 9
+
+51. Madry, A., Makelov, A., Schmidt, L., Tsipras, D., Vladu, A.: Towards deep learning models resistant to adversarial attacks. In: Proc. International Conference on Learning Representations (ICLR) (2018) 14
+52. Meng, Z., Li, J., Gong, Y., Juang, B.H.: Adversarial teacher-student learning for unsupervised domain adaptation. In: 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (2018) 4
+53. Miyato, T., Maeda, S.i., Koyama, M., Ishii, S.: Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) (2018) 5
+54. Mnih, V., Kavukcuoglu, K., Silver, D., Graves, A., Antonoglou, I., Wierstra, D., Riedmiller, M.: Playing atari with deep reinforcement learning. In: NeurIPS Deep Learning Workshop (2013) 1
+55. Muandet, K., Balduzzi, D., Scholkopf, B.: Domain generalization via invariant feature representation. In: Proc. International Conference on Machine Learning (ICML) (2013) 1, 3
+56. Nam, H., Lee, H., Park, J., Yoon, W., Yoo, D.: Reducing domain gap by reducing style bias. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2021) 4, 9, 10, 11
+57. Neuhold, G., Ollmann, T., Rota Bulo, S., Kontschieder, P.: The mapillary vistas dataset for semantic understanding of street scenes. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2017) 12
+58. Pan, X., Zhan, X., Shi, J., Tang, X., Luo, P.: Switchable whitening for deep representation learning. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2019) 12
+59. Park, W., Kim, D., Lu, Y., Cho, M.: Relational knowledge distillation. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 4
+60. Pereyra, G., Tucker, G., Chorowski, J., Kaiser, L., Hinton, G.: Regularizing neural networks by penalizing confident output distributions. In: ICLR Workshop (2017) 2, 4
+61. Richter, S.R., Vineet, V., Roth, S., Koltun, V.: Playing for data: Ground truth from computer games. In: Proc. European Conference on Computer Vision (ECCV) (2016) 12
+62. Ristani, E., Solera, F., Zou, R., Cucchiara, R., Tomasi, C.: Performance measures and a data set for multi-target, multi-camera tracking. In: Proc. European Conference on Computer Vision (ECCV) (2016) 11
+63. Ros, G., Sellart, L., Materzynska, J., Vazquez, D., Lopez, A.M.: The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016) 12
+64. Sagawa, S., Koh, P.W., Hashimoto, T.B., Liang, P.: Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In: Proc. International Conference on Learning Representations (ICLR) (2020) 11
+65. Seo, S., Suh, Y., Kim, D., Kim, G., Han, J., Han, B.: Learning to optimize domain specific normalization for domain generalization. In: Proc. European Conference on Computer Vision (ECCV) (2020) 3, 10
+66. Shankar, S., Piratla, V., Chakrabarti, S., Chaudhuri, S., Jyothi, P., Sarawagi, S.: Generalizing across domains via cross-gradient training. In: Proc. International Conference on Learning Representations (ICLR) (2018) 3, 10
+
+67. Stutz, D., Hein, M., Schiele, B.: Relating adversarially robust generalization to flat minima. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2021) 13
+68. Sun, B., Saenko, K.: Deep coral: Correlation alignment for deep domain adaptation. In: Proc. European Conference on Computer Vision (ECCV) (2016) 11
+69. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z.: Rethinking the inception architecture for computer vision. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016) 13
+70. Ulyanov, D., Vedaldi, A., Lempitsky, V.: Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022 (2016) 6
+71. Vapnik, V.: Statistical learning theory. NY: Wiley (1998) 11
+72. Venkateswara, H., Eusebio, J., Chakraborty, S., Panchanathan, S.: Deep hashing network for unsupervised domain adaptation. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 9
+73. Verma, V., Lamb, A., Beckham, C., Najafi, A., Mitliagkas, I., Lopez-Paz, D., Bengio, Y.: Manifold mixup: Better representations by interpolating hidden states. In: Proc. International Conference on Machine Learning (ICML) (2019) 13
+74. Wang, S., Yu, L., Li, C., Fu, C.W., Heng, P.A.: Learning from extrinsic and intrinsic supervisions for domain generalization. In: Proc. European Conference on Computer Vision (ECCV) (2020) 10
+75. Wang, Z., Luo, Y., Qiu, R., Huang, Z., Baktashmotlagh, M.: Learning to diversify for single domain generalization. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2021) 10
+76. Wu, D., Xia, S.T., Wang, Y.: Adversarial weight perturbation helps robust generalization. In: Proc. Neural Information Processing Systems (NeurIPS) (2020) 13
+77. Xu, Q., Zhang, R., Zhang, Y., Wang, Y., Tian, Q.: A fourier-based framework for domain generalization. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2021) 3, 10
+78. Xu, T.B., Liu, C.L.: Data-distortion guided self-distillation for deep neural networks. In: Proc. AAAI Conference on Artificial Intelligence (AAAI) (2019) 4
+79. Xu, Z., Li, W., Niu, L., Xu, D.: Exploiting low-rank structure from latent domains for domain generalization. In: Proc. European Conference on Computer Vision (ECCV) (2014) 3
+80. Yao, Z., Gholami, A., Keutzer, K., Mahoney, M.W.: Pyhessian: Neural networks through the lens of the hessian. In: 2020 IEEE International Conference on Big Data (Big Data) (2020) 13
+81. Yu, F., Xian, W., Chen, Y., Liu, F., Liao, M., Madhavan, V., Darrell, T.: Bdd100k: A diverse driving video database with scalable annotation tooling. arXiv preprint arXiv:1805.04687 (2018) 12
+82. Yue, X., Zhang, Y., Zhao, S., Sangiovanni-Vincentelli, A., Keutzer, K., Gong, B.: Domain randomization and pyramid consistency: Simulation-to-real generalization without accessing target domain data. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2019) 12
+83. Yun, S., Han, D., Oh, S.J., Chun, S., Choe, J., Yoo, Y.: Cutmix: Regularization strategy to train strong classifiers with localizable features. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2019) 14
+84. Yun, S., Park, J., Lee, K., Shin, J.: Regularizing class-wise predictions via self-knowledge distillation. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2020) 4, 5
+85. Zagoruyko, S., Komodakis, N.: Wide residual networks. In: Proc. British Machine Vision Conference (BMVC) (2016) 14
+
+86. Zhang, H., Cisse, M., Dauphin, Y.N., Lopez-Paz, D.: mixup: Beyond empirical risk minimization. In: Proc. International Conference on Learning Representations (ICLR) (2018) 11, 13, 14
+87. Zhang, L., Song, J., Gao, A., Chen, J., Bao, C., Ma, K.: Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2019) 2, 4, 7, 8
+88. Zhang, M.M., Marklund, H., Dhawan, N., Gupta, A., Levine, S., Finn, C.: Adaptive risk minimization: A meta-learning approach for tackling group shift. In: Proc. Neural Information Processing Systems (NeurIPS) (2021) 11
+89. Zhang, Y., Xiang, T., Hospedales, T.M., Lu, H.: Deep mutual learning. In: Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 2, 4, 7, 8
+90. Zheng, L., Shen, L., Tian, L., Wang, S., Wang, J., Tian, Q.: Scalable person re-identification: A benchmark. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2015) 3, 11
+91. Zheng, Z., Zheng, L., Yang, Y.: Unlabeled samples generated by gan improve the person re-identification baseline in vitro. In: Proc. IEEE International Conference on Computer Vision (ICCV) (2017) 3, 11
+92. Zhong, Z., Zheng, L., Kang, G., Li, S., Yang, Y.: Random erasing data augmentation. In: Proc. AAAI Conference on Artificial Intelligence (AAAI) (2020) 11
+93. Zhou, K., Yang, Y., Hospedales, T., Xiang, T.: Learning to generate novel domains for domain generalization. In: Proc. European Conference on Computer Vision (ECCV) (2020) 3, 10
+94. Zhou, K., Yang, Y., Qiao, Y., Xiang, T.: Domain adaptive ensemble learning. IEEE Transactions on Image Processing (TIP) (2021) 3
+95. Zhou, K., Yang, Y., Qiao, Y., Xiang, T.: Domain generalization with mixstyle. In: Proc. International Conference on Learning Representations (ICLR) (2021) 4, 7, 10, 11, 13
\ No newline at end of file
diff --git a/crossdomainensembledistillationfordomaingeneralization/images.zip b/crossdomainensembledistillationfordomaingeneralization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f3f945f5293f2dcccf7a21dd5fb2b3865edc1f1a
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a84b0eaabb31a35e4fa28792ef657487f01c0d49a77668c8bd1585c0abd2b1bb
+size 593465
diff --git a/crossdomainensembledistillationfordomaingeneralization/layout.json b/crossdomainensembledistillationfordomaingeneralization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..df9044222ead979f2b62731927bd2383a9b7fcf9
--- /dev/null
+++ b/crossdomainensembledistillationfordomaingeneralization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de6b12748bab572d9f44855ab696d45a06d41ba07040d69a4a3b60625d599423
+size 469448
diff --git a/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_content_list.json b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..92a7d5bab892f35a935e9ffd80b54f762bc2885b
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:867e98cc51481dca515967c11ddacce34793a7cce6d4b32b984142fd97e344af
+size 81517
diff --git a/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_model.json b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2a74f22749c497a2591e759d013dc02558951358
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2c5deaa006b28b2fd606958d44f2795dbb45c75d2741aca354afda8623eac57a
+size 101305
diff --git a/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_origin.pdf b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6e10ad09f08087df077f8e99132071b17d0aa1b1
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/0bcfacad-3649-4375-b9c7-f6aa7d1fb37a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:522f0161e28335429b4b1c9809455810ea59a3379e32462917b98a49434dbfc4
+size 9298440
diff --git a/crossdomainfewshotsemanticsegmentation/full.md b/crossdomainfewshotsemanticsegmentation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1907a06286cdef66b87a25da3a8a1cfcc70fd360
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/full.md
@@ -0,0 +1,259 @@
+# Cross-Domain Few-Shot Semantic Segmentation
+
+Shuo Lei $^{1}$ , Xuchao Zhang $^{2}$ , Jianfeng He $^{1}$ , Fanglan Chen $^{1}$ , Bowen Du $^{3}$ $\star$ , and Chang-Tien Lu $^{1}$
+
+$^{1}$ Department of Computer Science, Virginia Tech, Falls Church, VA, USA
+
+$^{2}$ NEC Laboratories America, Princeton, NJ, USA
+
+3 State Key Laboratory of Software Development Environment, Beihang University,
+
+Beijing, China
+
+Abstract. Few-shot semantic segmentation aims at learning to segment a novel object class with only a few annotated examples. Most existing methods consider a setting where base classes are sampled from the same domain as the novel classes. However, in many applications, collecting sufficient training data for meta-learning is infeasible or impossible. In this paper, we extend few-shot semantic segmentation to a new task, called Cross-Domain Few-Shot Semantic Segmentation (CD-FSS), which aims to generalize the meta-knowledge from domains with sufficient training labels to low-resource domains. Moreover, a new benchmark for the CD-FSS task is established and characterized by a task difficulty measurement. We evaluate both representative few-shot segmentation methods and transfer learning based methods on the proposed benchmark and find that current few-shot segmentation methods fail to address CD-FSS. To tackle the challenging CD-FSS problem, we propose a novel Pyramid-Anchors-Transformation based few-shot segmentation network (PATNet), in which domain-specific features are transformed into domain-agnostic ones for downstream segmentation modules to fast adapt to unseen domains. Our model outperforms the state-of-the-art few-shot segmentation method in CD-FSS by $8.49\%$ and $10.61\%$ average accuracies in 1-shot and 5-shot, respectively. Code and datasets are available at https://github.com/slei109/PATNet
+
+Keywords: Few-Shot Learning, Cross-Domain Transfer Learning, Semantic Segmentation
+
+# 1 Introduction
+
+Deep neural networks for semantic segmentation, such as FCN [26], DeepLab [5] and PSPNet [52], typically require large-scale annotations for training, which is costly to obtain. To reduce such burden on data annotation, Few-Shot Semantic Segmentation (FSS) task has been proposed [33], which aims to learn a model that can perform segmentation on novel classes with only a few pixel-level annotated images. Although significant progress has been made in the FSS task [34,45,46,49,50], it is hard to apply existing methods to cross-domain scenarios.
+
+
+Fig. 1. Differences between the cross-domain few-shot segmentation and existing tasks. $X_{s}$ and $X_{t}$ denote the data distribution in the source and target domain, respectively. $Y_{s}$ represents the source label space and $Y_{t}$ represents the target label space.
+
+Since the methods still require a large number of base class samples for training, it is infeasible for low-resource domains where few training annotations can be obtained. For instance, it is too expensive to collect sufficient satellite images for meta-training purposes, remaining a large obstacle to applying the few-shot segmentation methods directly into the satellite image domain. To tackle the issue, we extend FSS to a new Cross-Domain Few-Shot Segmentation (CD-FSS) task that aims at generalizing the meta-knowledge from domains with sufficient training labels (e.g. PASCAL VOC [13]) to low-resource domains.
+
+The conceptual comparisons between the existing tasks and our CD-FSS task are shown in Fig. 1. First, most works on cross-domain semantic segmentation (or domain adaptation for semantic segmentation) focus on the problem setting where the target domain data can be accessed during training and share the same label space as the source domain. For example, in the first row of Fig. 1, street photo-realistic synthetic images are usually used as training data for real-world urban scene understanding tasks. In contrast, we study the CD-FSS problem, where the source and target domains have completely disjoint label space and cannot access target domain data during the training stage. Second, the classic few-shot semantic segmentation only focuses on segmenting novel classes sampled from the same domain in the training stage. In other words, the input data distributions from source and target domains are the same while the label spaces are disjoint in the training and testing stages. In contrast, both data distributions and label spaces in the testing stage are different from the training stage in the CD-FSS task.
+
+In this paper, we establish a new benchmark for the CD-FSS task to evaluate the cross-domain generalization ability of segmentation models under different domain gaps. It consists of four different domains characterized by domain shifts of different size: FSS-1000 [23], Deep globe [11], ISIC2018 [10,42], and Chest X-ray datasets [4,21]. These datasets cover daily objects images, satellite images, dermoscopic images of skin lesions, and X-ray images, respectively. The selected datasets have class diversity and reflect the real-world scenario for few-shot semantic segmentation.
+
+Furthermore, both representative few-shot segmentation methods and transfer learning based methods are evaluated on the proposed benchmark. Experiment results show that: 1) the performances of existing few-shot semantic segmentation methods degrade significantly under large domain shifts. Those methods even underperform the simple transfer learning baselines when the target domain is drastically different from the source domain; 2) meta-learning approaches are more effective than all transfer learning baselines in the setting of limited domain differences.
+
+A major challenge in CD-FSS is that the feature space learned from the source domain cannot be applied to the target domain. Concretely, existing methods learn a support-query matching/comparing model in a single domain and their basic assumption is that the pretrained encoder is powerful enough to embed the image into distinguishable features. However, the backbone only pretrained in the source domain fails in the target domain due to the different data distribution. To address this problem, we propose a novel Pyramid Anchors-based Transformation Module (PATM) to transform the domain-specific features into domain-agnostic ones. Thus, the downstream model can be well adapted to the novel domains by matching domain-agnostic features of support and query sets to make the segmentation. To further refine the predicted mask of the query image, we also propose a Task-adaptive Fine-tuning Inference (TFI) strategy for fast adaptation to unseen domain. In the testing phase, only PATM is updated with the prototype similarity between support images and query predictions to avoid over-fitting in few-shot scenarios. In this way, the predicted mask is refined with the calibrated features produced by the fine-tuned PATM.
+
+Our main contributions are summarized as follows:
+
+- We extend few-shot semantic segmentation to a new task, called Cross-Domain Few-Shot Semantic Segmentation (CD-FSS), which aims to segment a novel object class in unseen domains with only a few annotated examples.
+- A practical evaluation benchmark for CD-FSS is established, consisting of four different domains. We also measure the task difficulty for each domain according to 1) domain shift and 2) discrimination between foreground and background classes.
+- We propose a Pyramid Anchor-based Transformation Module (PATM) to transform the domain-specific features into domain-agnostic ones. Downstream segmentation modules can be adapted to unseen domains by learning with domain-agnostic features. A novel Task-adaptive Fine-tuning Inference (TFI) strategy is proposed to refine the prediction in unseen domains.
+- We investigate a practical evaluation of few-shot segmentation methods and transfer learning based methods in the proposed benchmark. Results show that current few-shot segmentation methods fail to address CD-FSS and are even inferior to the transfer learning baseline methods when a large domain gap exists. In contrast, Our model outperforms the state-of-the-art few-shot segmentation method in CD-FSS by $8.49\%$ and $10.61\%$ average accuracies in 1-shot and 5-shot, respectively.
+
+# 2 Related Work
+
+The prior works related to this paper are summarized below in domain adaptation for semantic segmentation, cross-domain few-shot learning and few-shot semantic segmentation.
+
+Domain adaptation for semantic segmentation. Recent works in domain adaptation for semantic segmentation are mainly divided into two directions. One group of studies aims to learn domain-invariant representations of instances by domain adversarial training [8,9,12,41]. Hoffman et al. [20] combine global and local alignment methods with adversarial training. Similar ideas are also explored using different techniques, such as distillation loss [9], output space alignment [40], class-balanced self-training [54], conservative loss [53], etc. The other group is learning from a pre-defined curriculum [31,51].
+
+However, these methods operate in the setting where the target domain data can be accessed during training to drive the model adaptation and compensate for the domain shift. In addition, most existing works exploit photo-realistic synthetic data. Thus, the source and target domain share the same label space and still retain a high degree of visual similarity. In contrast, we study the cross-domain few-shot semantic segmentation problem, where the source and target domains have completely disjoint label space and cannot require target domain data during the training stage. The goal of this work is to learn a task-adaptive few-shot semantic segmentation model under large domain shifts.
+
+Few-shot learning. Few-shot learning aims to learn a new concept representation from only a few annotated examples. Most existing works can be categorized into metric learning methods [44,37,35], gradient-based meta learners [29,14], and graph neural network [15,24] based methods. Yoon et al. [47] introduce a reference vector set to construct a linear transformer that performed task-specific null-space projection for classification, which is the theoretical basis of our method. In cross-domain few-shot learning [39,7,43], both data distribution and the label space in the meta-testing stage are different from the metatraining stage. Tseng et al. [43] propose feature-wise transformation layers to improve the generalization of metric-based few-shot classification approaches to unseen domains. Guo et al. [16] propose a harder cross-domain few-shot benchmark (BSCD-FSL), where there is a large shift between base and novel class domains. It covers several target domains with varying similarities to natural images. Our proposed benchmark can be seen as an extension of BSCD-FSL in the few-shot segmentation task to evaluate the cross-domain generalization ability of few-shot segmentation models under different domain shifts.
+
+Few-shot semantic segmentation. In contrast to the domain adaptation for semantic segmentation, few-shot semantic segmentation has no access to the target domain during training stage. It aims at segmenting novel semantic objects in an image with only a few densely annotated examples. Based on the optimized module in the meta-training process, existing works can be divided into two groups, metric-based and relation-based methods. Specifically, metric-based methods (e.g. PANet [45] and AMP [34]) adopt non-parametric decoder and aim to train the encoder to construct a consistent metric space. In contrast,
+
+relation-based methods (e.g. CaNet [49], RPMM [46], PGNet [48], PFENet [38] and HSNet [27]) freeze the pre-trained encoder during training process and train a decoder to compare the support and query samples. In other words, metric-based methods focus on separating foreground and background classes in each task, while relation-based methods focus on recognizing the foreground classes based on the pre-trained features. RePRI [3] foregoes meta-learning and adopts a transductive inference with a feature extraction trained on the base classes. However, these methods only focus on segmenting novel classes sampled from the same domain. They fail to generalize to unseen domains due to large discrepancy of the feature distribution across domains.
+
+# 3 Benchmark
+
+The proposed benchmark for CD-FSS consists of four datasets characterized by domain shifts of different sizes. The proposed benchmark includes images and pixel-level annotations from FSS-1000 [23], Deep globe [11], ISIC2018 [10,42], and Chest X-ray datasets [4,21]. These datasets cover daily objects images, satellite images, dermoscopic images of skin lesions, and X-ray images, respectively. The selected datasets have class diversity and reflect the real-world scenario for few-shot semantic segmentation tasks. To provide a better overview, in Table 1, the task difficulty for each domain is measured from two aspects: 1) domain shift (cross the datasets) and 2) class distinction in a single image (within the dataset). Fréchet Inception Distance (FID) [19] is adopted to measure the domain shift [1] of these four datasets with respect to the PASCAL [13]. Since the discrimination between classes in a single image has an important impact on the segmentation task, we measure the similarity between foreground and background classes using KL-divergence. For more details, please refer to the supplementary material.
+
+Table 1. Conceptual difference between PASCAL and the four cross-domain datasets. The domain shift and class distinction in a single image is measured by FID and DisFB, respectively.
+
+| Dataset | perspective distortion | natural content | color depth | FID | DisFB |
| Deep globe | × | × | 3 | 213.58 | 0.143 |
| ISIC | × | × | 3 | 275.28 | 0.187 |
| Chest X-ray | × | × | 1 | 316.56 | 0.126 |
| FSS-1000 | ✓ | ✓ | 3 | 238.41 | 0.112 |
+
+
+Deepglobe
+
+
+
+
+Chest X-ray
+
+
+ISIC
+FSS-1000
+Fig.2. Example of segmentation in the benchmark.
+
+FSS-1000 [23] is a natural image dataset for few-shot segmentation, consisting of 1,000 object classes and each class has 10 samples. The official split for semantic segmentation is used in our experiment. We report the results on the official testing set, which contains 240 classes and 2,400 testing images.
+
+Deepglobe [11] is a satellite image dataset. Each image is densely annotated at pixel-level with 7 categories: areas of urban, agriculture, rangeland, forest, water, barren, and unknown. As the ground-truth label is only available in the
+
+training set, thus we adopt the official training set to report the results, which contains 803 images. The images have a fixed spatial resolution of $2448 \times 2448$ pixels. To increase the number of testing images and reduce the size of images, we cut each image into 6 pieces. As the categories labeled in this dataset have no regular shape, the cutting operation has little effect on the segmentation. After filtering the single class images and the 'unknown' class, we get 5,666 images to report the results and each image has $408 \times 408$ pixels.
+
+ISIC2018 [10,42] is a dataset on lesion images, consisting of skin cancer screening samples. Every lesion image contains exactly one primary lesion. As the ground-truth label is only available in the training set, thus we report the results on the official training set, containing 2,596 images. The images have a spatial resolution around $1022 \times 767$ . As a common practice we down-size the images to $512 \times 512$ pixels.
+
+Chest X-ray [4,21] is an X-ray image dataset for Tuberculosis. It includes 566 images with a resolution of $4020 \times 4892$ , which are collected from 58 cases with a manifestation of Tuberculosis and 80 normal cases. Due to the large size of image, we down-size the images to $1024 \times 1024$ pixels as a common practice.
+
+# 4 Problem Setting
+
+The cross-domain few-shot semantic segmentation (CD-FSS) problem can be formalized as follows. We have a source domain $(\mathcal{X}_s,\mathcal{Y}_s)$ and a target domain $(\mathcal{X}_t,\mathcal{Y}_t)$ , where $\mathcal{X}_s$ is the input data distribution and $\mathcal{Y}_s$ is the label space. In CD-FSS, the input data distribution in source domains $\mathcal{X}_s$ is different from target domains and the label space in source domains has no overlap with target domains $\mathcal{X}_t$ , i.e., $\mathcal{X}_s \neq \mathcal{X}_t$ , $\mathcal{Y}_s \cap \mathcal{Y}_t = \emptyset$ .
+
+Suppose that the model is trained on the source domain, CD-FSS aims to use the trained model to perform segmentation on the novel classes in the target domain with only a few annotated images per class. The training set $\mathcal{D}_{train}$ is constructed from $(\mathcal{X}_s,\mathcal{Y}_s)$ and the testing set $\mathcal{D}_{test}$ is constructed from $(\mathcal{X}_t,\mathcal{Y}_t)$ . We align training and testing with the episodic paradigm [44] to handle the few-shot scenario. Specifically, given a $N$ -way $K$ -shot learning task, both the training set $\mathcal{D}_{train}$ and testing set $\mathcal{D}_{test}$ consist of several episodes. Each episode is constructed by 1) a support set $\mathcal{S} = \{(\mathbf{I}_i^s,\mathbf{M}_i^s)\}_{i=1}^{N\times K}$ and 2) a query set $\mathcal{Q} = \{(\mathbf{I}_i^q,\mathbf{M}_i^q)\}_{i=1}^Q$ , where $\mathbf{I}$ is an image, $\mathbf{M}$ is a corresponding mask and $Q$ is the number of query samples. Note that the model is trained on $\mathcal{D}_{train}$ from the source domain and has no access to the target domain data. During the testing (or meta-testing) process, the model is presented with a support set and a query set from the target domain is used to evaluate the model performance.
+
+# 5 Model
+
+The main challenge in CD-FSS is to reduce the performance degradation brought by domain shifts. Previous works focus on learning a support-query matching
+
+
+Fig. 3. Overview of our method in a 1-way 1-shot example. After obtaining the pyramid features of support and query images, PATM is introduced to transform the domain-specific hypercorrelations into domain-agnostic ones by producing linear transformation matrices. Then, the transformed features are fed into Domain-agnostic Correlation Learning part for the final query segmentation mask prediction. In the testing phase, the anchor layers are fine-tuned with the foreground prototype similarity between support and query predictions. Yellow parts are trainable and blue parts are frozen.
+
+model and their basic assumption is that the pretrained encoder is powerful enough to embed the image into distinguishable features for the downstream matching model. However, the backbone only pretrained in the source domain fails in the target domain, especially under the large domain gap, like daily life object images to X-ray images. To address the problem, our model learns to transform the domain-specific features into domain-agnostic ones. In this way, the downstream model can be well adapted to the novel domain by matching domain-agnostic features of support and query sets to make the segmentation.
+
+As shown in Fig. 3, our method consists of three major parts, feature extraction backbone, domain-adaptive hypercorrelation construction and domain-agnostic correlation learning. Given support and query images, we first extract all the intermediate features with feature extractor. Then, we introduce a particularly novel module in the Domain-adaptive Hypercorrelation Construction part, dubbed Pyramid Anchor-based Transformation Module (PATM), to transform the domain-specific features into domain-agnostic ones. Next, we compute multilevel correlation maps with all transformed feature maps to feed into Domain-agnostic Correlation Learning part. Two off-the-shelf modules, 4D convolutional pyramid encoder and 2D convolutional context decoder [27], are adopted to produce the prediction mask in a coarse-to-fine manner with efficient 4D convolutions. In the testing phase, we also propose a Task-adaptive Fine-tuning Inference (TFI) strategy to encourage the model to fast adapt to the target domain
+
+by fine-tuning PATM with $\mathcal{L}_{kl}$ loss, which measures the foreground prototype similarity between support and query predictions.
+
+# 5.1 Pyramid Anchor-based Transformation Module
+
+The core idea of Pyramid Anchor-based Transformation Module (PATM) aims at learning pyramid anchor layers to transform the domain-specific features into domain-agnostic ones. Intuitively, if we can find a transformer to transform the domain-specific features into a domain-agnostic metric space, it will reduce the detrimental effects brought by the domain drift. Since the domain-agnostic metric space is constant, it will be much easier for the downstream segmentation modules to make predictions in such a stable space.
+
+Ideally, features belonging to the same class will produce similar results when they are transformed in the same way. Thus, if we transform the support features to the corresponding anchor points in the domain-agnostic space, then by using the same transformation, we can also make query features belonging to the same class transform close to the anchor points in the domain-agnostic space. Inspired by TAFT module [32], we adopt a linear transformation matrix as the transformation mapper since it introduces fewer learnable parameters. As shown in Fig. 3, we use the anchor layer and the prototype set of the support image to compute the transformation matrix. Let $\mathbf{A}$ represent the weight matrix of the anchor layer and $\mathbf{P}$ denote the prototype matrix of the support image. We construct the transformation matrix $\mathbf{W}$ by finding a matrix such that $\mathbf{W}\mathbf{P} = \mathbf{A}$ .
+
+Specifically, for an 1-way 1-shot task, once the intermediate feature maps in $L$ layers of the support image, $\{\mathbf{F}_l^s\}_{l = 1}^L$ , are obtained, we can calculate the foreground prototype of each feature map $\mathbf{F}_l^s\in \mathbb{R}^{C_l\times H_l\times W_l}$ with the support mask $\mathbf{M}^s\in \{0,1\}^{H\times W}$ via masked average pooling, i.e. $\mathbf{p}_{f,l}^s = \frac{\sum_i\mathbf{F}_{l,i}^s\zeta_l(\mathbf{M}^s)_i}{\sum_i\zeta_l(\mathbf{M}^s)_i}$ , where $\mathbf{p}_{f,l}^s\in \mathbb{R}^{C_l}$ and $i$ is 2D spatial positions of the feature map. $\zeta_l(\cdot)$ denotes a function that bilinearly interpolates input tensor to the spatial size of the feature map $\mathbf{F}_l^s$ at intermediate layer $l$ by expanding along channel dimension, $\zeta_l:\mathbb{R}^{H\times W}\to \mathbb{R}^{C_l\times H_l\times W_l}$ . Similarly, the background prototype $\mathbf{p}_{b,l}^s$ for $\mathbf{F}_l^s$ can be obtained in the same way and the prototype matrix $\mathbf{P}_l^s$ is defined as $[\frac{\mathbf{p}_{f,l}^s}{\|\mathbf{p}_{f,l}^s\|},\frac{\mathbf{p}_{b,l}^s}{\|\mathbf{p}_{b,l}^s\|}]$ . Accordingly, the anchor weight matrix $\mathbf{A}_l$ is defined as $[\frac{\mathbf{a}_{f,l}}{\|\mathbf{a}_{f,l}\|},\frac{\mathbf{a}_{b,l}}{\|\mathbf{a}_{b,l}\|}]$ , where $\mathbf{a}_{..,l}\in \mathbb{R}^{C_l}$ . In general, $\mathbf{P}_l^s$ is a non-square matrix and we can calculate its generalized inverse [2] with $\mathbf{P}_l^{s + } = \{\mathbf{P}_l^{sT}\mathbf{P}_l^s\}^{-1}\mathbf{P}_l^{sT}$ . Thus, the transformation matrix at intermediate layer $l$ is computed as $\mathbf{W}_l = \mathbf{A}_l\mathbf{P}_l^{s + }$ , where $\mathbf{W}_l\in \mathbb{R}^{C_l\times C_l}$ .
+
+For the subsequent hypercorrelation construction, a pair of transformed query and masked support features $\hat{\mathbf{F}}_l^s$ at each layer forms a 4D correlation tensor $\mathbf{C}_l\in \mathbb{R}^{H_l\times W_l\times H_l\times W_l}$ using cosine similarity:
+
+$$
+\mathbf {C} _ {l} (i, j) = \operatorname {R e L U} \left(\frac {\mathbf {W} _ {l} \mathbf {F} _ {l} ^ {q} (i) \cdot \mathbf {W} _ {l} \hat {\mathbf {F}} _ {l} ^ {s} (j)}{\| \mathbf {W} _ {l} \mathbf {F} _ {l} ^ {q} (i) \| \| \mathbf {W} _ {l} \hat {\mathbf {F}} _ {l} ^ {s} (j) \|}\right) \tag {1}
+$$
+
+where $i$ and $j$ denote 2D spatial positions of $\mathbf{F}_l^q$ and $\hat{\mathbf{F}}_l^s$ , respectively.
+
+
+Fig. 4. Visual comparison results of several 1-shot tasks. For each task, the first three columns show the ground truth of support and query sets. The next two columns represent the prediction mask without anchor layers and the prediction mask without fine-tuning, respectively. The last column shows the final predicted segmentation after fine-tuning with $\mathcal{L}_{kl}$ . Best viewed in colors.
+
+To avoid adding too many learnable parameters, we set three anchor layers for low-, medium- and high-level feature maps respectively. Note that only three anchor layers are introduced for different feature dimensions. Even though feature maps with the same dimension share one anchor layer, each of them still can obtain its unique transformation matrix with its own prototype set.
+
+# 5.2 Task-adaptive Fine-tuning Inference
+
+To further refine the prediction mask of query images, we propose a Task-adaptive Fine-tuning Inference (TFI) strategy for fast adaptation to unseen domains in the testing phase. The motivation is that if the model can predict a good segmentation mask for the query image, the foreground class prototype of the segmented query image should be similar to that of the support set. Different from optimizing all parameters in the model, we only fine-tune the anchor layers to avoid overfitting in few-shot scenarios. Fig. 3 shows the pipeline of the strategy. In the testing phase, during step 1, only anchor layers are updated accordingly using the proposed $\mathcal{L}_{kl}$ , which measures the similarity between the foreground class prototype of support and query sets. In step 2, all layers in the model are frozen and make the final prediction for query images. In this way, the model is encouraged to fast adapt to the target domain and the predicted mask is refined with calibrated features produced by fine-tuned anchor layers.
+
+Formally, given a sequence of $L$ intermediate feature maps of the query image $\{\mathbf{F}_l^q\}_{l=1}^L$ and its predicted probability map $\hat{\mathbf{M}}$ , we compute the foreground class prototype of the query image at layer $l$ with the probability map $\hat{\mathbf{M}}_l = \zeta_l(\hat{\mathbf{M}})$ by applying the soft masked average pooling method. Thus, the loss function $\mathcal{L}_{kl}$ for fine-tuning the model can be computed as follows:
+
+$$
+\mathcal {L} _ {k l} = \sum_ {l = 1} ^ {L} D _ {K L} (\mathbf {p} _ {f, l} ^ {s} | | \hat {\mathbf {p}} _ {f, l} ^ {q}), \mathrm {w h e r e} \hat {\mathbf {p}} _ {f, l} ^ {q} = \frac {\sum_ {i} \mathbf {F} _ {l , i} ^ {q} \hat {\mathbf {M}} _ {l , i} \mathbb {1} [ \hat {\mathbf {M}} _ {l , i} \geqslant \tau ]}{\sum_ {i} \hat {\mathbf {M}} _ {l , i}} \tag {2}
+$$
+
+Here, $D_{KL}(\cdot)$ denotes the Kullback-Leibler divergence loss function and $i$ denotes 2D spatial positions of the feature map. $\mathbb{1}(\cdot)$ is an indicator function to extract the binary predicted mask from $\hat{\mathbf{M}}_l$ , outputting value 1 if the argument is true or 0 otherwise. Pixels will be predicted as the foreground class if their values are larger than threshold $\tau$ . We set $\tau = 0.5$ in our experiments.
+
+# 6 Experiment
+
+# 6.1 Evaluation Setup
+
+Datasets. We use PASCAL VOC 2012 [13] with SBD [17] augmentation as training domain and then evaluate the trained models on the proposed benchmark introduced in Section 3.
+
+Baseline. To evaluate the performance of existing few-shot semantic segmentation models on CD-FSS, we adopt eight representative few-shot segmentation models: AMP [34], CaNet [49], PANet [45], RPMMs [46], PGNet [48], PFENet [38], RePRI [3] and HSNet [27]. We use the publicly available codes and follow the default training configuration of these models. For CaNet [49] method, we iteratively optimize the predicted results for 4 times after the initial prediction at inference time, which is same as their recommended settings. For a fair comparison, we also adopt ResNet-50 [18] as a feature extractor in PANet [45] to be our baseline model, denoted as PANet*. An alternative way to tackle CD-FSS is based on transfer learning, where an initial model is trained on the source dataset in a standard supervised learning way and reused on the novel datasets. We adapt the FCN [26] and DeeplabV3 [6] to serve as baselines by fine-tuning their last $k$ layers on the support set, denoted as "Ft-last- $k$ ". For example, "Ft-last-1FCN" represents the performance of fine-tuning the last-1 (fc-8) fully connected layers of FCN-32s pretrained on PASCAL VOC. In addition, the trained segmentation networks followed by the base classifier are also evaluated on the benchmark. The base classifier is trained to map dense features from the support set to their corresponding labels and uses it to generate the predicted mask in the query set. We experimented with various classifiers including 1-NN and logistic regression. For more details, please refer to the supplementary materials.
+
+Training and testing strategy. We meta-train all methods on all the classes of PASCAL VOC with SBD augmentation and meta-test the trained models on each dataset of the proposed benchmark. For each evaluation, we average the mean-IoU of 5 runs [44] with different random seeds. Each run contains 1200 tasks for all datasets except FSS-1000. FSS-1000 has 2400 tasks in each run, which is the same as the setting in [23,27].
+
+# 6.2 Evaluation Metric
+
+Mean intersection over-union (mIoU), which is defined as the mean IoUs of all image categories, was employed as the metric for performance evaluation.
+
+For each category, the IoU is calculated by $IoU = \frac{TP}{TP + FP + FN}$ , where TP, FP and FN respectively denote the number of true positive, false positive and false negative pixels of the predicted segmentation masks.
+
+# 6.3 Implementation Details
+
+We adopt VGG-16 [36] and ResNet-50 [18] as feature extractors, which are initialized with weights pre-trained on ILSVRC [30] and kept frozen during training, following previous works [25,45,49,27]. For the VGG backbone, we use feature maps from conv4_x to conv5_x, and after the last max-pooling layer. The channel dimensions of the three anchor layers are set to 512. For the ResNet backbone, we use feature maps from conv3_x, conv4_x and conv5_x. The channel dimensions of the three anchor layers are set to 512, 1024 and 2048, respectively. To reduce the memory consumption and speed up training process, we set spatial sizes of both support and query images to $400 \times 400$ . We implement the model in PyTorch [28] and utilize the Adam [22] optimizer with a learning rate of 1e-3. At inference, all images are resized to a fixed $400 \times 400$ resolution. An Adam optimizer is used to fine-tune PATM, with a learning rate of 1e-3 for Deep globe and ISIC, 5e-5 for Chest X-ray and FSS-1000. For each task, a total of 50 iterations are performed. More details can be found in the supplementary material.
+
+# 6.4 Baseline Performance Analysis
+
+Meta-learning based results. Table 2 shows the results using mIoU, in terms of different datasets, methods, and shot levels in the benchmark. The results reveal that the performance of existing few-shot semantic segmentation methods degrades significantly under domain shifts, especially under large domain gaps. The main reason is that the frozen pretrained encoder cannot generate distinguishable features for the downstream decoder when a large domain gap exists. Furthermore, when the target domain is similar to the source domain, like on FSS-1000, the relation-based methods generally perform better than the metric-based methods. But when the domain gap becomes larger (e.g. Deep globe and Chest X-ray), the metric-based methods are more effective than the relation-based methods. For instance, PANet surpasses HSNet by $5.87\%$ (1-shot) and $14.95\%$ (5-shot) on Chest X-ray, but underperforms HSNet by $8.38\%$ (1-shot) and $9.31\%$ (5-shot) on FSS-1000. This indicates that if the target domain is drastically different from the source domain, it may be more effective to make the encoder obtain the meta-transfer ability than the decoder. Finally, we observed that all the methods achieved the best performance on the FSS-1000 dataset among the four selected datasets because the data distribution of the FSS-1000 is most similar to the source dataset (PASCAL VOC) compared to the other datasets.
+
+Transfer learning based results. We observe that the base classifier methods significantly outperform simple fine-tuning methods on CD-FSS. The main reason is that limited samples in support set are insufficient for the deep segmentation networks to be adapted to a novel distribution. Furthermore, when
+
+Table 2. Mean-IoU of 1-way 1-shot and 5-shot results of meta-learning and transfer learning methods on the CD-FSS benchmark. Note that all methods are trained on PASCAL VOC and tested on CD-FSS. Bold denotes the best performance among all methods and underlined shows the best performance in each method group. * denotes the model implemented by ourselves.
+
+| Methods | Backbone | Deepglobe | ISIC | Chest X-ray | FSS-1000 | Average |
| 1-shot | 5-shot | 1-shot | 5-shot | 1-shot | 5-shot | 1-shot | 5-shot | 1-shot | 5-shot |
| Transfer Learning Methods |
| Ft-last-1FCN | Vgg-16 | 29.80 | 32.25 | 15.17 | 19.75 | 33.63 | 48.08 | 32.51 | 53.62 | 27.78 | 38.43 |
| Ft-last-2FCN | Vgg-16 | 32.90 | 35.34 | 17.52 | 21.65 | 36.35 | 53.85 | 32.15 | 57.44 | 29.82 | 42.07 |
| Ft-last-3FCN | Vgg-16 | 32.91 | 35.54 | 17.91 | 25.58 | 45.61 | 56.05 | 33.32 | 60.86 | 32.34 | 44.51 |
| 1NNFCN | Vgg-16 | 32.42 | 38.63 | 15.68 | 23.66 | 46.26 | 52.70 | 41.51 | 46.64 | 33.97 | 40.41 |
| LinearFCN | Vgg-16 | 33.56 | 38.75 | 15.51 | 30.65 | 37.69 | 50.07 | 41.09 | 49.16 | 31.96 | 42.16 |
| Ft-last-1Deeplab | Res-50 | 28.11 | 28.65 | 11.08 | 16.57 | 30.43 | 35.54 | 25.14 | 35.86 | 23.69 | 29.41 |
| Ft-last-2Deeplab | Res-50 | 24.09 | 36.74 | 10.22 | 17.56 | 31.16 | 51.57 | 20.68 | 42.50 | 21.29 | 37.10 |
| 1NNDeeplab | Res-50 | 32.28 | 35.96 | 21.44 | 26.04 | 47.76 | 57.93 | 45.81 | 55.95 | 36.82 | 43.97 |
| LinearDeeplab | Res-50 | 32.95 | 39.69 | 19.42 | 30.04 | 43.52 | 60.29 | 40.50 | 58.36 | 34.10 | 47.10 |
| Few-Shot Segmentation Methods |
| AMP [34] | Vgg-16 | 37.61 | 40.61 | 28.42 | 30.41 | 51.23 | 53.04 | 57.18 | 59.24 | 43.61 | 45.83 |
| PGNet [48] | Res-50 | 10.73 | 12.36 | 21.86 | 21.25 | 33.95 | 27.96 | 62.42 | 62.74 | 32.24 | 31.08 |
| PANet* [45] | Res-50 | 36.55 | 45.43 | 25.29 | 33.99 | 57.75 | 69.31 | 69.15 | 71.68 | 47.19 | 55.10 |
| CaNet [49] | Res-50 | 22.32 | 23.07 | 25.16 | 28.22 | 28.35 | 28.62 | 70.67 | 72.03 | 36.63 | 37.99 |
| RPMMs [46] | Res-50 | 12.99 | 13.47 | 18.02 | 20.04 | 30.11 | 30.82 | 65.12 | 67.06 | 31.56 | 32.85 |
| PFENet [38] | Res-50 | 16.88 | 18.01 | 23.50 | 23.83 | 27.22 | 27.57 | 70.87 | 70.52 | 34.62 | 34.98 |
| RePRI [3] | Res-50 | 25.03 | 27.41 | 23.27 | 26.23 | 65.08 | 65.48 | 70.96 | 74.23 | 46.09 | 48.34 |
| HSNet [27] | Res-50 | 29.65 | 35.08 | 31.20 | 35.10 | 51.88 | 54.36 | 77.53 | 80.99 | 47.57 | 51.38 |
| PATNet | Vgg-16 | 28.74 | 34.83 | 33.07 | 45.83 | 57.83 | 60.55 | 71.60 | 76.17 | 47.81 | 54.35 |
| PATNet | Res-50 | 37.89 | 42.97 | 41.16 | 53.58 | 66.61 | 70.20 | 78.59 | 81.23 | 56.06 | 61.99 |
+
+the target domain is similar to the source domain (e.g. FSS-1000), those meta-learning based methods outperform transfer learning based methods with a large margin. In contrast, the base classifier methods surprisingly achieve comparable performance when a large domain shift gap exists. For example, the pretrained Deeplab with a simple linear classifier achieves $39.69\%$ on Deep globe for 5-shot, outperforming most few-shot segmentation methods. It is worth noting that RePRI [3] is also a kind of transfer learning method designed for few-shot segmentation tasks. It performs well on Chest X-ray and FSS-1000, but fails on Deep globe and ISIC. This indicates that it is inefficient only to fine-tune the classifier during inference. Generating distinguishable features for the downstream segmentation modules is a key to reducing the performance degradation brought by domain shifts.
+
+# 6.5 Experimental Results of PATNet
+
+As shown in Table 2, across all the datasets, our model outperforms both meta-learning methods and transfer learning based methods with a sizable margin. Specifically, our 1-shot and 5-shot results respectively achieve $8.49\%$ and
+
+
+Fig. 5. Qualitative results of our model in 1-way 1-shot segmentation on CD-FSS. Note that the model is trained with PASCAL. Support labels are overlaid in blue. Prediction and ground truth of query images are in plum. Best view in color and zoom in.
+
+10.61% of mean-IoU improvements over HSNet (achieves the best performance among meta-learning methods on CD-FSS), 21.96% and 14.89% of mean-IoU improvements over DeeplabV3 combined with a linear classifier (achieves the best performance among transfer learning based methods on CD-FSS), verifying its superiority on the CD-FSS task. In particular, our model outperforms recent methods with a sizable margin under large domain gaps, surpassing HSNet by 14.73% (1-shot) and 15.84% (5-shot) on Chest X-ray, and 9.96% (1-shot) and 18.48% (5-shot) on ISIC. In addition, we present some of the qualitative results of the proposed model for 1-way 1-shot segmentation in Fig. 5. These results validate that the proposed method can significantly improve the generalization ability under large domain gaps while achieving a comparable accuracy in a similar domain shift.
+
+# 6.6 Ablation Study
+
+We conduct extensive ablation studies to investigate the impacts of PATM and TFI strategy. All ablation study experiments are performed with ResNet-50.
+
+Effect of pyramid anchor layers. To study the effect of the number of pyramid anchor layers in PATM, we compare our method with and without the anchor layers. We also form an explicit transformation module using a unique anchor layer for each intermediate feature map. From Table 3 we can observe that introducing the anchor layers for feature transformation improves the segmentation performance with $8.25\%$ and $7.64\%$ gain in 1-shot and 5-shot, respectively. This suggests that our proposed PATM is able to enhance the generalization ability by transforming the domain-specific features
+
+Table 3. Ablation study on PATM on CD-FSS. Results are averaged over 4 datasets for 1-shot and 5-shot.
+
+| Method | CD-FSS | #params |
| 1-shot | 5-shot | to train |
| w/o PAT | 47.57 | 51.38 | 2.574M |
| explicit PAT | 54.16 | 59.38 | 2.602M |
| PATNet | 56.06 | 61.99 | 2.581M |
+
+Table 4. Ablation study on the choice of fine-tuning anchor layers on Deep globe.
+
+| Fthigh | Ftmed | Ftlow | 1-shot | 5-shot |
| × | × | × | 35.10 | 40.72 |
| ✓ | × | × | 37.52 | 42.03 |
| × | ✓ | × | 34.56 | 39.74 |
| × | × | ✓ | 37.89 | 42.97 |
+
+into domain-agnostic ones. One may ask why not make each feature map have its own anchor layer. We compare the results with the explicit transformation module, introducing the anchor layer for each intermediate feature map (denoted as 'explicit PAT' in Table 3). Performance degradation from PATNet to explicit PAT indicates that the light-weight anchor layers are more reliable to construct the domain transformation matrices in few-shot scenarios. Thus, we only introduce one anchor layer for each feature dimension and feature maps with the same dimension share one anchor layer to compute their corresponding transformation matrices.
+
+Choice of fine-tuning anchor layers. Table 4 provides a quantitative evaluation of the TFI strategy. We present the results of fine-tuning each anchor layer: low-, medium- and high-level feature dimensions, respectively. We observe that fine-tuning the anchor layer of the low feature map achieves the best performance, indicating that the correlation patterns from low intermediate CNN layers are crucial in effective domain transfer. Qualitative results on how TFI affects the final prediction are provided in Fig. 4. We adopt fine-tuning the anchor layer for low dimensions to report all the experiment results.
+
+# 7 Conclusion
+
+In this paper, we extend few-shot semantic segmentation to a new task, called Cross-Domain Few-Shot Semantic Segmentation (CD-FSS), which aims to learn a model that can segment the novel classes in unseen domains with only a few pixel-level annotated images. Moreover, a new benchmark for CD-FSS is established to evaluate the cross-domain generalization ability of few-shot segmentation models under different domain shifts. Experiments show that SOTA few-shot segmentation models do not generalize well to categories from different domains, due to the large discrepancy of the feature distribution across domains. In addition, we propose a novel model, PATNet, to tackle the CD-FSS problem by transforming domain-specific features into domain-agnostic ones for downstream segmentation modules to fast adapt to unseen domains. Extensive experimental results show that our method outperforms the prior art with a sizable margin under domain shifts. We believe this work will help the community understand existing methods in a practical way and dive into further advances for real-world applications.
+
+# References
+
+1. Adler, T., Brandstetter, J., Widrich, M., Mayr, A., Kreil, D., Kopp, M., Klambauer, G., Hochreiter, S.: Cross-domain few-shot learning by representation fusion. arXiv preprint arXiv:2010.06498 (2020)
+2. Ben-Israel, A., Greville, T.N.: Generalized inverses: theory and applications, vol. 15. Springer Science & Business Media (2003)
+3. Boudiaf, M., Kervadec, H., Masud, Z., et al.: Few-shot segmentation without meta-learning: A good transductive inference is all you need? In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 13979-13988 (2021)
+4. Candemir, S., Jaeger, S., Palaniappan, K., Musco, J.P., Singh, R.K., Xue, Z., Karargyris, A., Antani, S., Thoma, G., McDonald, C.J.: Lung segmentation in chest radiographs using anatomical atlases with nonrigid registration. IEEE transactions on medical imaging 33(2), 577-590 (2013)
+5. Chen, L., Papandreou, G., Kokkinos, I., Murphy, K., Yuille, A.: Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence 40(4), 834-848 (2018)
+6. Chen, L.C., Papandreou, G., Schroff, F., Adam, H.: Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587 (2017)
+7. Chen, W.Y., Liu, Y.C., Kira, Z., Wang, Y.C.F., Huang, J.B.: A closer look at few-shot classification. arXiv preprint arXiv:1904.04232 (2019)
+8. Chen, Y.H., Chen, W.Y., Chen, Y.T., Tsai, B.C., Frank Wang, Y.C., Sun, M.: No more discrimination: Cross city adaptation of road scene segmenters. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1992-2001 (2017)
+9. Chen, Y., Li, W., Van Gool, L.: Road: Reality oriented adaptation for semantic segmentation of urban scenes. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7892-7901 (2018)
+0. Codella, N., Rotemberg, V., Tschandl, P., Celebi, M.E., Dusza, S., Gutman, D., Helba, B., Kalloo, A., Liopyris, K., Marchetti, M., et al.: Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv preprint arXiv:1902.03368 (2019)
+1. Demir, I., Koperski, K., Lindenbaum, D., Pang, G., Huang, J., Basu, S., Hughes, F., Tuia, D., Raskar, R.: Deep globe 2018: A challenge to parse the earth through satellite images. In: The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops (June 2018)
+2. Du, L., Tan, J., Yang, H., Feng, J., Xue, X., Zheng, Q., Ye, X., Zhang, X.: Ssf-dan: Separated semantic feature based domain adaptation network for semantic segmentation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 982-991 (2019)
+3. Everingham, M., Van Gool, L., Williams, C.K., Winn, J., Zisserman, A.: The pascal visual object classes (voc) challenge. International journal of computer vision 88(2), 303-338 (2010)
+4. Finn, C., Abbeel, P., Levine, S.: Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400 (2017)
+5. Garcia, V., Bruna, J.: Few-shot learning with graph neural networks. arXiv preprint arXiv:1711.04043 (2017)
+
+16. Guo, Y., Codella, N.C., Karlinsky, L., Smith, J.R., Rosing, T., Feris, R.: A new benchmark for evaluation of cross-domain few-shot learning. arXiv preprint arXiv:1912.07200 (2019)
+17. Hariharan, B., Arbeláez, P., Bourdev, L., Maji, S., Malik, J.: Semantic contours from inverse detectors. In: 2011 International Conference on Computer Vision. pp. 991-998. IEEE (2011)
+18. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
+19. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. pp. 6629-6640 (2017)
+20. Hoffman, J., Wang, D., Yu, F., Darrell, T.: Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. arXiv preprint arXiv:1612.02649 (2016)
+21. Jaeger, S., Karargyris, A., Candemir, S., Folio, L., Siegelman, J., Callaghan, F., Xue, Z., Palaniappan, K., Singh, R.K., Antani, S., et al.: Automatic tuberculosis screening using chest radiographs. IEEE transactions on medical imaging 33(2), 233-245 (2013)
+22. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
+23. Li, X., Wei, T., Chen, Y.P., Tai, Y.W., Tang, C.K.: Fss-1000: A 1000-class dataset for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2869-2878 (2020)
+24. Liu, Y., Lee, J., Park, M., Kim, S., Yang, E., Hwang, S.J., Yang, Y.: Learning to propagate labels: Transductive propagation network for few-shot learning. arXiv preprint arXiv:1805.10002 (2018)
+25. Liu, Y., Zhang, X., Zhang, S., He, X.: Part-aware prototype network for few-shot semantic segmentation. arXiv preprint arXiv:2007.06309 (2020)
+26. Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3431-3440 (2015)
+27. Min, J., Kang, D., Cho, M.: Hypercorrelation squeeze for few-shot segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 6941-6952 (2021)
+28. Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., Lerer, A.: Automatic differentiation in pytorch (2017)
+29. Ravi, S., Larochelle, H.: Optimization as a model for few-shot learning (2016)
+30. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al.: Imagenet large scale visual recognition challenge. International journal of computer vision 115(3), 211-252 (2015)
+31. Sakaridis, C., Dai, D., Gool, L.V.: Guided curriculum model adaptation and uncertainty-aware evaluation for semantic nighttime image segmentation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 7374-7383 (2019)
+32. Seo, J., Park, Y.H., Yoon, S.W., Moon, J.: Task-adaptive feature transformer for few-shot segmentation. arXiv preprint arXiv:2010.11437 (2020)
+33. Shaban, A., Bansal, S., Liu, Z., Essa, I., Boots, B.: One-shot learning for semantic segmentation. arXiv preprint arXiv:1709.03410 (2017)
+
+34. Siam, M., Oreshkin, B.N., Jagersand, M.: Amp: Adaptive masked proxies for few-shot segmentation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 5249-5258 (2019)
+35. Simon, C., Koniusz, P., Nock, R., Harandi, M.: Adaptive subspaces for few-shot learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4136-4145 (2020)
+36. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+37. Snell, J., Swersky, K., Zemel, R.: Prototypical networks for few-shot learning. In: Advances in neural information processing systems. pp. 4077-4087 (2017)
+38. Tian, Z., Zhao, H., Shu, M., Yang, Z., Li, R., Jia, J.: Prior guided feature enrichment network for few-shot segmentation. IEEE Transactions on Pattern Analysis & Machine Intelligence (TPAMI) (2020)
+39. Triantafillou, E., Zhu, T., Dumoulin, V., Lamblin, P., Evci, U., Xu, K., Goroshin, R., Gelada, C., Swersky, K., Manzagol, P.A., et al.: Meta-dataset: A dataset of datasets for learning to learn from few examples. arXiv preprint arXiv:1903.03096 (2019)
+40. Tsai, Y.H., Hung, W.C., Schulter, S., Sohn, K., Yang, M.H., Chandraker, M.: Learning to adapt structured output space for semantic segmentation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7472-7481 (2018)
+41. Tsai, Y.H., Sohn, K., Schulter, S., Chandraker, M.: Domain adaptation for structured output via discriminative patch representations. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1456-1465 (2019)
+42. Tschandl, P., Rosendahl, C., Kittler, H.: The ham10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Scientific data 5, 180161 (2018)
+43. Tseng, H.Y., Lee, H.Y., Huang, J.B., Yang, M.H.: Cross-domain few-shot classification via learned feature-wise transformation. arXiv preprint arXiv:2001.08735 (2020)
+44. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. In: Advances in neural information processing systems. pp. 3630-3638 (2016)
+45. Wang, K., Liew, J.H., Zou, Y., Zhou, D., Feng, J.: Panet: Few-shot image semantic segmentation with prototype alignment. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 9197-9206 (2019)
+46. Yang, B., Liu, C., Li, B., Jiao, J., Ye, Q.: Prototype mixture models for few-shot semantic segmentation. arXiv preprint arXiv:2008.03898 (2020)
+47. Yoon, S.W., Seo, J., Moon, J.: Tapnet: Neural network augmented with task-adaptive projection for few-shot learning. In: International Conference on Machine Learning. pp. 7115-7123. PMLR (2019)
+48. Zhang, C., Lin, G., Liu, F., Guo, J., Wu, Q., Yao, R.: Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9587-9595 (2019)
+49. Zhang, C., Lin, G., Liu, F., Yao, R., Shen, C.: Canet: Class-agnostic segmentation networks with iterative refinement and attentive few-shot learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 5217-5226 (2019)
+50. Zhang, X., Wei, Y., Yang, Y., Huang, T.S.: Sg-one: Similarity guidance network for one-shot semantic segmentation. IEEE Transactions on Cybernetics (2020)
+
+51. Zhang, Y., David, P., Foroosh, H., Gong, B.: A curriculum domain adaptation approach to the semantic segmentation of urban scenes. IEEE transactions on pattern analysis and machine intelligence (2019)
+52. Zhao, H., Shi, J., Qi, X., Wang, X., Jia, J.: Pyramid scene parsing network. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2881-2890 (2017)
+53. Zhu, X., Zhou, H., Yang, C., Shi, J., Lin, D.: Penalizing top performers: Conservative loss for semantic segmentation adaptation. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 568-583 (2018)
+54. Zou, Y., Yu, Z., Vijaya Kumar, B., Wang, J.: Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In: Proceedings of the European conference on computer vision (ECCV). pp. 289-305 (2018)
\ No newline at end of file
diff --git a/crossdomainfewshotsemanticsegmentation/images.zip b/crossdomainfewshotsemanticsegmentation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..0b72801634fff8320bb8c6559c3fdb3b881b8524
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af586aeb9f5c99fd21821386ed587df0755933fe811c6b12204ac98a24f25651
+size 524041
diff --git a/crossdomainfewshotsemanticsegmentation/layout.json b/crossdomainfewshotsemanticsegmentation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c1ddea5f2c7fbe793d482e5fe2c5e574d6d9dd1c
--- /dev/null
+++ b/crossdomainfewshotsemanticsegmentation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:05422ec47ff452414af499fdce210156ee1edfe934f5e308adaff4674d17261e
+size 400358
diff --git a/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_content_list.json b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..baa81488354e4262aafe02e22003a16a06cb5b4b
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f09ec5c3672d0fd3f33d13db121c8270e0a1c6688b18fab19f4b52b2b3e6849
+size 87184
diff --git a/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_model.json b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..44c72740162e39d642f09e06720f42de660d2c60
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:96ea16b92428e813935f04194065a8fb4895f3044565dfb36210a8e3a9a89d35
+size 110078
diff --git a/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_origin.pdf b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..13dc1acb6ea15cbc52141a1a6dd9a4863c1789c2
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/2f9af9c9-48c4-46b4-b62c-1b311c5d2d3d_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:68a803e30b5efef2dd2f7db77a5f284d9f4eae60e789b291762d6c23cd0127cd
+size 8078141
diff --git a/crossmodal3dshapegenerationandmanipulation/full.md b/crossmodal3dshapegenerationandmanipulation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3bb0253a975592398b1d89d5471e811cf314afa6
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/full.md
@@ -0,0 +1,349 @@
+# Cross-Modal 3D Shape Generation and Manipulation
+
+Zezhou Cheng $^{1}$ , Menglei Chai $^{2}$ , Jian Ren $^{2}$ , Hsin-Ying Lee $^{2}$ , Kyle Olszewski $^{2}$ , Zeng Huang $^{2}$ , Subhransu Maji $^{1}$ , and Sergey Tulyakov $^{2}$
+
+1 University of Massachusetts, Amherst
+
+2 Snap Inc.
+
+Abstract. Creating and editing the shape and color of 3D objects require tremendous human effort and expertise. Compared to direct manipulation in 3D interfaces, 2D interactions such as sketches and scribbles are usually much more natural and intuitive for the users. In this paper, we propose a generic multi-modal generative model that couples the 2D modalities and implicit 3D representations through shared latent spaces. With the proposed model, versatile 3D generation and manipulation are enabled by simply propagating the editing from a specific 2D controlling modality through the latent spaces. For example, editing the 3D shape by drawing a sketch, re-colorizing the 3D surface via painting color scribbles on the 2D rendering, or generating 3D shapes of a certain category given one or a few reference images. Unlike prior works, our model does not require re-training or fine-tuning per editing task and is also conceptually simple, easy to implement, robust to input domain shifts, and flexible to diverse reconstruction on partial 2D inputs. We evaluate our framework on two representative 2D modalities of grayscale line sketches and rendered color images, and demonstrate that our method enables various shape manipulation and generation tasks with these 2D modalities.
+
+# 1 Introduction
+
+With the growth in 3D acquisition and visualization technology, there is an increasing need of tools for 3D content creation and editing tasks such as deforming the shape of an object, changing the color of a part, or inserting or removing a component. The graphics and vision community has proposed a number of tools for these tasks [43,13,2,39]. Yet, manipulating 3D still requires tremendous human labor and expertise, prohibiting wide-scale adoption by nonprofessionals. Compared to the traditional 3D user interfaces, 2D interactions on view-dependent image planes can be a more intuitive way to edit the shape. This has motivated the community to leverage advances in shape representations using deep networks [38,35,9,47] for 3D shape manipulation with 2D controls, such as mesh reconstruction from sketches [20] and color editing with scribbles [34].
+
+
+Fig. 1. We propose a multi-modal generative model that bridges multiple 2D (e.g., sketch, color views) and 3D modalities via shared latent spaces (left). Versatile 3D shape generation and manipulation tasks can be tackled via simple latent optimization method (right).
+
+
+
+However, most prior works on 2D-to-3D shape manipulation are tailored to a particular editing task and interaction format, which makes generalization to new editing tasks or controls challenging, or even infeasible. This is important because there is often no single interaction that fits every use case - the preferred 2D user control depends on the editing goals, scenarios, devices, or targeted users.
+
+Motivated by this, we propose a 2D-to-3D framework that not only works on a single control modality but also enjoys the flexibility of handling various types of 2D interactions without the need for changing the architecture or even re-training (Fig. 1 left). Our framework bridges various 2D interaction modalities and the target 3D shape through a uniform editing propagation mechanism. The key is to construct a shared latent representation across generative models of each of the 2D and 3D modalities. The shared latent representation enforces that an arbitrary latent code corresponds to a 3D model that is consistent with every modality, in terms of both shape and color. With our model, any editing can be achieved by an objective that aims to match the corresponding editing modality and backpropagating the error to estimate the latent code. Moreover, different editing operations and modalities can be combined and interleaved leading to a versatile tool for editing the shape (Fig. 1 right). The approach can be extended to a new user control by simply adding a generator for the corresponding modality in the framework.
+
+We evaluate our framework on two representative 2D modalities, i.e., grayscale line sketches, and rendered color images. We provide extensive quantitative and qualitative results in shape and color editing with sketches and scribbles, as well as single-view, few-shot, or even partial-view cross-modal shape generation. The proposed method is conceptually simple, easy to implement, robust to input domain shifts, and generalizable to new modalities with no special requirement on the network architecture.
+
+# 2 Related Work
+
+Multi-Modal Generative Models. There has been much work on learning a joint distribution of multiple modalities $p(\pmb{x}_0, \dots, \pmb{x}_n)$ where each modality $\pmb{x}_i$ rep-
+
+Table 1. Comparisons to cross-modal 3D editing and generation works.
+
+| Methods | Manipulation | Generation |
| Shape | Color | Single view | Partial view | Few shot |
| Sketch2Mesh [20] | ✓ | X | ✓ | X | X |
| DualSDF [22] | ✓ | X | X | X | X |
| EditNeRF [34] | ✓ | ✓ | X | X | X |
| Ours | ✓ | ✓ | ✓ | ✓ | ✓ |
+
+resents one representation (e.g., images, text) of underlying signals. Multi-modal VAEs [49,53,54,46,27] learn a joint distribution $p_{\theta}(\pmb{x}_0,\dots,\pmb{x}_n \mid \pmb{z})$ conditioned on common latent variables $\pmb{z} \in \mathcal{Z}$ . Without the assumption of paired multi-modal data, multi-modal GANs [31,10,17] learn the joint distribution by sharing a latent space and model parameters across modalities. These multi-modal generative models have enabled versatile applications such as cross-modal image translation [10,31] and domain adaptation [31]. Similar to these works, we build a multi-modal generative model that bridges multiple modalities via a shared latent space. However, we generate and edit 3D shapes with sparse 2D inputs (e.g., scribbles, sketches) and build a 2D-3D generative model based on variational auto-decoders (VADs) [57,22]. Prior work [57] has shown that VADs excel at generative modeling from incomplete data. In this work, we demonstrate that the multi-modal VADs (MM-VADs) are ideally suited for the task of 3D generation and manipulation from sparse 2D inputs (e.g., color scribble or partial inputs).
+
+Shape and Appearance Reconstruction. Extensive works have explored the problem of 3D reconstruction from different modalities, such as RGB images [25,11], videos [56], sketches [24,20,61,60], or even text [8]. This problem has also been explored under diverse representations [11,15,33,51,14,38,9,35,47,55] and different levels of supervision [11,15,25,16,56]. Despite the diverse settings of this problem, the encoder-decoder network, which maps the source modalities to 3D shape directly in a feed-forward manner, remains the most popular 3D reconstruction model [11,51,25,38]. However, such feed-forward networks are not robust to input domain shift (e.g., incomplete data). In this work, we demonstrate that the proposed MM-VADs perform more robustly and could provide multiple 3D reconstructions that fit the given input (e.g., partial 2D views).
+
+Shape and Appearance Manipulation. Numerous interactive tools have been developed for image editing [29,59,41,30,18,28] and 3D shape manipulations [43,13,2,39]. More recently, generative modeling of natural images [17,48] has become a "Swiss knife" for image editing problems [62,45,44,19,1,4,5,37,42]. Similar to these works, we build a multi-modal generative model that is able to tackle versatile 3D shape generation and editing tasks with 2D inputs. Novel interactive tools have also been proposed recently to edit implicit 3D representations [38,36]. For example, DualSDF [22] edits the SDFs [38] via shape primitives (e.g., spheres). Sketch2Mesh [20] reconstructs shapes from sketch with an encoder-decoder network and refines 3D shapes via differentiable rendering.
+
+EditNeRF[34] edits the radiance field [36] by fine-tuning the network weights based on user's scribbles.
+
+Tab. 1 summarizes the commons and differences between our work and recent efforts [22,20,34] on 3D manipulation and generation. Similar to Sketch2Mesh [20], we edit and reconstruct 3D shape from 2D sketch. However, we tackle this problem via a novel multi-modal generative model that performs more robust to input domain shift (e.g., partial input, sparse color scribble). Furthermore, the shape and color edits can be combined and interleaved with our model; Like EditNeRF, we edit the appearance of 3D shapes via 2D color scribbles. However, we conduct the 3D editing via a simple latent optimization, instead of finetuning the network weights per edit; Akin to DualSDF [22], we build a generative model for 3D manipulation, yet we generate and edit shapes from 2D modalities which is more intuitive to edit the shape than using 3D primitives. Moreover, our generative model can be adapted to generate 3D shapes of a certain category (e.g., armchairs) given a few 2D examples, namely, few-shot cross-modal shape generation.
+
+# 3 Method
+
+We describe the Variational Auto-Decoders (VADs) [57] in § 3.1, introduce the proposed VAD-based multi-modal generative model (dubbed MM-VADs) in § 3.2, and illustrate the application of MM-VADs in cross-modal 3D shape generation and manipulation tasks in § 3.3.
+
+# 3.1 Background: Variational Auto-Decoder
+
+Given observation variables $\pmb{x} \sim p(\pmb{x})$ and latent variables $\pmb{z} \sim p(\pmb{z})$ , a variational auto-decoder (VAD) approximates the data distribution $p(\pmb{x})$ via a parametric family of distributions $p_{\theta}(\pmb{x} \mid \pmb{z})$ with parameters $\theta$ . Similar to variational autoencoders (VAEs) [27], VADs are trained by maximizing the marginal distribution $p(\pmb{x}) = \int p_{\theta}(\pmb{x} \mid \pmb{z}) p(\pmb{z}) d\pmb{z}$ . In practice this integral is expensive or intractable, so the model parameters $\theta$ are learned instead by maximizing the Evidence Lower Bound (ELBO):
+
+$$
+\mathcal {V} (\phi , \theta \mid \boldsymbol {x}) = - \operatorname {K L} \left(q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {x}) \| p (\boldsymbol {z})\right) + \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {x})} \left[ \log p _ {\theta} (\boldsymbol {x} \mid \boldsymbol {z}) \right], \tag {1}
+$$
+
+where $\mathrm{KL}(\cdot \| \cdot)$ is the Kullback-Leibler divergence that encourages the posterior distribution to follow the latent prior $p(\pmb {z})$ , and $q_{\phi}(\pmb {z}\mid \pmb {x})$ is an approximation of the posterior $p(\pmb {z}\mid \pmb {x})$ . In VAEs, $q_{\phi}(\pmb {z}\mid \pmb {x})$ is parametrized by a neural network and $\phi$ are the parameters of the encoder. In VADs, $\phi$ are instead learnable similar to the parameters $\theta$ in the decoder $p_{\theta}(\pmb {x}\mid \pmb {z})$ . For example, the multivariate Gaussian approximate posterior for a data instance $\pmb{x}_i$ is defined as:
+
+$$
+q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {x} _ {i}) := \mathcal {N} (\boldsymbol {z}; \boldsymbol {\mu} _ {i}, \boldsymbol {\Sigma} _ {i}), \tag {2}
+$$
+
+where $\phi = \{\pmb{\mu}_i, \pmb{\Sigma}_i\}$ . The reparametrization trick is applied in order to backpropagate the gradients to the mean $\pmb{\mu}_i$ and variance $\pmb{\Sigma}_i$ in VADs. In comparison,
+
+VAEs back-propagate the gradients through the mean $\pmb{\mu}_i$ and variance $\pmb{\Sigma}_i$ to learn the parameters of the encoder. At inference time, the parameters $\phi$ of the approximate posterior distribution can be estimated by maximizing the ELBO in Eqn. 1 while the parameters $\theta$ of the decoder are frozen:
+
+$$
+\phi^ {*} = \underset {\phi} {\arg \max } \mathcal {V} (\phi \mid \theta , \boldsymbol {x} _ {i}). \tag {3}
+$$
+
+Despite the similarity between VAEs and VADs, prior works [57] demonstrate that VADs perform approximate posterior inference more robustly on incomplete data and input domain shifts than VAEs.
+
+# 3.2 Multi-Modal Variational Auto-Decoder
+
+We consider two modalities $\pmb{x},\pmb{w}$ and an i.i.d. dataset with paired instances $(\pmb{X},\pmb{W}) = \{(\pmb{x}_0,\pmb{w}_0),\dots,(\pmb{x}_N,\pmb{w}_N)\}$ . We target at learning a joint distribution of both modalities $p(\pmb{x},\pmb{w})$ . Like VADs [57], the multi-modal VADs (MM-VADs) are trained by maximizing the ELBO:
+
+$$
+\mathcal {V} (\phi , \theta \mid \boldsymbol {x}, \boldsymbol {w}) = - \operatorname {K L} \left(q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {x}, \boldsymbol {w}) \| p (\boldsymbol {z})\right) + \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} | \boldsymbol {x}, \boldsymbol {w})} \left[ \log p _ {\theta} (\boldsymbol {x}, \boldsymbol {w} \mid \boldsymbol {z}) \right], \tag {4}
+$$
+
+where $\mathbf{z}$ is the latent variable shared by the two modalities $\mathbf{x}$ and $\mathbf{w}$ , $p_{\theta}(\mathbf{x}, \mathbf{w} \mid \mathbf{z}) = p_{\theta_x}(\mathbf{x} \mid \mathbf{z}) p_{\theta_w}(\mathbf{w} \mid \mathbf{z})$ under the assumption that the two modalities $\mathbf{x}$ and $\mathbf{w}$ are independent conditioned on the latent variable $\mathbf{z}$ (i.e., $\mathbf{x} \perp \mathbf{w} \mid \mathbf{z}$ ). In practice, $p_{\theta_x}(\mathbf{x} \mid \mathbf{z})$ or $p_{\theta_w}(\mathbf{w} \mid \mathbf{z})$ can be parameterized by different networks for the two modalities $\mathbf{x}$ and $\mathbf{w}$ respectively. The parameters $\phi$ of the approximate posterior distribution $q_{\phi}(\mathbf{z} \mid \mathbf{x}, \mathbf{w})$ are learnable parameters where $\phi = \{\pmb{\mu}, \pmb{\Sigma}\}$ under the assumption of multivariate Gaussian posterior distribution. At inference time, the parameters $\phi$ are estimated via maximizing the ELBO with frozen decoder parameters $\theta$ :
+
+$$
+\phi^ {*} = \underset {\phi} {\arg \max } \mathcal {V} (\phi \mid \theta , \boldsymbol {x} _ {i}, \boldsymbol {w} _ {i}). \tag {5}
+$$
+
+When one of the modalities is missing during inference, the inputs of the missing modalities are simply set to zero. This is the case when we want to infer one modality from the other (e.g., 3D reconstruction from 2D sketch). This framework can be trivially extended to learn a joint distribution of more than two modalities.
+
+# 3.3 Learning a Joint 2D-3D Prior with MM-VADs
+
+Here we introduce the application of MM-VADs in cross-modal 3D shape generation and manipulation. Specifically, we learn a joint distribution of 2D and 3D modalities with MM-VADs. Once trained, MM-VADs can be applied to versatile shape generation and editing tasks via a simple posterior inference (or latent optimization). We explore three representative modalities, including 3D shape with colorful surface, 2D sketch in grayscale, and 2D rendered image in
+
+
+Fig.2. Network architecture. We propose a multi-modal variational auto-decoder consisting of compact shape and color latent spaces shared across multiple 2D (e.g., sketch, RGB views) or 3D modalities (e.g., signed distance function and 3D surface color).
+
+RGB color, donated as $C, S, R$ respectively. Given a dataset $\{(C_i, S_i, R_i)\}$ , we target at learning a joint distribution of the three modalities $p(C, S, R)$ . Fig. 2 presents the overview of the MM-VADs framework. We provide more details in the following sections.
+
+Joint Latent Space. The MM-VADs share a common latent space $\mathcal{Z}$ across different modalities (Eqn. 4). Targeting at editing 3D shape and surface color independently, we further disentangle the shared latent space into the shape and color subspaces, denoted as $\mathcal{Z}_s$ and $\mathcal{Z}_c$ respectively. Therefore, each latent code $z = z_{s} \oplus z_{c}$ , where $z_{s} \in \mathcal{Z}_{s}$ , $z_{c} \in \mathcal{Z}_{c}$ , and $\oplus$ denotes the concatenation operator.
+
+3D Colorful Shape. Targeting at generating and editing 3D shapes and their appearance, we use the 3D colorful shape as one of our modalities. Among various representations of 3D shapes (e.g., voxel, mesh, point clouds), the implicit representations [38,35,47] model 3D shapes as isosurfaces of functions and are capable of capturing high-level details. We adopt the DeepSDF [38] to regress the signed distance functions (SDFs) from point samples directly using a MLP-based 3D shape network $\mathcal{F}_{\alpha}(\boldsymbol{z}_s \oplus \boldsymbol{p})$ , whose input is a shape latent code $\boldsymbol{z}_s \in \mathcal{Z}_s$ and 3D coordinates $\boldsymbol{p} \in \mathbb{R}^3$ . We predict the surface color with another feed-forward 3D color network $\mathcal{F}_{\beta}(\boldsymbol{z}_c \oplus \boldsymbol{z}_s^k)$ , whose input is a color latent code $\boldsymbol{z}_c \in \mathcal{Z}_c$ and the intermediate features from the $k$ -th layer of 3D shape network $\mathcal{F}_{\alpha}$ . The generator of the 3D modality $\mathcal{G}^{\mathbf{C}}$ is the combination of the 3D shape and color network:
+
+$$
+\mathcal {G} ^ {\boldsymbol {C}} \left(\boldsymbol {z} _ {s} \oplus \boldsymbol {z} _ {c} \oplus \boldsymbol {p}\right) = \left\{\mathcal {F} _ {\alpha} \left(\boldsymbol {z} _ {s} \oplus \boldsymbol {p}\right), \mathcal {F} _ {\beta} \left(\boldsymbol {z} _ {c} \oplus \boldsymbol {z} _ {s} ^ {k}\right) \right\}. \tag {6}
+$$
+
+Both networks are trained using the same set of spatial points. The objective function $\mathcal{L}^C$ for $\mathcal{G}^C$ is the $\mathcal{L}_1$ loss defined between the prediction and the ground-truth SDF values and surface colors on the sampled points.
+
+2D Sketch. The 2D sketch depicts the 3D structures and provides a natural way for the user to manipulate the 3D shapes. For the purpose of generalization, we adopt a simple and standard fully convolutional network [40] as our sketch generator $\mathcal{G}^{\mathrm{S}}(\pmb{z}_s\oplus \pmb{v})$ with the shape code $\pmb {z}_s\in \mathcal{Z}_s$ and the viewpoint $\pmb{v}$ as input. The objective function $\mathcal{L}^S$ is defined as a cross-entropy loss between the reconstructed and ground-truth sketches.
+
+2D Rendering. The 2D color rendering reflects a view-dependent appearance of the 3D surface. Drawing 2D scribbles on the renderings provides an efficient and straightforward interactive tool for the user to edit the 3D surface color. Similar to the 2D sketch modality, we use the standard fully convolutional architecture [40]
+
+as our 2D rendering generator $\mathcal{G}^R (\pmb {z}_s\oplus \pmb {z}_c\oplus \pmb {v})$ , which takes the concatenation of the shape code $\pmb {z}_s\in \mathcal{Z}_s$ , the color code $\pmb {z}_c\in \mathcal{Z}_c$ and the viewpoint $\pmb{v}$ . We adopt Laplacian- $\mathcal{L}_1$ loss [3] to train $\mathcal{G}^R$ ..
+
+$$
+\mathcal {L} ^ {\boldsymbol {R}} \left(\boldsymbol {z} _ {i} \oplus \boldsymbol {v}, \boldsymbol {R} _ {i}\right) = \frac {1}{N} \sum_ {j} ^ {J} 4 ^ {- j} \left\| \mathrm {L} ^ {j} \left(\mathcal {G} ^ {\boldsymbol {R}} \left(\boldsymbol {z} _ {i} \oplus \boldsymbol {v}\right)\right) - \mathrm {L} ^ {j} \left(\boldsymbol {R} _ {i}\right) \right\| _ {1}, \tag {7}
+$$
+
+where $\mathbf{z}_i$ is the concatenation of the shape and color codes for the target image $\mathbf{R}_i$ , $N$ is the total number of pixels in the image $\mathbf{R}_i$ , $J$ is the total number of levels of the Laplacian pyramid (e.g., 3 by default), and $\mathrm{L}^j(x)$ is the $j$ -th level in the pyramid of image $x$ [6]. This loss encourages sharper output [3] compared to the standard $\mathcal{L}_1$ or MSE loss.
+
+Summary. The proposed MM-VAD framework for learning the joint distribution of the three modalities can be learned with the following objective:
+
+$$
+\begin{array}{l} \begin{array}{l} \mathcal {V} (\phi , \theta \mid \boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R}) = - \mathrm {K L} \left(q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R}) \| p (\boldsymbol {z})\right) \\ \text {,} \mathbb {E} _ {\boldsymbol {r}} \quad [ 1, \quad (\boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R}) ] \end{array} \tag {8} \\ + \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} | \boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R})} [ \log p _ {\theta} (\boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R} \mid \boldsymbol {z}) ], \\ \end{array}
+$$
+
+where the first term regularizes the posterior distribution to a latent prior (e.g. $\mathcal{N}(\mathbf{0},\mathbf{I})$ ), and the second term can be factorized into three components under the assumption that modalities are independent conditioned on the shared latent variable $\mathbf{z}$ :
+
+$$
+\begin{array}{l} \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R})} [ \log p _ {\theta} (\boldsymbol {C}, \boldsymbol {S}, \boldsymbol {R} \mid \boldsymbol {z}) ] = \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} \mid \boldsymbol {C})} [ \log p _ {\theta} (\boldsymbol {C} \mid \boldsymbol {z}) ] \\ + \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} | \boldsymbol {C})} \left[ \log p _ {\theta} (\boldsymbol {S} \mid \boldsymbol {z}) \right] \\ + \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} | \boldsymbol {C})} \left[ \log p _ {\theta} (\boldsymbol {R} \mid \boldsymbol {z}) \right] \tag {9} \\ = \mathcal {L} ^ {C} + \mathcal {L} ^ {S} + \mathcal {L} ^ {R}, \\ \end{array}
+$$
+
+where each term corresponds to the reconstruction loss per modality as described above. Notice that the 3D shape modality $\pmb{C}$ contains all the information in the latent variable $\pmb{z}$ , therefore $q_{\phi}(\pmb{z} \mid \pmb{C}, \pmb{S}, \pmb{R}) = q_{\phi}(\pmb{z} \mid \pmb{C})$ .
+
+# 3.4 Cross-Modal Shape Manipulation with MM-VADs
+
+Given an initial latent code $\mathbf{z}_0$ that corresponds to the initial 3D shape $\mathcal{G}^C(\mathbf{z}_0)$ and any 2D control $\mathcal{G}^M(\mathbf{z}_0)$ of the 2D modality $M \in \{\mathbf{S}, \mathbf{R}\}$ , the shape manipulation is conducted by optimizing within the latent space to get the updated code $\hat{\mathbf{z}}$ such that $\mathcal{G}(\hat{\mathbf{z}})^M$ matches the 2D edits $e^M$ :
+
+$$
+\hat {z} = \underset {z} {\arg \min } \mathcal {L} _ {\text {e d i t}} \left(\mathcal {G} ^ {M} (z), e ^ {M}\right) + \mathcal {L} _ {\text {r e g}} (z), \tag {10}
+$$
+
+where $\mathcal{L}_{\mathrm{edit}}$ could be any loss (e.g., $\mathcal{L}_1$ loss) that encourages the 2D modalities $\mathcal{G}(\hat{z})^M$ to match the 2D edits $e^{M}$ , and $\mathcal{L}_{\mathrm{reg}}(z)$ encourages the latent code to stay in the latent prior of MM-VADs. We apply the regularization loss proposed in DualSDF [22]:
+
+$$
+\mathcal {L} _ {\text {r e g}} = \gamma \max \left(\| z \| _ {2} ^ {2}, \beta\right), \tag {11}
+$$
+
+where $\gamma$ and $\beta$ controls the strength of the regularization loss. The latent optimization is closely related to the posterior inference (Eqn. 5) of MM-VADs.
+
+MM-VADs allows free-form edits $e^{M}$ . For example, the edits $e^{M}$ could be local modifications on the sketch or sparse color scribbles on 2D renderings. This makes the MM-VADs ideally suited for the interactive 3D manipulation tasks. In comparison, the encoder-decoder networks [20] are not robust to the input domain shift (e.g., incomplete data [57]) and require re-training per type of user interactions (e.g., sketch, color scribble).
+
+# 3.5 Cross-Modal Shape Generation with MM-VADs
+
+Single-View Reconstruction. Given a single input $\pmb{x}^M$ of the 2D modality $M\in \{C,R\}$ , the task of single-view cross-modal shape generation is to reconstruct the corresponding 3D shape satisfying the 2D constraint. Without the need of training one model per pair of 2D and 3D modalities [20,50] or designing differentiable renderers [32] for each 2D modalities [20], like shape manipulation (§3.4), this task can be tackled via the latent optimization:
+
+$$
+\hat {\boldsymbol {z}} = \underset {\boldsymbol {z}} {\arg \min } \mathcal {L} _ {\text {r e c o n}} \left(\mathcal {G} ^ {M} (\boldsymbol {z}), \boldsymbol {x} ^ {M}\right) + \mathcal {L} _ {\text {r e g}} (\boldsymbol {z}), \tag {12}
+$$
+
+Partial-View Reconstruction. The MM-VADs are flexible to reconstruct 3D shapes from partially visible inputs. More interestingly, when the input is ambiguous, it provides diverse 3D reconstructions by performing the latent optimization with different initialization of the latent code $\mathbf{z}$ . This property has practical applications. For example, the MM-VAD could provide multiple 3D shape suggestions interactively while the user is drawing sketches.
+
+Few-Shot Generation. Given a few 2D images spanning a subspace in the 3D distribution that represents a certain semantic attribute (e.g., armchairs, red chairs), the task of few-shot shape generation is to learn a 3D shape generative model that conceptually aligns with the provided 2D images. Given our pretrained MM-VAD, we tackle this task by steering the latent space with adversarial loss, borrowing the idea from MineGAN [52]. Specifically, we learn a mapping function $h_{\omega}(z)$ that maps the prior distribution of the latent space $z \sim \hat{p}(z)$ (i.e., $\mathcal{N}(\mathbf{0}, \mathbf{I})$ ) to a new distribution such that samples from the 2D generators $\mathcal{G}^M(h_{\omega}(z))$ aligns the target data distribution $x \sim \hat{p}(x)$ depicted by the provided 2D images. We apply the WGAN-GP loss [21] with frozen generators to learn the mapping function $h_{\omega}(z)$ :
+
+$$
+\underset {\omega} {\min } \underset {\mathcal {D}} {\max } \mathbb {E} _ {\boldsymbol {x} \sim \hat {p} (\boldsymbol {x})} \left[ \mathcal {D} (\boldsymbol {x}) \right] - \mathbb {E} _ {\boldsymbol {z} \sim p (\boldsymbol {z})} \left[ \mathcal {D} \left(\mathcal {G} ^ {M} \left(h _ {\omega} (\boldsymbol {z}))\right)\right) \right], \tag {13}
+$$
+
+where both the mapping function $h_\omega$ and the discriminator $\mathcal{D}$ are trained from scratch.
+
+# 4 Experiments
+
+This section provides qualitative and quantitative results of the proposed MMVADs in versatile tasks of 3D shape manipulation (§ 4.1) and generation (§ 4.2).
+
+
+Fig. 3. Editing shape via sketch. The proposed method enables fine-grained editing of shape geometry, e.g., removing the engine of an airplane or reshaping the back of a chair. Interestingly, new engines often appear at the tail of airplane after removing the engines on the wing. This is because airplanes without any engines rarely exist in the domain of our generative model. The edited local regions are highlighted in red bounding boxes.
+
+Dataset. We conduct evaluations and comparisons mainly on 3D ShapeNet dataset [7]. For 3D shapes, We follow DeepSDF [38] to sample 3D points and their signed distances to the object surface. The points that are far from the surface (i.e., with the absolute distance higher than a threshold) are assigned with a pre-defined background color (e.g., white) while points surrounding the surface are assigned with the color of the nearest surface point. For 2D sketches, we use suggestive contours [12] to generate the synthetic sketches. For 2D renderings, we randomize the surface color of 3D shapes per semantic part. We use ShapeNet chairs and airplanes with the same training and test splits as DeepSDF [38].
+
+Implementation Details. We use an 8-layer MLP as the 3D shape network which outputs SDF and a 3-layer MLP as the 3D color network which predicts RGB. We concatenate the features from the 6-th hidden layer of the 3D shape network with the color code as the input to the 3D color network. We train our MM-VADs using Adam [26]. We present more implementation details in the supplementary material.
+
+Baselines. We use the following state-of-the-arts as our baselines:
+
+- Encoder-Decoder Networks [20]. This model is trained per task of 3D generation from 2D modalities (sketches or RGB images). We do not use the differentiable rendering proposed in [20] which requires auxiliary information (e.g., segmentation mask, depth) and is applicable to MM-VADs.
+- EditNeRF [34]. This model edits 3D neural radiance field (including shape and color) by updating the neural network weights based on the user's scribbles. We make comparisons with the pre-trained EditNeRF models.
+
+# 4.1 Cross-modal Shape Manipulation
+
+Sketch-Based Shape Manipulation. The proposed MM-VADs allow users to edit the fine geometric structures via 2D sketches, as described in § 3.4. We provide
+
+Table 2. Editing shape via sketch. We report the Chamfer distance (CD) between the manually edited shapes and our editing results (lower is better).
+
+ | Airplane | Chair |
| - engine | + engine | - curve | + curve |
| Initial shape | 0.096 | 0.123 | 0.066 | 0.085 |
| Edited shape | 0.059 | 0.134 | 0.054 | 0.124 |
+
+
+Fig. 4. Comparison with DualSDF. Left: DualSDF [22] edits 3D shapes via 3D primitives. Editing different primitives on the same part may lead to dramatically different editing results (2nd - 4th columns). Right: our sketch-based interactions is more intuitive for the user.
+
+users with an interactive interface where users can edit the initial sketch by adding or removing a certain part or even deforming a contour line. Fig. 3 presents some qualitative results of sketch-based shape manipulation. Interestingly, we find that our manipulation is semantics-aware. For example, removing the airplane engines on the wings will automatically add new engines to the tail. Such shape priors are absent in non-generative models (e.g., EditNeRF [34]).
+
+It is challenging to quantitatively evaluate the sketch-based shape editing due to the lack of ground-truth paired 3D shapes before and after editing. For this reason, prior works [20] report the quantitative results of 3D reconstruction from sketches as a proxy. We follow prior works and report the same quantitative evaluations in Sec. 4.2. Furthermore, we manually edit the 3D shapes presented in Fig. 3 such that their sketches align with the human edits. Tab. 2 reports the Chamfer distance (CD) between the manually edited shapes and our editing results. We see that CD improves when removing a part, but adding parts unfortunately increases the CD as it induces more changes to the overall shape. This is often desirable, but the CD metric does not reflect that.
+
+Fig. 4 provides a comparison with DualSDF [22]. A fair comparison is not possible, as DualSDF edits shapes via 3D primitives instead of 2D views. We find that DualSDF requires users to select right primitives to achieve certain edits (e.g., adding a curve to the chair back). In comparison, our sketch-based shape editing is more intuitive.
+
+Scribble-Based Color Manipulation. MM-VADs allow users to edit the appearance of 3D shapes via color scribbles. Fig. 5 shows that MM-VADs propagate the sparse color scribbles into desired regions (e.g., from the left wing of the airplanes to the right, from the left leg of chairs to the right). We provide more color editing results with diverse color scribbles in the supplementary material. As
+
+
+(a) Init.
+
+
+
+
+(b) Color editing
+
+
+
+
+
+
+(a) Init.
+
+
+
+
+(b) Color editing
+
+
+
+
+Fig. 5. Editing shape via color scribble. (a) presents the initial 2D and 3D view of the object. (b) shows the 2D color scribbles and 3D color editing results.
+Fig. 6. Comparison with EditNeRF. Our model (bottom) achieves comparable editing performance with EditNeRF [34] (top). We provide three color edits on 2D views (odd columns), each followed by the 3D editing result (even columns).
+
+a quantitative evaluation, we select 10 shapes per category (including airplanes and chairs) and edit the surface color to make it visually similar to reference shapes with same geometry yet different surface color. The editing quality is measured by the similarity between the renderings of the edited 3D shapes and the reference shapes. Tab. 3 reports the PSNR and LPIPS [58] metrics of the evaluation. The surface color of 3D shapes is much closer to the reference after editing, compared to the initial shapes, suggesting the effectiveness of our MM-VAD model in editing color via scribbles.
+
+A similar task has recently been explored in EditNeRF [34]. However, an apple-to/apple comparison with EditNeRF is not possible due to the intrinsically different 3D representations (NeRF [36] vs SDFs [38]). Moreover, the proposed MM-VADs are generative models while EditNeRF is non-generative; The MMVADs bridge 2D and 3D via shared latent spaces while EditNeRF relies on differentiable rendering. We present more detailed comparisons in the supplementary material. We provide qualitative comparisons with EditNeRF on chairs with similar structures using their pre-trained models. Fig. 6 shows that the color editing from MM-VADs is on par with EditNeRF. The MM-VADs achieve the editing via simple latent optimization (Eqn. 12), while EditNeRF requires updating the network weights per instance and fails to generate meaningful color editing results via optimizing the color code alone. Furthermore, MM-VADs take 0.06 seconds per edit and 6.78 seconds to render our 3D shapes into $256 \times 256$ RGB images, while EditNeRF takes over a minute per edit including rendering.
+
+Table 3. Quantitative results of editing 3D via 2D scribbles. We edit the surface color of 3D shape based on reference shapes, and report the similarity between the editing results and the target (bottom row). As a reference, we also report the metrics before editing (top row).
+
+| Methods | Airplane | Chair |
| PSNR ↑ | LPIPS ↓ | PSNR ↑ | LPIPS ↓ |
| Initial | 19.84 | 0.23 | 16.20 | 0.33 |
| Edited | 26.41 | 0.13 | 22.08 | 0.20 |
+
+
+(a) Robustness to domain shift
+
+
+(b) 3D reconstruction with full or partial 2D inputs
+Fig. 7. (a) Robustness to domain shift. We report the Chamfer distance (lower is better) between 3D reconstructions and the groundtruth under different ratios of image occlusion. (b) 3D reconstruction with full or partial 2D inputs. When the full views are available, our model produces consistent 3D reconstruction in different trials. When only partial views are given, our model produces multiple different 3D reconstructions. In comparison, the encoder-decoder networks [20] trained on full-view sketches are not robust to the domain shift induced by occlusion and unable to provide multiple 3D shapes given partial views. Notice that the predictions of surface color is not available in the encoder-decoder networks from the prior work [20].
+
+# 4.2 Cross-Modal Shape Generation
+
+Single-View and Partial-View Shape Reconstruction. Fig. 7 compares the performance of our model and the encoder-decoder networks [20] under different occlusion ratios in the lower part of the objects in 2D views. The proposed model only has a slight performance drop as the occluded parts increase (Fig. 7a), mainly because of the ambiguity of 3D reconstruction given partial views. In fact, our reconstructions result in the partial views quite well. Even though our model performs slightly worse than the encoder-decoder networks on full-view inputs, the proposed model is more robust to the input domain shift. This is because compared to task-specific training, our model achieves a better trade-off between reconstruction accuracy and domain generalization. More interestingly, our model can achieve diverse and reasonable 3D reconstruction by sampling different initialization for latent optimization (Fig. 7b).
+
+Few-Shot Shape Generation. The proposed method is able to adapt the pre-trained multi-modal generative model with as few as 10 training samples of a specific 2D modality. Fig. 8 presents some of the few-shot cross-modal shape
+
+
+Fig. 8. Few-shot cross-modal shape generation. (a) presents random 3D samples from our model before the adaptation. Given a few 2D exemplars of a certain category (e.g., armchair), our model can be adapted to generate corresponding 3D shapes (b-d).
+
+Table 4. Quantitative results of few-shot cross-modal shape generation. We report Frechet Inception Distance (FID) (lower is better) and classification error (Cls. Err) (lower is better). We effectively adapt the pretrained multi-modal VAD model using a few 2D images to a desired 3D shape generator. As a reference, we report the metrics before the few-shot adaptation (top row).
+
+| Stage | Metrics | Arm | Side | Red | Avg. |
| Init. | FID ↓ | 138.1 | 95.2 | 93.7 | 109.0 |
| Cls.Err. ↓ | 0.79 | 0.64 | 0.82 | 0.75 |
| Adapt. | FID ↓ | 130.4 | 92.4 | 93.0 | 105.3 |
| Cls.Err. ↓ | 0.01 | 0.10 | 0.00 | 0.04 |
+
+generation results. To quantitatively evaluate the few-shot shape generation performance, we render the 3D shapes into 2D RGB images and report the Frechet Inception Distance (FID) scores [23] between the rendered images and the ground-truth samples. Since the FID score is not sensitive to the semantic difference between two image sets, we also report the classification error on the random samples from the model before and after the adaptation. Specifically, we train a binary image classifier to identify the target image categories (e.g., armchairs vs. other chairs), and we run the trained classifier on the 2D renderings of the 3D samples before and after the adaptation. As presented in Tab. 4, our pre-trained generative model can be effectively adapted to a certain shape subspace given as few as 10 2D examples. This capability allows us to agilely adapt our generative model to a subspace defined by a few unlabelled samples, so that users can easily narrow down the target shape during the manipulation by providing a few samples of a common attribute, such as a specific category, style, or color. We are unaware of any prior works that can tackle this task in the literature. The 2D examples used to adapt the pre-trained generative model are provided in our supplementary materials.
+
+Shape and Color Transfer. Transferring shape and color across different 3D instances can be achieved by simply swapping the latent codes. Fig. 9 shows that the shape and color are well disentangled in the proposed generative model. The
+
+
+Fig.9. Shape and color transfer. The reference 3D shapes (top row) provide the shape codes or color codes for each source instances (first column).
+
+
+Fig. 10. Our model enables consecutive 3D reconstruction and manipulation given a hand-drawn sketch.
+
+
+
+transfer results also are semantically meaningful, i.e., the color is only transferred across the same semantic parts (e.g., seats for the chair, wings for the airplane) even though the geometry of the source and target instances are quite different.
+
+# 4.3 Case Study on Real Images
+
+The workflow of 3D designers usually starts by drawing a 2D sketch to portray the coarse 3D geometry and then colorizes the sketch to depict the 3D appearance. These 2D arts are used as a reference to build 3D objects. Undoubtedly this procedure requires extensive human efforts and expertise. Such tasks can be automated with our MM-VADs. As shown in Fig. 10, we first reconstruct the 3D shape from a hand-drawn sketch. We then assign a surface color by randomly sampling a color code from the latent space of the MM-VADs, which can be easily edited by drawing color scribbles on the surface. Our model does not require any re-training on each of these steps and provides a tool to conduct shape generation and color editing consecutively. Such a task is infeasible with the existing works that train an encoder-decoder network to predict 3D shape from sketch [20].
+
+# 5 Discussion
+
+We propose a multi-modal generative model which bridges multiple 2D and 3D modalities through a shared latent space. One limitation of the proposed method is that we are only able to provide editing results in the prior distribution of our generative model (see supplementary material for more details). Despite this limitation, our model has enabled versatile cross-modal 3D generation and manipulation tasks without the need of re-training per task and demonstrates strong robustness to input domain shift.
+
+Acknowledgements. Subhransu Maji acknowledges support from NSF grants #1749833 and #1908669. Our experiments were partially performed on the University of Massachusetts GPU cluster funded by the Mass. Technology Collaborative.
+
+# References
+
+1. Abdal, R., Qin, Y., Wonka, P.: Image2stylegan: How to embed images into the stylegan latent space? In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4432-4441 (2019) 3
+2. An, X., Tong, X., Denning, J.D., Pellacini, F.: Appwarp: Retargeting measured materials by appearance-space warping. In: Proceedings of the 2011 SIGGRAPH Asia Conference. pp. 1-10 (2011) 1, 3
+3. Athar, S., Burnaev, E., Lempitsky, V.: Latent convolutional models. In: ICLR (2018) 7
+4. Bau, D., Liu, S., Wang, T., Zhu, J.Y., Torralba, A.: Rewriting a deep generative model. In: eccv. pp. 351-369. Springer (2020) 3
+5. Bau, D., Strobelt, H., Peebles, W., Zhou, B., Zhu, J.Y., Torralba, A., et al.: Semantic photo manipulation with a generative image prior. arXiv preprint arXiv:2005.07727 (2020) 3
+6. Burt, P.J., Adelson, E.H.: The laplacian pyramid as a compact image code. In: Readings in computer vision, pp. 671-679. Elsevier (1987) 7
+7. Chang, A.X., Funkhouser, T., Guibas, L., Hanrahan, P., Huang, Q., Li, Z., Savarese, S., Savva, M., Song, S., Su, H., et al.: Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012 (2015) 9
+8. Chen, K., Choy, C.B., Savva, M., Chang, A.X., Funkhouser, T., Savarese, S.: Text2shape: Generating shapes from natural language by learning joint embeddings. In: ACCV. pp. 100-116. Springer (2018) 3
+9. Chen, Z., Zhang, H.: Learning implicit fields for generative shape modeling. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5939-5948 (2019) 1, 3
+0. Choi, Y., Choi, M., Kim, M., Ha, J.W., Kim, S., Choo, J.: 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) 3
+1. Choy, C.B., Xu, D., Gwak, J., Chen, K., Savarese, S.: 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In: European conference on computer vision. pp. 628-644. Springer (2016) 3
+2. DeCarlo, D., Finkelstein, A., Rusinkiewicz, S., Santella, A.: Suggestive contours for conveying shape. In: ACM SIGGRAPH 2003 Papers, pp. 848-855 (2003) 9
+3. Delanoy, J., Aubry, M., Isola, P., Efros, A.A., Bousseau, A.: 3d sketching using multi-view deep volumetric prediction. Proceedings of the ACM on Computer Graphics and Interactive Techniques 1(1), 1-22 (2018) 1, 3
+4. Fan, H., Su, H., Guibas, L.J.: A point set generation network for 3d object reconstruction from a single image. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 605-613 (2017) 3
+5. Gkioxari, G., Malik, J., Johnson, J.: Mesh r-cnn. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9785-9795 (2019) 3
+6. Goel, S., Kanazawa, A., Malik, J.: Shape and viewpoint without keypoints. In: European Conference on Computer Vision. pp. 88-104. Springer (2020) 3
+7. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. Advances in neural information processing systems 27 (2014) 3
+8. Grady, L.: Random walks for image segmentation. IEEE transactions on pattern analysis and machine intelligence 28(11), 1768-1783 (2006) 3
+
+19. Gu, J., Shen, Y., Zhou, B.: Image processing using multi-code gan prior. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 3012-3021 (2020) 3
+20. Guillard, B., Remelli, E., Yvernay, P., Fua, P.: Sketch2mesh: Reconstructing and editing 3d shapes from sketches. In: ICCV (2021) 1, 3, 4, 8, 9, 10, 12, 14
+21. Gulrajani, I., Ahmed, F., Arjovsky, M., Dumoulin, V., Courville, A.: Improved training of wasserstein gans. In: NeurIPS (2017) 8
+22. Hao, Z., Averbuch-Elor, H., Snavely, N., Belongie, S.: Dualsdf: Semantic shape manipulation using a two-level representation. In: CVPR. pp. 7631-7641 (2020) 3, 4, 7, 10
+23. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems 30 (2017) 13
+24. Jin, A., Fu, Q., Deng, Z.: Contour-based 3d modeling through joint embedding of shapes and contours. In: Symposium on Interactive 3D Graphics and Games. pp. 1-10 (2020) 3
+25. Kanazawa, A., Tulsiani, S., Efros, A.A., Malik, J.: Learning category-specific mesh reconstruction from image collections. In: Proceedings of the European Conference on Computer Vision (ECCV). pp. 371-386 (2018) 3
+26. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014) 9
+27. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114 (2013) 3, 4
+28. Lempitsky, V., Kohli, P., Rother, C., Sharp, T.: Image segmentation with a bounding box prior. In: 2009 IEEE 12th international conference on computer vision. pp. 277-284. IEEE (2009) 3
+29. Levin, A., Lischinski, D., Weiss, Y.: Colorization using optimization. In: ACM SIGGRAPH 2004 Papers, pp. 689-694 (2004) 3
+30. Li, Y., Sun, J., Tang, C.K., Shum, H.Y.: Lazy snapping. ACM Transactions on Graphics (ToG) 23(3), 303-308 (2004) 3
+31. Liu, M.Y., Tuzel, O.: Coupled generative adversarial networks. Advances in neural information processing systems 29, 469-477 (2016) 3
+32. Liu, S., Zhang, Y., Peng, S., Shi, B., Pollefeys, M., Cui, Z.: Dist: Rendering deep implicit signed distance function with differentiable sphere tracing. In: CVPR. pp. 2019-2028 (2020) 8
+33. Liu, S., Li, T., Chen, W., Li, H.: Soft rasterizer: A differentiable renderer for image-based 3d reasoning. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 7708-7717 (2019) 3
+34. Liu, S., Zhang, X., Zhang, Z., Zhang, R., Zhu, J.Y., Russell, B.: Editing conditional radiance fields. In: ICCV (2021) 1, 3, 4, 9, 10, 11
+35. Mescheder, L., Oechsle, M., Niemeyer, M., Nowozin, S., Geiger, A.: Occupancy networks: Learning 3d reconstruction in function space. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4460-4470 (2019) 1, 3, 6
+36. Mildenhall, B., Srinivasan, P.P., Tancik, M., Barron, J.T., Ramamoorthi, R., Ng, R.: Nerf: Representing scenes as neural radiance fields for view synthesis. In: European conference on computer vision. pp. 405-421. Springer (2020) 3, 4, 11
+37. Pan, X., Zhan, X., Dai, B., Lin, D., Loy, C.C., Luo, P.: Exploiting deep generative prior for versatile image restoration and manipulation. In: European Conference on Computer Vision. pp. 262-277. Springer (2020) 3
+
+38. Park, J.J., Florence, P., Straub, J., Newcombe, R., Lovegrove, S.: Deepsdf: Learning continuous signed distance functions for shape representation. In: CVPR. pp. 165-174 (2019) 1, 3, 6, 9, 11
+39. Pellacini, F., Battaglia, F., Morley, R.K., Finkelstein, A.: Lighting with paint. ACM Transactions on Graphics (TOG) 26(2), 9-es (2007) 1, 3
+40. Radford, A., Metz, L., Chintala, S.: Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434 (2015) 6
+41. Rother, C., Kolmogorov, V., Blake, A.: "grabcut" interactive foreground extraction using iterated graph cuts. ACM transactions on graphics (TOG) 23(3), 309-314 (2004) 3
+42. Sahara, C., Chan, W., Chang, H., Lee, C.A., Ho, J., Salimans, T., Fleet, D.J., Norouzi, M.: Palette: Image-to-image diffusion models. arXiv preprint arXiv:2111.05826 (2021) 3
+43. Schmidt, T.W., Pellacini, F., Nowrouzezahrai, D., Jarosz, W., Dachsbacher, C.: State of the art in artistic editing of appearance, lighting and material. In: Computer Graphics Forum. vol. 35, pp. 216-233. Wiley Online Library (2016) 1, 3
+44. Shen, Y., Gu, J., Tang, X., Zhou, B.: Interpreting the latent space of gans for semantic face editing. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9243-9252 (2020) 3
+45. Shen, Y., Yang, C., Tang, X., Zhou, B.: Interfacegan: Interpreting the disentangled face representation learned by gans. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020) 3
+46. Shi, Y., Siddharth, N., Paige, B., Torr, P.H.: Variational mixture-of-experts autoencoders for multi-modal deep generative models. arXiv preprint arXiv:1911.03393 (2019) 3
+47. Sitzmann, V., Zollhöfer, M., Wetzstein, G.: Scene representation networks: Continuous 3d-structure-aware neural scene representations. arXiv preprint arXiv:1906.01618 (2019) 1, 3, 6
+48. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., Ganguli, S.: Deep unsupervised learning using nonequilibrium thermodynamics. In: ICML. pp. 2256-2265. PMLR (2015) 3
+49. Suzuki, M., Nakayama, K., Matsuo, Y.: Joint multimodal learning with deep generative models. arXiv preprint arXiv:1611.01891 (2016) 3
+50. Tatarchenko, M., Richter, S.R., Ranftl, R., Li, Z., Koltun, V., Brox, T.: What do single-view 3d reconstruction networks learn? In: CVPR. pp. 3405-3414 (2019) 8
+51. Wang, N., Zhang, Y., Li, Z., Fu, Y., Liu, W., Jiang, Y.G.: Pixel2mesh: Generating 3d mesh models from single rgb images. In: ECCV. pp. 52-67 (2018) 3
+52. Wang, Y., Gonzalez-Garcia, A., Berga, D., Herranz, L., Khan, F.S., Weijer, J.v.d.: Minegan: effective knowledge transfer from gans to target domains with few images. In: CVPR. pp. 9332-9341 (2020) 8
+53. Wu, M., Goodman, N.: Multimodal generative models for scalable weakly-supervised learning. Advances in Neural Information Processing Systems 31 (2018) 3
+54. Wu, M., Goodman, N.: Multimodal generative models for compositional representation learning. arXiv preprint arXiv:1912.05075 (2019) 3
+55. Xu, Q., Wang, W., Ceylan, D., Mech, R., Neumann, U.: Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. arXiv preprint arXiv:1905.10711 (2019) 3
+56. Yang, G., Sun, D., Jampani, V., Vlasic, D., Cole, F., Chang, H., Ramanan, D., Freeman, W.T., Liu, C.: Lasr: Learning articulated shape reconstruction from
+
+a monocular video. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 15980-15989 (2021) 3
+57. Zadeh, A., Lim, Y.C., Liang, P.P., Morency, L.P.: Variational auto-decoder: A method for neural generative modeling from incomplete data. arXiv preprint arXiv:1903.00840 (2019) 3, 4, 5, 8
+58. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR (2018) 11
+59. Zhang, R., Zhu, J.Y., Isola, P., Geng, X., Lin, A.S., Yu, T., Efros, A.A.: Real-time user-guided image colorization with learned deep priors. ACM Transactions on Graphics (TOG) 9(4) (2017) 3
+60. Zhang, S.H., Guo, Y.C., Gu, Q.W.: Sketch2model: View-aware 3d modeling from single free-hand sketches. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6012-6021 (2021) 3
+61. Zhong, Y., Gryaditskaya, Y., Zhang, H., Song, Y.Z.: Deep sketch-based modeling: Tips and tricks. In: 2020 International Conference on 3D Vision (3DV). pp. 543-552. IEEE (2020) 3
+62. Zhu, J., Shen, Y., Zhao, D., Zhou, B.: In-domain gan inversion for real image editing. In: ECCV. pp. 592-608. Springer (2020) 3
\ No newline at end of file
diff --git a/crossmodal3dshapegenerationandmanipulation/images.zip b/crossmodal3dshapegenerationandmanipulation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..54e1be79cc713f27aae8fdc170e34c0707ad1ab2
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e7bc939faf6ff85ae2e772d80f54f6810640f88b1538a67f27017348da2c167
+size 408096
diff --git a/crossmodal3dshapegenerationandmanipulation/layout.json b/crossmodal3dshapegenerationandmanipulation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..3a46cce910ef75c6b443d7c4773af8c2fd50d21e
--- /dev/null
+++ b/crossmodal3dshapegenerationandmanipulation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae5da12f792cc1ae93c8bbfe6753d9bda466d50375fe2334bfc7a4b62d27ee0a
+size 484630
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_content_list.json b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..00ae4193bd7b8bdd3c1be838e58dd398927ff489
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c68db0c520c1c38598c1579700aaee6a54cb8809c80b563fd19bd8c67daf8c3
+size 81558
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_model.json b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4fe2d0d106447e39acbc331e545818e5bd5a97c7
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:213b4b6649f3a6470d2808fb652ad747c5526ce68b5f449b91ad3dd65d2f5146
+size 103734
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_origin.pdf b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8c45deee1fedcea584e8415075ba2527672ebbf6
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/aa0f000e-4858-46f8-ad81-3d1478fd6d76_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3bf42de866b9c20fd7180985b8713b5f2b4c316fbbba83c44f28f2bcbaf20647
+size 8692425
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/full.md b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c97db0a93f950c32d7a8e3516e5e8e5163f10264
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/full.md
@@ -0,0 +1,322 @@
+# Cross-Modality Knowledge Distillation Network for Monocular 3D Object Detection
+
+Yu Hong $^{1}$ , Hang Dai $^{2*}$ , and Yong Ding $^{1*}$
+
+1 Zhejiang University, Zhejiang, China
+
+$^{2}$ MBZUAI, Abu Dhabi, UAE
+
+yuhong_1999@zju.edu.cn hang.dai@mbzuai.ac.ae dingy@vlsi.zju.edu.cn
+
+* Corresponding authors.
+
+Abstract. Leveraging LiDAR-based detectors or real LiDAR point data to guide monocular 3D detection has brought significant improvement, e.g., Pseudo-LiDAR methods. However, the existing methods usually apply non-end-to-end training strategies and insufficiently leverage the LiDAR information, where the rich potential of the LiDAR data has not been well exploited. In this paper, we propose the Cross-Modality Knowledge Distillation (CMKD) network for monocular 3D detection to efficiently and directly transfer the knowledge from LiDAR modality to image modality on both features and responses. Moreover, we further extend CMKD as a semi-supervised training framework by distilling knowledge from large-scale unlabeled data and significantly boost the performance. Until submission, CMKD ranks $1^{st}$ among the monocular 3D detectors with publications on both KITTI test set and Waymo val set with significant performance gains compared to previous state-of-the-art methods. Our code will be released at https://github.com/Cc-Hy/CMKD.
+
+# 1 Introduction
+
+Detecting objects in 3D space is crucial to a wide range of applications, such as augmented reality, robotics and autonomous driving. The 3D detectors are to generate 3D bounding boxes with size, location, orientation and category parameters to localize and classify the detected objects, enabling the system to perceive and understand the surrounding environment. In autonomous driving [16, 12, 2], 3D object detectors can be categorized into LiDAR point cloud based [9, 52, 53], stereo image based [32, 26, 56], monocular image based [22, 54, 49, 39] and multi-modality based methods [23, 43] according to the input resources. Compared with LiDAR sensors, monocular cameras have many unique advantages such as low price, colored information and dense perception, and monocular 3D object detection has become an active research area. However, there exists a large performance gap between LiDAR-based 3D detectors and monocular 3D detectors due to the lack of precise 3D information in monocular images. Thus, monocular 3D object detection is an extremely challenging task.
+
+Recently, leveraging LiDAR-based detectors or real LiDAR point data to guide monocular 3D detection has brought significant improvement. For example, Pseudo-LiDAR methods [58, 59, 41] transform the 2D images into 3D pseudo
+
+
+Fig. 1. Comparison between top-ranking monocular 3D detectors and CMKD (Ours) on KITTI leaderboard [16] for Car with 3DAP and BEVAP metrics. Higher is better.
+
+points via depth estimation networks [13, 27], and use a LiDAR-based detector [46, 24] to perform 3D detection. Many methods [58, 59, 41, 50, 44], including most of the Pseudo-LiDAR methods, use real LiDAR point data to provide accurate 3D supervision during training, e.g., projecting the LiDAR points onto the image plane for a sparse ground truth depth map for depth supervision.
+
+However, there is still room for improvement in this pattern. These methods only mimic the LiDAR data representation and extract some plain information from the LiDAR data like depth maps, but do not consider further exploiting deeper information such as high-dimensional features. To transfer the useful knowledge from the LiDAR data more efficiently and directly, we propose a novel cross-modality knowledge distillation network to mitigate the gap between the image modality and the LiDAR modality on both features and responses. Specifically, we use a LiDAR-based detector as the teacher model to provide the Bird's-Eye-View (BEV) feature map which inherits accurate 3D information from LiDAR points as the feature guidance. And we use the predictions of the teacher model with the awareness of soft label quality as the response guidance. We then transform the knowledge from the LiDAR-based teacher model to the image-based student model in both feature and response level via distillation, thus more fully exploiting the beneficial information of the LiDAR data.
+
+Additionally, the unlabeled data, e.g., raw images and LiDAR points without ground truth 3D labels, is widely used by monocular 3D detectors [58, 62, 41, 63, 44], but only for a sub-task like depth pre-training, and the potential of the unlabeled data has not been well exploited for the main detection task. To this end, we further extend CMKD as a semi-supervised training framework to technically better leverage the unlabeled data. Given a relatively small number of labeled samples to train the LiDAR-based teacher model, we can directly train CMKD on unlabeled data with the teacher model extracting beneficial information and transferring it to the student model. Unlike the existing methods who only use the unlabeled data for depth pre-training, CMKD can directly perform the multi-task training with unlabeled data in an end-to-end manner. Meanwhile, our semi-supervised training pipeline generalizes the application of CMKD in real-world scenes, where we only need to label a small portion of
+
+
+Fig. 2. Comparison between other methods and CMKD (Ours). For the LiDAR points, CMKD performs knowledge distillation by extracting features and responses from them, not only the depth maps. For the unlabeled data, CMKD can directly use it for multi-task training including feature learning and 3D detection, not only the depth pre-training sub-task.
+
+the data and can use the whole set for training, thus significantly reducing the annotation cost. We show the major difference between CMKD and the existing methods using LiDAR point information and unlabeled data in Fig. 2.
+
+We summarize our contributions in three-fold: i) We propose a novel cross-modality knowledge distillation network to directly and efficiently transfer the knowledge from LiDAR modality to image modality on both features and responses, digging deeper in cross-modality knowledge transfer and significantly improving monocular 3D detection accuracy (Fig. 1). ii) We propose to distill the unlabeled data with our CMKD framework in a semi-supervised manner. With a relatively small amount of annotated data, CMKD can be trained end-to-end on the unlabeled data, which enables it to be trained with state-of-the-art performance while significantly reducing annotation cost. iii) CMKD ranks $1^{st}$ among the monocular 3D detectors with publications on KITTI test set [16] and Waymo val set [12] with remarkable performance gains.
+
+# 2 Related Works
+
+LiDAR-based 3D Detection LiDAR-based 3D detection [52, 53, 47, 66, 30, 28, 29, 31] has been developing rapidly in recent years. LiDAR sensors capture precise 3D measurement information from the surroundings in the form of unordered 3D points $(x,y,z,\dots)$ , where $x,y,z$ are the absolute 3D coordinates of each point and the others could be additional information such as reflection intensity. Point-based methods, e.g., PointNet [47], PointNet++ [48] take the raw point clouds as input, and extract point-wise features through structures like multi-layer perceptron for 3D object detection. Voxel-based methods, e.g., VoxelNet [66], SECOND [61] extend the representation of 2D image as pixels into 3D space by dividing 3D space into voxels. Thanks to the precise 3D information provided by point clouds, LiDAR-based methods have achieved relatively high accuracy on different 3D object detection benchmarks [16, 12, 2].
+
+Pseudo-LiDAR based 3D Detection Pseudo-LiDAR based 3D detectors [58, 63, 41, 59, 6] benefit from both mimicking the LiDAR data representation and the accurate 3D information provided by the LiDAR data. These methods first transform the 2D images into intermediate 3D representations like pseudo point clouds via depth estimators [13, 27], and then perform LiDAR-based methods on them. In this work, we take advantage of the LiDAR data by extracting features and responses, thus further exploiting the potential of the LiDAR data.
+
+Leveraging Unlabeled Data Leveraging large-scale unlabeled data has been very popular among monocular 3D detectors especially for depth estimation pretraining. Pseudo-LiDAR [58] and many extension works [41, 55, 62] use an off-the-shelf depth estimator like DORN [13] that is well-trained on the unlabeled KITTI Raw for depth estimation. DD3D [44] leverages extra super-large scale unlabeled data DDAD15M for depth pre-training which leads to significant performance improvements for monocular 3D detection. A major improvement is that CMKD can directly use the unlabeled data to perform multi-task training in an end-to-end manner, not only the depth pre-training sub-task.
+
+Knowledge Distillation The standard knowledge distillation [37, 20, 21, 14, 60, 8] is performed between different models on the same modality. Usually, a well-trained heavy teacher model is applied on the input to obtain informative representations and then supervise the features or the output logits of a simple student model, compressing the model yet maintaining high accuracy. In this work, we use the cross-modality knowledge distillation between the LiDAR modality and monocular image modality for monocular 3D detection.
+
+Difference between CMKD and Similar Methods The general idea of knowledge distillation has been explored by some existing works, and we explain the difference. LIGA-Stereo [18] focuses on the feature distillation only, and it is proposed for the stereo 3D detection task. MonoDistill [7] converts the representation of LiDAR modality to image modality, while CMKD converts the representation of image modality to LiDAR modality. LPCG [45] uses a LiDAR-based detector to generate pseudo labels without considering the intermediate high-dimensional features. Moreover, LPCG applies a one-size-fits-all method to use the soft labels, while we further take the soft label quality into account and use the quality-aware confidence scores to adaptively penalize the contribution of each soft label. DA-3d [62] applies non-end-to-end training strategies with fixed 2D detector and depth estimator, and only the trainable feature extractor is optimized for the feature distillation. But the monocular detector in CMKD is fully differentiable and can be trained end-to-end with all components jointly optimized. Overall, CMKD jointly uses feature and response distillation for the monocular 3D detection task in an end-to-end manner. With the novel design of using totally soft guidance, CMKD can further handle large-scale unlabeled data which is easy to collect for autonomous driving cars, extending its application in real-world scenarios and boosting the performance. Apart from the general idea of knowledge distillation, CMKD is also different in the way to perform distillation with novel explorations in each distillation module, achieving new state-of-the-art performance on KITTI and Waymo benchmarks.
+
+
+Fig. 3. Overview of the cross-modality knowledge distillation (CMKD) network for monocular 3D detection. (a) A pre-trained LiDAR-based 3D detector as the teacher model that extracts beneficial information from the LiDAR point data as soft guidance. (b) A trainable monocular 3D detector as the student model with the feature-based and response-based knowledge distillation.
+
+# 3 Method
+
+# 3.1 Framework Overview
+
+Fig. 3 illustrates the overview of the cross-modality knowledge distillation network for monocular 3D object detection. The general idea is simple and straightforward. The key is to extract the same type of feature and response representations from both input LiDAR points and input monocular images, and perform knowledge distillation between the two modalities. Our framework includes a pre-trained LiDAR-based 3D detector as the teacher model, which extracts information from LiDAR points as soft guidance in the training stage, a trainable monocular 3D detector as the student model, and the cross-modality knowledge distillation on both features and responses.
+
+Training. In the training stage, we take the monocular image and the corresponding LiDAR points as the input pair. The pre-trained teacher model is inferred only from input LiDAR points to provide the BEV feature maps that inherit accurate 3D information from LiDAR points as the feature guidance, and the predictions with 3D bounding boxes, object classes and their corresponding confidence scores as the response guidance. The student model is trainable to generate BEV feature maps and 3D object detection results from monocular images, and uses the soft guidance in both feature level and response level from the teacher model for useful knowledge transfer.
+
+Inference. In the inference stage, we use the student model alone to perform 3D object detection with monocular images as input only.
+
+
+Fig.4. BEV feature map generation. (a) The LiDAR-based branch. (b) The image-based branch.
+
+# 3.2 BEV Feature Learning
+
+LiDAR-based. We use SECOND [61], a simple LiDAR-based baseline as the teacher model to extract the BEV features from LiDAR points. The input points are subdivided into 3D voxels, which are fed to a voxel backbone to extract voxel features $F_{L}^{v} \in \mathbb{R}^{X \times Y \times Z \times C}$ , where $X, Y, Z$ are the width, length and height of the voxel feature volume, and $C$ is the number of feature channels. Then, the voxel features $F_{L}^{v}$ are collapsed to a LiDAR BEV feature map with features $F_{L}^{bev} \in \mathbb{R}^{X \times Y \times Z * C}$ by stacking the height dimension. When pre-training the teacher model, we use Intersection over Unions (IoUs) as the continuous quality labels with the Quality Focal Loss [33] instead of the original one-hot labels in the classification head. Thus, the predicted confidence scores are more IoU-aware to represent the 'quality' of the predictions.
+
+Image-based. For the image-based model, we use the architecture in CaDDN [50] to obtain the BEV features from the monocular image $I \in \mathbb{R}^{W \times H \times 3}$ . We use an image backbone, e.g., ResNet [19] to extract image features $\hat{F}_I \in \mathbb{R}^{W_I \times H_I \times C}$ , and a depth distribution estimation network, e.g., DeepLabV3 [4] to predict the pixel-wise depth distribution $D_{depth} \in \mathbb{R}^{W_I \times H_I \times D}$ . We use the image features together with the estimated depth distributions to construct a frustum grid $G$ with features $F_G \in \mathbb{R}^{W_I \times H_I \times D \times C}$ , where $D$ is the number of discrete depth bins, and $C$ is the number of the feature channels. Then, the frustum volume is converted to a cuboid volume in LiDAR coordinate via interpolation operation with known calibration parameters, and we obtain the image voxel features $F_I^v \in \mathbb{R}^{X_I \times Y_I \times Z_I \times C}$ . The voxel features are collapsed to a BEV feature map with features $\tilde{F}_I^{bev} \in \mathbb{R}^{X_I \times Y_I \times Z_I * C}$ , which then goes through a channel compression network to obtain the image BEV feature map with features $F_I^{bev} \in \mathbb{R}^{X_I \times Y_I \times C}$ .
+
+We visualize the BEV feature map generation process in Fig. 4. More details can be found in the Supplementary Materials.
+
+
+
+
+BEVImage
+
+
+
+
++Lfeat
+
+
+
+
++Lfeat +DA
+Fig. 5. Illustration of BEV feature maps: the initial BEV feature map from image $(1^{st}$ column), with feature distillation loss $\mathcal{L}_{feat}$ ( $2^{nd}$ column), with $\mathcal{L}_{feat}$ and DA module ( $3^{rd}$ column), and the corresponding LiDAR BEV feature map ( $4^{th}$ column).
+
+
+
+
+$BEV_{LiDAR}$
+
+# 3.3 Domain Adaptation via Self-Calibration
+
+The image BEV features $F_{I}^{bev}$ are different from LiDAR BEV features $F_{L}^{bev}$ in spatial-wise and channel-wise feature distribution due to the fact that they come from different input modalities with different backbones. We employ a domain adaptation (DA) module to align the feature distribution of $F_{I}^{bev}$ to that of $F_{L}^{bev}$ and enhance $F_{I}^{bev}$ at the meantime. Specifically, we stack five Self-Calibrated Blocks [36] after $F_{I}^{bev}$ to apply spatial-wise and channel-wise transformations:
+
+$$
+\hat {F} _ {I} ^ {b e v} = D A \left(F _ {I} ^ {b e v}\right) \tag {1}
+$$
+
+where $\hat{F}_I^{bev} \in \mathbb{R}^{X_I \times Y_I \times C}$ are the enhanced BEV features after the DA module. More details can be found in the Supplementary Materials.
+
+# 3.4 Feature-based Knowledge Distillation
+
+We use the BEV features $F_{L}^{bev}$ from LiDAR points as the intermediate high-dimensional feature distillation guidance for $\hat{F}_I^{bev}$ . We use the mean square error (MSE) to calculate the feature distillation loss:
+
+$$
+\mathcal {L} _ {\text {f e a t}} = M S E \left(\hat {F} _ {I} ^ {\text {b e v}}, F _ {L} ^ {\text {b e v}}\right) \tag {2}
+$$
+
+Our monocular 3D detector benefits from the feature-based knowledge distillation due to the following aspects. Firstly, $F_{L}^{bev}$ contains accurate 3D information directly extracted from LiDAR points, e.g., depth and geometry. And the feature representation of $F_{L}^{bev}$ is well-trained for 3D object detection from point clouds which is more robust to diverse scenarios such as low-light condition and weather changing. We can distill such patterns from $F_{L}^{bev}$ and transfer them to $\hat{F}_{I}^{bev}$ . As shown in Fig. 5, after feature-based knowledge distillation with the proposed DA module, the object features are highlighted and the patterns of the image BEV features are close to the LiDAR BEV features, which are the
+
+
+(a)
+
+
+(b)
+Fig. 6. (a) The IoU confidence scores of soft labels are trained to be positively correlated with the ground truth IoUs. (b) We use the IoU confidence score of the soft label box to indicate its 'quality' and weight the loss $\mathcal{L}_{reg} / \mathcal{L}_{cls}$ in response distillation.
+
+key information to detect 3D objects. Besides, an intermediate feature guidance can ease the condition of over-fitting with high-dimensional information as the regularization term in the overall loss function [51, 17].
+
+# 3.5 Response-based Knowledge Distillation
+
+The predictions of the teacher model are in form of $(x,y,z,h,w,l,\theta ,c,s)$ , where $(x,y,z)$ is the center of the 3D bounding box, $(h,w,l)$ is the size of the 3D bounding box, $\theta$ is the rotation angle, $c$ is the predicted category and $s$ is the confidence score. And we use the predictions as the response guidance for the student model. Compared with the hard labels, the soft labels contain more information per training sample [20, 65]. Moreover, the teacher model can act as a sample filter for the training samples, e.g., samples which are very difficult to detect for the teacher model tend to be eliminated or assigned with low confidence scores, and the stable samples are assigned with high confidence scores.
+
+Quality-aware Distillation. The loss for response-based distillation includes the regression loss $\mathcal{L}_{reg}$ for 3D bounding boxes and the classification loss $\mathcal{L}_{cls}$ for object classes following the teacher model [61]:
+
+$$
+\mathcal {L} _ {r e s} = \mathcal {L} _ {r e g} + \mathcal {L} _ {c l s} \tag {3}
+$$
+
+For the $i$ -th anchor, we use the Smooth L1 loss as the regression loss which is penalized by the IoU confidence score of the soft label:
+
+$$
+\mathcal {L} _ {r e g} = S m o o t h L 1 \left(a _ {i} ^ {s o f t}, a _ {i} ^ {p r e d}\right) \times s _ {i} \tag {4}
+$$
+
+where $a_{i}^{soft}$ and $a_{i}^{pred}$ are the bounding box parameters of the soft label and the prediction, and $s_i$ is the IoU confidence score of the soft label box predicted by the teacher model to indicate its 'quality'. Similarly, we use the Quality Focal Loss (QFL) [33] that is penalized by $s_i$ for classification:
+
+$$
+\mathcal {L} _ {c l s} = Q F L \left(C _ {i} ^ {s o f t}, C _ {i} ^ {p r e d}\right) \times s _ {i} \tag {5}
+$$
+
+where $C_i^{soft}$ and $C_i^{pred}$ are the classification parameters of the soft label and the prediction. As shown in Fig. 6, the IoU confidence scores of the soft labels are trained to be positively correlated with their ground truth IoUs, which serve to weight the loss produced by each prediction of the student model. Thus, our quality-aware distillation can provide more meaningful and flexible guidance.
+
+# 3.6 Loss Function
+
+Teacher Model. We train the teacher model with the regression loss $\mathcal{L}_{reg}$ and the classification loss $\mathcal{L}_{cls}$ inherited from SECOND [61] except for replacing the Focal Loss [34] with the Quality Focal Loss [33]:
+
+$$
+\mathcal {L} _ {\text {t e a c h e r}} = \mathcal {L} _ {\text {r e g}} + \mathcal {L} _ {\text {c l s}} \tag {6}
+$$
+
+Backbone Pre-training. As with other methods discussed in this paper, we use the depth pre-trained backbone to make the network depth-aware, also, we initialize the backbone with the weights pre-trained on COCO [35] before pretraining. We inherit the depth loss from CaDDN [50] for backbone pre-training:
+
+$$
+\mathcal {L} _ {p r e} = \mathcal {L} _ {d e p t h} \tag {7}
+$$
+
+Student Model. The loss function for the student model is defined as the combination of the feature-based and the response-based distillation loss:
+
+$$
+\mathcal {L} _ {\text {s t u d e n t}} = \mathcal {L} _ {\text {f e a t}} + \mathcal {L} _ {\text {r e s}} \tag {8}
+$$
+
+# 3.7 Extension: Distilling Unlabeled Data
+
+After the teacher model is pre-trained with the labeled samples, every loss term in the overall loss function for the student model $\mathcal{L}_{student}$ in Eq. (8) does not use any information from manual hard labels. Thus, we can easily and naturally extend CMKD as a semi-supervised training framework with large-scale unlabeled data that is easy to collect for autonomous driving cars. With the teacher model extracting beneficial information and transferring it to the student model as the soft guidance, we can use the partial labeled samples and train the model with the whole unlabeled set. This extended ability of CMKD to handle unlabeled data significantly reduces the annotation cost and brings performance improvements, which generalizes the application of CMKD in real-world scenarios.
+
+Note that, the utilization of unlabeled data is not new for monocular 3D detection task, especially for Pseudo-LiDAR methods. Our contribution is to improve the utilization of unlabeled data with our cross-modality knowledge distillation network. The main difference is that other methods use unlabeled data only for the depth pre-training, a sub-task, but we further use it for knowledge distillation with all components of the network jointly optimized.
+
+Table 1. Results for Car on KITTI test set. The best results are in bold and the second best results are underlined. We present the results for two experimental setups, CMKD and $\mathrm{CMKD^{*}}$ . CMKD is trained with the official training set KITTI trainval ( $\sim 7.5k$ ) and $\mathrm{CMKD^{*}}$ is trained with the unlabeled KITTI Raw ( $\sim 42k$ ).
+
+| Methods | Reference | 3D AP | BEV AP |
| Easy | Moderate | Hard | Average | Easy | Moderate | Hard | Average |
| M3D-PRN [1] | ICCV 2019 | 14.76 | 9.71 | 7.42 | 10.63 | 21.02 | 13.67 | 10.23 | 14.97 |
| AM3D [41] | ICCV 2019 | 16.50 | 10.74 | 9.52 | 12.25 | 25.03 | 17.32 | 14.91 | 19.08 |
| PatchNet [40] | ECCV 2020 | 15.68 | 11.12 | 10.17 | 12.32 | 22.97 | 16.86 | 14.97 | 18.27 |
| DA-3d [62] | ECCV2020 | 16.80 | 11.50 | 8.90 | 12.40 | - | - | - | - |
| D4LCN [10] | CVPR 2020 | 16.65 | 11.72 | 9.51 | 12.63 | 22.51 | 16.02 | 12.55 | 17.03 |
| Monodle [42] | CVPR 2021 | 17.23 | 12.26 | 10.29 | 13.26 | 24.79 | 18.89 | 16.00 | 19.89 |
| MonoRUn [3] | CVPR 2021 | 19.65 | 12.30 | 10.58 | 14.18 | 27.94 | 17.34 | 15.24 | 20.17 |
| MonoRCNN [54] | ICCV 2021 | 18.36 | 12.65 | 10.03 | 13.68 | 25.48 | 18.11 | 14.10 | 19.23 |
| PCT [57] | NIPS 2021 | 21.00 | 13.37 | 11.31 | 15.23 | 29.65 | 19.03 | 15.92 | 21.53 |
| DFR-Net [67] | ICCV 2021 | 19.40 | 13.63 | 10.35 | 14.46 | 28.17 | 19.17 | 14.84 | 20.73 |
| CaDDN [50] | CVPR 2021 | 19.17 | 13.41 | 11.46 | 14.68 | 27.94 | 18.91 | 17.19 | 21.35 |
| GUPNet [38] | ICCV 2021 | 22.26 | 15.02 | 13.12 | 16.80 | 30.29 | 21.19 | 18.20 | 23.23 |
| DD3D [44] | ICCV 2021 | 23.22 | 16.34 | 14.20 | 17.92 | 30.98 | 22.56 | 20.03 | 24.52 |
| CMKD | - | 25.09 | 16.99 | 15.30 | 19.13 | 33.69 | 23.10 | 20.67 | 25.82 |
| Improvement | - | +1.87 | +0.65 | +1.10 | +1.21 | +2.71 | +0.54 | +0.64 | +1.30 |
| CMKD* | - | 28.55 | 18.69 | 16.77 | 21.34 | 38.98 | 25.82 | 22.80 | 29.20 |
| Improvement | - | +5.33 | +2.35 | +2.57 | +3.42 | +8.00 | +3.26 | +2.77 | +4.68 |
+
+# 4 Experiments
+
+# 4.1 Datasets
+
+KITTI 3D. KITTI 3D [16] is the most widely used benchmark for 3D object detection consisting of 7481 training images and 7518 testing images as well as the corresponding point clouds, which are denoted as KITTI trainval and KITTI test respectively. The training set is commonly divided into training split with 3712 samples and validation split with 3769 samples following [5], which are denoted as KITTI train and KITTI val respectively. The official evaluation metrics are 3D IoU and BEV IoU with the average precision metric, which we denote as $3DAP$ and $BEVAP$ respectively.
+
+KITTI Raw. KITTI Raw [15] is a raw dataset with $\sim 42k$ unlabeled samples in sequence form. And KITTI 3D is a subset of KITTI Raw chosen with high-quality samples for 3D object detection. Moreover, KITTI Raw is the official depth prediction training set where the training samples are commonly divided into Eigen splits [11]. However, there is an overlap [55, 58] between Eigentrain and KITTI val. To avoid this, we use the Eigen clean split from DD3D [44] that filters out KITTI val from Eigentrain for the validation experiments.
+
+Waymo Open Dataset. The Waymo Open Dataset [12] is a more recently released dataset with 798 training sequences and 202 validation sequences which consist of about $200k$ samples in total, and we denote them as Waymo train and Waymo val respectively. CaDDN [50] is the first monocular detector reporting
+
+Table 2. Results for Cyclist and Pedestrian on KITTI test set. The best results are in bold and the second best results are underlined. We present two setup results, CMKD and $\mathrm{CMKD^{*}}$ . CMKD is trained with the official training set KITTI trainval ( $\sim$ 7.5k) and $\mathrm{CMKD^{*}}$ is trained with the unlabeled KITTI Raw ( $\sim$ 42k).
+
+| Methods | Cyclist
+Easy | 3D AP / BEV AP | Pedestrian
+Easy | 3D AP / BEV AP |
| Moderate | Hard | Moderate | Hard |
| DFR-Net [67] | 5.69 / 5.99 | 3.58 / 4.00 | 3.10 / 3.95 | 6.09 / 6.66 | 3.62 / 4.52 | 3.39 / 3.71 |
| MonoFlex [64] | 4.17 / 4.41 | 2.35 / 2.67 | 2.04 / 2.50 | 9.43 / 10.36 | 6.31 / 7.36 | 5.26 / 6.29 |
| CaDDN [50] | 7.00 / 9.67 | 3.41 / 5.38 | 3.30 / 4.75 | 12.87 / 14.72 | 8.14 / 9.41 | 6.76 / 8.17 |
| MonoPSR [25] | 8.37 / 9.87 | 4.74 / 5.78 | 3.68 / 4.57 | 8.37 / 9.87 | 4.74 / 5.78 | 3.68 / 4.57 |
| GUPNet [38] | 5.58 / 6.94 | 3.21 / 3.85 | 2.66 / 3.64 | 14.95 / 15.62 | 9.76 / 10.37 | 8.41 / 8.79 |
| DD3D [44] | 2.39 / 3.20 | 1.52 / 1.99 | 1.31 / 1.79 | 13.91 / 15.90 | 9.30 / 10.85 | 8.05 / 9.41 |
| CMKD | 9.60 / 12.53 | 5.24 / 7.24 | 4.50 / 6.21 | 17.79 / 20.42 | 11.69 / 13.47 | 10.09 / 11.64 |
| Improvement | +1.23/+2.66 | +0.50/+1.46 | +0.72/+1.46 | +2.84/+4.52 | +1.93/+2.62 | +1.68/+2.23 |
| CMKD* | 12.52 / 14.66 | 6.67 / 8.15 | 6.34 / 7.23 | 13.94 / 16.03 | 8.79 / 10.28 | 7.42 / 8.85 |
| Improvement | +4.15/+4.79 | +1.93/+2.37 | +2.66/+2.48 | -1.01/+0.13 | -0.97/-0.57 | -0.99/-0.56 |
+
+the performance on Waymo val set using samples from the front-camera only, and we follow the same settings for a fair comparison. The official evaluation metrics are 3D IoU with mean average precision and mean average precision weighted by heading, which are denoted as $3DmAP$ and $3DmAPH$ respectively.
+
+# 4.2 Experiment Settings
+
+KITTI. We pre-train the teacher model SECOND [61] on KITTI trainval for 80 epochs. For ablation studies, we train CMKD on KITTI train for 80 epochs or KITTI train and Eigen clean for 30 epochs according to different experiment settings, and report the performance for Car on KITTI val. The image backbone uses depth pre-training on KITTI train for 40 epochs. For comparisons on KITTI test, we present two experiment setups, CMKD and $\mathrm{CMKD^{*}}$ . CMKD is trained with the official training set KITTI trainval ( $\sim 7.5k$ ) for 80 epochs, and $\mathrm{CMKD^{*}}$ is trained with the unlabeled KITTI Raw ( $\sim 42k$ ) for 30 epochs. Following DD3D [44], the image backbone uses depth pre-training on eigen clean split for 10 epochs. We report the performance for all classes on KITTI test.
+
+Waymo. We pre-train SECOND [61] on Waymo train for 10 epochs with a sampling interval 10. We train CMKD on Waymo train for 10 epochs with a sampling interval 5 and report the performance for Vehicle on Waymo val. The input image is resized to $[960 \times 640]$ . We do not use depth pre-training on Waymo.
+
+# 4.3 Results on KITTI test set
+
+We show the results on KITTI test in Tab. 1 and Tab. 2. Until submission, for all the three classes, either CMKD or $\mathrm{CMKD^{*}}$ achieves new state-of-the-art results with significant improvements on KITTI test. With the official KITTI trainval, CMKD significantly surpasses the top ranking methods. With additional unlabeled data from KITTI Raw and our semi-supervised training framework,
+
+Table 3. Results for Vehicle on Waymo val set. The Best results are in bold.
+
+| Difficulty | Method | 3D mAP | 3D mAPH |
| Overall | 0-30m | 30-50m | 50m-∞ | Overall | 0-30m | 30-50m | 50m-∞ |
| LEVEL 1 | M3D-RPN [1] | 0.35 | 1.12 | 0.18 | 0.02 | 0.34 | 1.10 | 0.18 | 0.02 |
| CaDNN [50] | 5.03 | 14.54 | 1.47 | 0.10 | 4.99 | 14.43 | 1.45 | 0.10 |
| CMKD | 12.95 | 33.45 | 6.84 | 0.74 | 12.82 | 33.21 | 6.79 | 0.73 |
| Improvement | +7.92 | +18.91 | +5.37 | +0.64 | +7.83 | +18.78 | +5.34 | +0.63 |
| LEVEL 2 | M3D-RPN [1] | 0.33 | 1.12 | 0.18 | 0.02 | 0.33 | 1.10 | 0.17 | 0.02 |
| CaDNN [50] | 4.49 | 14.50 | 1.42 | 0.09 | 4.45 | 14.38 | 1.41 | 0.09 |
| CMKD | 11.44 | 33.04 | 6.22 | 0.58 | 11.33 | 32.80 | 6.17 | 0.57 |
| Improvement | +7.45 | +18.54 | +4.80 | +0.49 | +6.88 | +18.42 | +4.76 | +0.48 |
+
+Table 4. Effectiveness of both distillation and the extension to handle unlabeled data. Pre. denotes using depth pre-trained backbone. Feat. denotes feature distillation. Res. denotes response distillation. Un. denotes distilling additional unlabeled data.
+
+| Pre. | Feat. | Res. | Un. | 3D AP |
| Easy | Moderate | Hard |
| × | × | × | × | 11.88 | 8.52 | 7.40 |
| ✓ | × | × | × | 17.60 | 13.48 | 11.81 |
| ✓ | × | ✓ | × | 18.81 | 14.49 | 12.16 |
| ✓ | ✓ | × | × | 22.20 | 15.46 | 13.47 |
| ✓ | ✓ | ✓ | × | 23.53 | 16.33 | 14.44 |
| ✓ | ✓ | ✓ | ✓ | 30.17 | 21.54 | 19.44 |
+
+CMKD* achieves further boosted performance with significant improvements for Car and Cyclist. This implies that the extension to a semi-supervised framework is efficient in distilling beneficial information from massive unlabeled data and improves the performance. However, the performance for Pedestrian becomes worse with additional unlabeled data, and we conduct extra experiments to explore the reasons for this observation. This lies in the fact that the soft labels provided by the teacher model for Pedestrian are of insufficient quality, which can not provide good guidance for the student model. Detailed experiments and discussions can be found in the Supplementary Materials.
+
+Note that DD3D [44], the top method before ours, uses large-scale extra dataset DDAD15M with $\sim 15M$ samples for depth training besides KITTI, while CMKD/CMKD* uses only KITTI and surpasses DD3D by a large margin. Also, other top methods like DD3D [44] or GUPNet [38], works well for Car and Pedestrian but poor for Cyclist, while CMKD works well for all three object classes, which demonstrates its good generalization performance across different object classes. We visualize some prediction results in Fig. 7.
+
+# 4.4 Results on Waymo Open Dataset
+
+We show the results for Vehicle on Waymo val in Tab. 3. With fewer training samples and lower image resolution than that in M3D-RPN [1] and CaDDN [50], CMKD achieves significant improvements on the two difficulty levels considering different distance ranges. We visualize some prediction results in Fig. 7.
+
+Table 5. Effectiveness of components in feature distillation. $\mathcal{L}_{\text{feat}}$ denotes the feature distillation loss. $DA$ denotes the domain adaptation module.
+
+| KITTI train | KITTI train + Eigen clean |
| \( \mathcal{L}_{\text{feat}} \) | \( DA \) | 3D AP | \( \mathcal{L}_{\text{feat}} \) | 3D AP |
| Easy | Moderate | Hard | Easy | Moderate | Hard |
| × | × | 18.81 | 14.49 | 12.16 | × | × | 26.07 | 19.17 |
| ✓ | × | 21.72 | 15.24 | 12.93 | ✓ | × | 28.52 | 20.74 |
| ✓ | ✓ | 23.53 | 16.33 | 14.44 | ✓ | ✓ | 30.17 | 21.54 |
+
+Table 6. Effectiveness of components in response distillation. $\mathcal{L}_{res}$ denotes the response distillation loss. Conf. denotes the IoU-aware confidence scores of soft labels used to perform weighted supervision.
+
+| KITTI train | KITTI train + Eigen clean |
| LresConf. | 3DAP | LresConf. | 3DAP |
| Easy | Moderate | Hard | Easy | Moderate |
| × | × | 20.20 | 13.46 | 11.47 | × | × | 27.24 | 19.56 |
| ✓ | × | 22.78 | 15.69 | 13.97 | ✓ | × | 28.16 | 20.67 |
| ✓ | ✓ | 23.53 | 16.33 | 14.44 | ✓ | ✓ | 30.17 | 21.54 |
+
+# 4.5 Ablation Studies
+
+Effectiveness of both distillation. As discussed earlier in this paper, existing Pseudo-LiDAR methods [58, 63, 41, 59] leverage the LiDAR data via depth pretraining, while we further exploit the LiDAR data via knowledge distillation. As can be seen in Tab. 4, when using the depth pre-trained image backbone, the performance significantly improves against the baseline, indicating that the accurate depth information provided by LiDAR points is helpful for the task. And when each of our distillation modules is applied, the performance is further significantly improved, indicating that our novel utilization of the LiDAR data via distillation can more fully exploit the potential of the LiDAR data and further improve the performance of the monocular 3D detector.
+
+Effectiveness of distilling unlabeled data. In Sec. 3.7, we introduced the improved utilization of unlabeled data in a semi-supervised manner. As shown in Tab. 4, the performance of CMKD is further improved when unlabeled data is added to distillation pipeline, indicating that our method is efficient in extracting beneficial information from massive unlabeled data and improves the performance. Specifically, we use $\sim 18k$ samples for training with $\sim 3.7k$ labeled and we reduce about $80\%$ annotation cost. Also, we conducted experiments on the impact of different amounts of unlabeled data on the performance. Detailed experiments and discussions can be found in the Supplementary Materials.
+
+Apart from jointly applying both distillation, we present novel designs in each distillation module, e.g., the DA module and the quality-aware supervision. We conduct experiments to show that the novel components are helpful for the task. Effectiveness of components in feature distillation. Here, the baseline is the full version of CMKD without the feature distillation loss $\mathcal{L}_{feat}$ and the DA
+
+
+Fig. 7. Qualitative results on KITTI test (top line) and Waymo val (bottom line). None of the samples were seen during training.
+
+module. As shown in Tab. 5, the performance improves significantly with the two components in the feature distillation. As can be seen from Fig. 5, the BEV feature map shows more clear patterns with highlighted object features when $\mathcal{L}_{\text {feat }}$ is added, and avoids smearing effects with aligned BEV features when DA is added. This shows that the components are effective in transferring the knowledge between the two modalities in the feature space.
+
+Effectiveness of components in response distillation. Here, the baseline is the full version of CMKD without the response distillation loss $\mathcal{L}_{res}$ and the quality-aware penalization weights. As shown in Tab. 6, the performance improves with the response distillation loss, and achieves further improvements with the awareness of soft label quality, i.e., with the adaptive supervision. This shows that the components are effective in transferring the knowledge between the two modalities in the response space.
+
+# 5 Conclusion
+
+In this work, we propose the cross-modality knowledge distillation (CMKD) network to directly and efficiently transfer the knowledge from LiDAR modality to image modality on both features and responses, and significantly improve monocular 3D detection accuracy. Moreover, we extend CMKD as a semi-supervised training framework to distill useful knowledge from large-scale unlabeled data, further boosting the performance while reducing the annotation cost. CMKD achieves new state-of-the-art performance on both KITTI and Waymo benchmarks for monocular 3D object detection with significant performance gains compared to other methods, which shows its great effectiveness.
+
+Broader Impact. Our CMKD framework opens up a new perspective in monocular 3D detection. We believe the effective distillation of unlabeled data demonstrates the potential of CMKD to generalize its application in real-world scenarios, where the unlabeled data is easy to collect for autonomous driving cars.
+
+Acknowledgement. This work was supported by the National Key Research and Development Program of China (Grant No. 2018YFE0183900) and the YUNJI Technology Co. Ltd.
+
+# References
+
+1. Brazil, G., Liu, X.: M3d-rpn: Monocular 3d region proposal network for object detection. In: ICCV (2019)
+2. Caesar, H., Bankiti, V., Lang, A.H., et al.: nuscenes: A multimodal dataset for autonomous driving. In: CVPR (2020)
+3. Chen, H., Huang, Y., Tian, W., et al.: Monorun: Monocular 3d object detection by reconstruction and uncertainty propagation. In: CVPR (2021)
+4. Chen, L., Papandreou, G., Schroff, F., et al.: Rethinking atrous convolution for semantic image segmentation. CoRR abs/1706.05587 (2017)
+5. Chen, X., Kundu, K., Zhu, Y., et al.: 3d object proposals for accurate object class detection. In: NIPS (2015)
+6. Chen, Y.N., Dai, H., Ding, Y.: Pseudo-stereo for monocular 3d object detection in autonomous driving. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 887-897 (2022)
+7. Chong, Z., Ma, X., Zhang, H., Yue, Y., Li, H., Wang, Z., Ouyang, W.: Monodistill: Learning spatial features for monocular 3d object detection (2022)
+8. Dai, X., Jiang, Z., Wu, Z., et al.: General instance distillation for object detection. In: CVPR (2021)
+9. Deng, J., Shi, S., Li, P., et al.: Voxel r-cnn: Towards high performance voxel-based 3d object detection. In: AAAI (2021)
+10. Ding, M., Huo, Y., Yi, H., et al.: Learning depth-guided convolutions for monocular 3d object detection. CVPR (2020)
+1. Eigen, D., Puhrsch, C., Fergus, R.: Depth map prediction from a single image using a multi-scale deep network. In: NIPS (2014)
+2. Ettinger, S., Cheng, S., Caine, B., et al.: Large scale interactive motion forecasting for autonomous driving: The waymo open motion dataset. CoRR abs/2104.10133 (2021)
+3. Fu, H., Gong, M., Wang, C., others.: Deep Ordinal Regression Network for Monocular Depth Estimation. In: CVPR (2018)
+4. Furlanello, T., Lipton, Z.C., Tschannen, M., et al.: Born-again neural networks. In: Proceedings of International Conference on Machine Learning (ICML) (2018)
+5. Geiger, A., Lenz, P., Stiller, C., Urtasun, R.: Vision meets robotics: The kitti dataset. International Journal of Robotics Research (IJRR) (2013)
+6. Geiger, A., Lenz, P., Urtasun, R.: Are we ready for autonomous driving? the kitti vision benchmark suite. In: CVPR (2012)
+7. Gülçehre, C., Bengio, Y.: Knowledge matters: Importance of prior information for optimization. In: ICLR (2013)
+8. Guo, X., Shi, S., et al.: Liga: learning lidar geometry aware representations for stereo-based 3d detector. In: ICCV (2021)
+9. He, K., Zhang, X., Ren, S., et al.: Deep residual learning for image recognition. In: CVPR (2016)
+20. Hinton, G.E., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. CoRR abs/1503.02531 (2015)
+21. Huang, Z., Wang, N.: Like what you like: Knowledge distill via neuron selectivity transfer. CoRR abs/1707.01219 (2017)
+22. Jörgensen, E., Zach, C., Kahl, F.: Monocular 3d object detection and box fitting trained end-to-end using intersection-over-union loss. CoRR abs/1906.08070
+23. Ku, J., Mozifian, M., Lee, J., Harakeh, A., Waslander, S.L.: Joint 3d proposal generation and object detection from view aggregation. In: IROS (2018)
+
+24. Ku, J., Mozifian, M., Lee, J., et al.: Joint 3d proposal generation and object detection from view aggregation. In: IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (2018)
+25. $\mathrm{Ku}^*$ , J., $\mathrm{Pon}^*$ , A.D., Waslander, S.L.: Monocular 3d object detection leveraging accurate proposals and shape reconstruction. In: CVPR (2019)
+26. Königshof, H., Salscheider, N.O., Stiller, C.: Realtime 3D Object Detection for Automated Driving Using Stereo Vision and Semantic Information. In: Proc. IEEE Intl. Conf. Intelligent Transportation Systems (2019)
+27. Lee, J.H., Han, M.K., Ko, D.W., et al.: From big to small: Multi-scale local planar guidance for monocular depth estimation (2019)
+28. Li, J., Dai, H., Shao, L., Ding, Y.: Anchor-free 3d single stage detector with mask-guided attention for point cloud. In: Proceedings of the 29th ACM International Conference on Multimedia. pp. 553-562 (2021)
+29. Li, J., Dai, H., Shao, L., Ding, Y.: From voxel to point: Iou-guided 3d object detection for point cloud with voxel-to-point decoder. In: Proceedings of the 29th ACM International Conference on Multimedia. pp. 4622-4631 (2021)
+30. Li, J., Luo, S., Zhu, Z., Dai, H., Krylov, A.S., Ding, Y., Shao, L.: 3d iou-net: Iou guided 3d object detector for point clouds. arXiv preprint arXiv:2004.04962 (2020)
+31. Li, J., Sun, Y., Luo, S., Zhu, Z., Dai, H., Krylov, A.S., Ding, Y., Shao, L.: P2v-rconn: point to voxel feature learning for 3d object detection from point clouds. IEEE Access 9, 98249-98260 (2021)
+32. Li, P., Chen, X., Shen, S.: Stereo r-cnn based 3d object detection for autonomous driving. In: CVPR (2019)
+33. Li, X., Wang, W., Wu, L., et al.: Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. In: NIPS (2020)
+34. Lin, T.Y., Goyal, P., Girshick, R., He, K., Dollar, P.: Focal loss for dense object detection. In: Proceedings of the IEEE international conference on computer vision. pp. 2980-2988 (2017)
+35. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision. pp. 740-755. Springer (2014)
+36. Liu, J., Hou, Q., Cheng, M., et al.: Improving convolutional networks with self-calibrated convolutions. In: CVPR (2020)
+37. Lu, X., Li, Q., et al.: Mimicdet: Bridging the gap between one-stage and two-stage object detection. In: ECCV (2020)
+38. Lu, Y., Ma, X., Y ang, L., et al.: Geometry uncertainty projection network for monocular 3d object detection. arXiv preprint arXiv:2107.13774 (2021)
+39. Luo, S., Dai, H., Shao, L., Ding, Y.: M3dssd: Monocular 3d single stage object detector. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 6145-6154 (2021)
+40. Ma, X., Liu, S., Xia, Z., et al.: Rethinking pseudo-lidar representation. In: ECCV (2020)
+41. Ma, X., Wang, Z., Li, H., et al.: Accurate monocular 3d object detection via color-embedded 3d reconstruction for autonomous driving. In: ICCV (2019)
+42. Ma, X., Zhang, Y., Xu, D., et al.: Delving into localization errors for monocular 3d object detection. In: CVPR (2021)
+43. Pang, S., Morris, D.D., Radha, H.: Clocs: Camera-lidar object candidates fusion for 3d object detection. In: IROS (2020)
+44. Park, D., Ambrus, R., Guizilini, V.o.: Is pseudo-lidar needed for monocular 3d object detection? In: ICCV (2021)
+
+45. Peng, L., Liu, F., Yu, Z., et al.: Lidar point cloud guided monocular 3d object detection. CoRR (2021)
+46. Qi, C.R., Wei, L., Wu, C., et al.: Frustum pointnets for 3d object detection from rgb-d data. In: CVPR (2018)
+47. Qi, C.R., Su, H., Mo, K., et al.: Pointnet: Deep learning on point sets for 3d classification and segmentation. In: CVPR (2017)
+48. Qi, C.R., Yi, L., Su, H., et al.: Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In: NIPS (2017)
+49. Qin, Z., Wang, J., Lu, Y.: Monogrnet: A geometric reasoning network for 3d object localization. AAAI (2019)
+50. Reading, C., Harakeh, A., Chae, J., Waslander, S.L.: Categorical depth distribution network for monocular 3d object detection. CVPR (2021)
+51. Romero, A., Ballas, N., Kahou, S.E., et al.: Fitnets: Hints for thin deep nets. In: ICLR (2015)
+52. Shi, S., Guo, C., Jiang, L., et al.: Pv-rcnn: Point-voxel feature set abstraction for 3d object detection. In: CVPR (2020)
+53. Shi, S., Wang, X., Li, H.: Pointcnn: 3d object proposal generation and detection from point cloud. In: CVPR (2019)
+54. Shi, X., Ye, Q., Chen, X., et al.: Geometry-based distance decomposition for monocular 3d object detection. In: ICCV (2021)
+55. Simonelli, A., Bulò, S.R., Porzi, L., et al.: Demystifying pseudo-lidar for monocular 3d object detection. CoRR abs/2012.05796 (2020)
+56. Sun, J., Chen, L., Xie, Y., et al.: Disp r-cnn: Stereo 3d object detection via shape prior guided instance disparity estimation. In: CVPR (2020)
+57. Wang, L., Zhang, L., Zhu, Y., et al.: Progressive coordinate transforms for monocular 3d object detection. In: NIPS (2021)
+58. Wang, Y., Chao, W.L., Garg, D., et al.: Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. In: CVPR (2019)
+59. Weng, X., Kitani, K.: Monocular 3D Object Detection with Pseudo-LiDAR Point Cloud. arXiv:1903.09847 (2019)
+60. Xu, Z., Hsu, Y., et al.: Training shallow and thin networks for acceleration via knowledge distillation with conditional adversarial networks. In: ICLR (2018)
+61. Yan, Y., Mao, Y., Li, B.: SECOND: sparsely embedded convolutional detection. Sensors (2018)
+62. Ye, X., Du, L., Shi, Y., et al.: Monocular 3d object detection via feature domain adaptation. In: ECCV (2020)
+63. You, Y., Wang, Y., Chao, W.L., et al.: Pseudo-lidar++: Accurate depth for 3d object detection in autonomous driving. In: ICLR (2020)
+64. Zhang, Y., Lu, J., Zhou, J.: Objects are different: Flexible monocular 3d object detection. In: CVPR (2021)
+65. Zheng, W., Tang, W., Jiang, L., et al.: Se-ssd: Self-ensembling single-stage object detector from point cloud. In: CVPR (2021)
+66. Zhou, Y., Tuzel, O.: Voxelnet: End-to-end learning for point cloud based 3d object detection. CoRR abs/1711.06396 (2017)
+67. Zou, Z., Ye, X., Du, L., et al.: The devil is in the task: Exploiting reciprocal appearance-localization features for monocular 3d object detection. In: ICCV (2021)
\ No newline at end of file
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/images.zip b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9d7338eef396bb4a808df6e956bb918196a986ec
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1a5746fbaea9bec87bd9d3c8de2b0f0dffd4c3d2df3b686685fa337f1bffa682
+size 613858
diff --git a/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/layout.json b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f5b93bb990c0986da250836a0d6cb5f449755222
--- /dev/null
+++ b/crossmodalityknowledgedistillationnetworkformonocular3dobjectdetection/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f049579637964f3d60c1a5ab0ddfbf3b4f2e178688ad6260bf1d19d8b9e7adc
+size 430856
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_content_list.json b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c59875325e09daef41e6e488e13e62869c617baf
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:665a762ff87935527b79564abcb135b2be84a5cb73cd61d8e38c0847e2b5126b
+size 85037
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_model.json b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..ae764ab99e2238a2c1fb842a9b070eb417766ff7
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6159be74f8330145e6c4001aa628f281cb862c02e9f6f63d2b12cdba6757bdd
+size 102380
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_origin.pdf b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c8530ab836dd7eb476470e94db2081c151e44ea6
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/3e3300fe-ce02-45ac-8f52-34fdca6f8356_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8fe0ce83497ba971e9a3e86324ec2015df46a65a70dd83701637f0506d2a9b1d
+size 1018624
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/full.md b/crossmodalitytransformerforvisibleinfraredpersonreidentification/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..d88b8a084994d3dde0f673cadc6f387c186be5ff
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/full.md
@@ -0,0 +1,295 @@
+# Cross-Modality Transformer for Visible-Infrared Person Re-Identification
+
+Kongzhu Jiang $^{1}$ , Tianzhu Zhang $^{1,2\star}$ , Xiang Liu $^{3}$ , Bingqiao Qian $^{1}$ , Yongdong Zhang $^{1}$ , and Feng Wu $^{1}$
+
+1 University of Science and Technology of China
+
+$^{2}$ Deep Space Exploration Lab
+
+$^{3}$ Dongguan University of Technology of China
+
+{kzjiang,qbq}@mail.ustc.edu.cn {tzzhang,zhyd73,fengwu}@ustc.edu.cn succeedpkmba2011@163.com
+
+Abstract. Visible-infrared person re-identification (VI-ReID) is a challenging task due to the large cross-modality discrepancies and intra-class variations. Existing works mainly focus on learning modality-shared representations by embedding different modalities into the same feature space. However, these methods usually damage the modality-specific information and identification information contained in the features. To alleviate the above issues, we propose a novel Cross-Modality Transformer (CMT) to jointly explore a modality-level alignment module and an instance-level module for VI-ReID. The proposed CMT enjoys several merits. First, the modality-level alignment module is designed to compensate for the missing modality-specific information via a Transformer encoder-decoder architecture. Second, we propose an instance-level alignment module to adaptively adjust the sample features, which is achieved by a query-adaptive feature modulation. To the best of our knowledge, this is the first work to exploit a cross-modality transformer to achieve the modality compensation for VI-ReID. Extensive experimental results on two standard benchmarks demonstrate that our CMT performs favorably against the state-of-the-art methods.
+
+Keywords: Person Re-identification, Transformer, Cross-modality
+
+# 1 Introduction
+
+Person re-identification (Re-ID) aims at matching person images captured from non-overlapping camera views [40,42]. In recent years, it has gained increasing attention due to its significant practical value in video surveillance. Most of the existing methods [16,21,13,26,44,11,43,24] focus on visible (RGB) cameras and formulate the Re-ID task as a single-modality matching problem. However, the visible cameras are incapable of capturing valid appearance information of persons under poor illumination conditions (e.g., at night). To image clearly in the dark, in addition to the visible cameras, infrared (IR) cameras that are
+
+
+Fig. 1. Our motivation. The modality prototypes are introduced to store the global modality characteristics, which can be utilized to compensate for the missing modality features and thus contributes to the modality-level alignment. Then, by use of the query feature modulation, we can adaptively adjust the gallery sample features to activate query-related patterns and achieve instance-level alignment.
+
+robust to illumination variants are also equipped in many surveillance scenarios. Hence, visible-infrared person re-identification (VI-ReID) [3,37,20] has recently been of great interest, which aims at retrieving IR person images of the same identity as the given RGB query and vice versa.
+
+VI-ReID is challenging due to the cross-modal discrepancies between RGB and IR images, and the key issue is how to bridge the two modalities. To narrow the gap between two modalities, existing methods mainly focus on modality-level alignment. Some works are based on modality-shared feature learning [6,9,37,38,41] which decouple features into modality-specific and modality-shared features. Then they utilize the latter ones to align the modalities in the feature level while abandoning the modality-specific features. However, the modality-specific features also contain useful identity information that helps the final retrieval, such as colors. Therefore, with modality-shared cues only, the upper bound of the discrimination ability of the feature representation is limited. To address this limitation, modality compensation methods [32,20] have been proposed to compensate for the missing modality features. Specifically, in [20], the authors utilize the graph convolutional networks to obtain the compensated modality features based on the similarities between cross-modality samples in the current mini-batch.
+
+By studying the previous VI-ReID methods based on modality compensation, we discover two characteristics that play an important role in achieving the robust VI-ReID. (1) Modality-level alignment. In previous modality compensation methods [20], the compensated features are produced solely based on the samples of the current mini-batch. This strategy suffers from a certain randomness, and thus causes the inconsistency of generated modality features when the samples are in the different mini-batches. To address this issue, an intuitive idea is to model several modality prototypes for representing global modality information. These modality prototypes can be used as the global basis for learning robust modality compensation for every sample. Therefore, it is necessary to model global modality prototypes to facilitate a better alignment between RGB and IR modalities. (2) Instance-level alignment. Due to intra-class variations
+
+(e.g., viewpoint, illumination, and background clutter), the feature distribution of different samples with same ID varies greatly even under the same modality. Performing the modality-level alignment alone may lead to cases where the IR (RGB) instances are incorrectly aligned with the RGB (IR) instances of a different category. To align the cross-modal instances in the same class, most methods [9,37,38] utilize the supervised triplet loss to reduce the distances of the features of the same ID on the training set. However, in the open-set setting, because the categories of training and test sets have no overlap, the discriminative representations learned on the training set may not be optimal for the test images. Therefore, it is of vital importance to achieve dynamic instance-level alignment. In this way, the gallery instances can be adaptively refined according to the query features and be aligned to the query instances in the same class(as shown in Figure 1).
+
+Inspired by the above discussions, we propose a novel Cross-Modality Transformer (CMT) by jointly exploring a modality-level alignment module and an instance-level alignment module for visible-infrared person re-identification. In the modality-level alignment module, we introduce an encoder-decoder architecture, which can achieve the modality feature enhancement and compensation. In the encoder, we adopt a self-attention mechanism to capture the interrelationship between local human parts. Then, we introduce two sets of learnable modality prototypes to represent the RGB and IR modalities respectively, and design a decoder to compensate for the missing modality. Taking a RGB sample as the example, we take the IR modality prototypes as queries and the part features of the RGB sample as keys and values of the transformer decoder. By use of the cross-attention between the part features and the modality prototypes, we can obtain the attention scores which can be regarded as the soft correspondences between IR modality prototypes and part features. Then we can compensate for IR modality-specific features by aggregating the related part features according to the attention matrix. Besides, to guide the learning of modality prototypes, we design a modality consistency loss to constrain the compensated IR features to be aligned with the real IR modality features. Similarly, the modality compensation for IR images can be achieved in the same way. In the instance-level alignment module, a feature modulator is proposed to adaptively adjust the representations of instances. Concretely, given the query sample $x$ , we can utilize its feature to generate the channel-wise modulation parameters. These parameters reveal the most discriminative patterns of sample $x$ , and can be employed to modulate other samples of the current mini-batch in the channel dimension. Thus, the crucial $x$ -related channels of other samples can be strengthened, and the irrelevant channels can be suppressed. In this way, we can achieve query-adaptive feature modulation during the test, which can adaptively activate coherent patterns between query instances and gallery instances and facilitate a better instance-level alignment even for the unseen test categories.
+
+The main contributions of this paper can be summarized as follows: (1) We propose a novel Cross-Modality Transformer for VI-ReID to jointly explore modality-level alignment and instance-level alignment. To the best of our knowl
+
+edge, this is the first work to exploit a cross-modality transformer to achieve the modality compensation for VI-ReID. (2) A modality-level alignment module is proposed to compensate for the missing modality-specific information via a Transformer encoder-decoder architecture. Also, we design an instance-level alignment module to adaptively adjust the sample features, which is achieved by query-adaptive feature modulation. (3) Extensive experimental results on two standard benchmarks demonstrate that the proposed model performs favorably against state-of-the-art VI-ReID methods.
+
+# 2 Related Work
+
+Single-Modality Person Re-ID. Single-modality person re-identification aims at matching pedestrian images across disjoint visible cameras. The considerable viewpoint changes and human pose variations under different visible cameras are the main challenges of single modality person Re-ID. Existing works mainly focuses on representation learning [42,16,21,26,30] and metric learning [43,24,36], and have achieved excellent performance on the widely-used datasets. However, due to the large cross-modality discrepancies, these methods may not be applicable for the VI-ReID task in the practical surveillance scenarios. Differently, our method proposes a modality-level alignment module and an instance-alignment module to learn a unified ReID framework for both RGB and IR modalities.
+
+Visible-Infrared Person Re-ID. Visible-Infrared person Re-ID is challenging due to the cross-modal discrepancies between visible and infrared images. To address this challenge, existing methods [9,15,6,37,29,3,39,41] mainly focus on learning modality-shared feature representations to achieve modality-level alignment. Some image translation-based methods [3,14,28,29] are developed to firstly achieve modality unification and then learn modality-shared representations. Wang et al. [29] propose an end-to-end alignment generative adversarial network by exploiting pixel alignment and feature alignment jointly. [28] generates cross-modality paired-images and performs both global set-level and fine-grained instance-level alignments. Another line of works [37,7,8,18] attempts to learn modality-shared features by designing various two-stream architectures. Ye et al. [37] propose a novel modality-aware collaborative ensemble learning method with the middle-level sharable two-stream network. [7] exploits the optimal two-stream architecture by neural architecture search for VI-ReID. However, the modality-specific features are generally ignored by the above methods, which limits the upper bound of the discrimination ability of the feature representation. To address this limitation, modality compensation methods [32,20] are proposed to compensate for the missing modality features. [32] generates multi-spectral images to compensate for the lacking specific information by utilizing the generative adversarial network. In [20], a cross-modality shared specific feature transfer algorithm is proposed to explore the potential of both the modality-shared information and the modality-specific features. However, the compensated features extracted by [20] only depend on the current mini-batch, which causes the inconsistency of generated modality features when the samples are in the different
+
+
+Fig. 2. Framework of our Cross-Modality Transformer. (1) The modality-level alignment module compensates for the missing modality information by the cross-attention between the modality prototypes $\mathbf{P}^I / \mathbf{P}^R$ and features $\tilde{\mathbf{F}}^R / \tilde{\mathbf{F}}^I$ . A modality consistency loss $\mathcal{L}_{cyc}$ is proposed to make the modality prototypes focus on the corresponding global modality information. (2) The instance-level alignment module leverages the characteristics of the given query to automatically adapt the other instance features by the query-adaptive modulation, which helps align the query and gallery instances in the same class. For simplicity, we take an IR image $\mathbf{I}$ as an example and show the process of using $\mathbf{I}$ as the query for the modulation in the figure.
+
+mini-batches. Differently, we introduce two sets of global modality prototypes to represent the RGB and IR modalities respectively, which can be used as the global basis to learn modality compensation for every sample.
+
+Transformer in Person Re-ID. Transformers have recently received increasing attention for computer vision tasks, including image classification [5,19], object detection [1,45], image segmentation [31,19], and so on. Most existing Re-ID methods apply Transformer to a single modality. For example, He et al. [11] utilize a pure-transformer with a side information embedding and a jigsaw patch module to learn discriminative features. Li et al. [17] exploit a transformer architecture to discover diverse parts for occluded person Re-ID. Different from the above methods, our CMT is designed for VI-ReID to compensate for the missing modality-specific information.
+
+# 3 Our Method
+
+In this section, we introduce the details of the proposed Cross-Modality Transformer (CMT) for the VI-ReID task. As shown in Figure 2, the proposed CMT mainly consists of two modules. (1) The modality-level alignment module aims at compensating for the missing modality-specific information via a Transformer encoder-decoder architecture. (2) The instance-level alignment module is responsible for aligning the gallery instances with the query instance in the same class by a query-adaptive feature modulation mechanism.
+
+# 3.1 Modality-level Alignment Module
+
+In order to achieve the modality-level alignment, we follow the architecture of Transformer [27] and design a representation encoder and a modality compensation decoder, which is able to adaptively compensate for the lacking modality-special information. Different from the previous modality compensation method [20] that depends on the information in the mini-batch, we design two set of learnable modality prototypes to provide the global modality information for more robust modality compensation.
+
+Representation Encoder. Following existing works [8,25,40,39], we adopt a two-stream network based on ResNet-50 as our feature extractor for the RGB and IR modalities, where the first two stages are parameter-independent and the latter three stages are parameter-shared. We first use the feature extractor $\phi$ to extract the feature maps for the given visible images and infrared images. Then, following the practice in the part-based methods [39,18], we horizontally split the feature maps into $p$ non-overlapping parts with a region pooling strategy. In this way, the RGB and IR images can be represented by the set of the part features: $\mathbf{F}^R = [f_1^R; f_2^R; \ldots; f_p^R] \in \mathbb{R}^{p \times d}$ and $\mathbf{F}^I = [f_1^I; f_2^I; \ldots; f_p^I] \in \mathbb{R}^{p \times d}$ , where $f_i^R, f_i^I \in \mathbb{R}^d$ indicate the $i^{th}$ part feature of two modalities. These part features are taken as the inputs of transformer encoder. For the simplicity of the description, we take the RGB image as an example.
+
+In the representation encoder, we adopt a self-attention layer to capture the inter-relationship between the local human parts to refine the part representations. Specifically, we take part features as the query $\mathbf{Q}$ , key $\mathbf{K}$ and value $\mathbf{V}$ . We generate the $(\mathbf{Q},\mathbf{K},\mathbf{V})$ triplets by independent linear projection layers:
+
+$$
+\mathbf {Q} = \mathbf {F} ^ {R} \mathbf {W} ^ {Q}, \quad \mathbf {K} = \mathbf {F} ^ {R} \mathbf {W} ^ {K}, \quad \mathbf {V} = \mathbf {F} ^ {R} \mathbf {W} ^ {V}, \tag {1}
+$$
+
+where $\mathbf{W}^Q \in \mathbb{R}^{d \times d}, \mathbf{W}^K \in \mathbb{R}^{d \times d}, \mathbf{W}^V \in \mathbb{R}^{d \times d}$ are linear projections, and $\mathbf{Q}, \mathbf{K}, \mathbf{V} \in \mathbb{R}^{p \times d}$ . Then, the attention weights between the query $\mathbf{Q}$ and the key $\mathbf{K}$ can be derived by the inner product with a scaling operation and a Softmax normalization. Based on the attention weights, we can obtain the refined part features as the weighted sum of values $V \in \mathbb{R}^{p \times d}$ . Formally:
+
+$$
+\text {A t t e n t i o n} (\mathbf {Q}, \mathbf {K}, \mathbf {V}) = \operatorname {s o f t m a x} \left(\frac {\mathbf {Q} \mathbf {K} ^ {T}}{\sqrt {d}}\right) \mathbf {V}. \tag {2}
+$$
+
+Equation (2) is implemented with the multi-head attention mechanism, and a feed-forward network is also applied. For more details, please refer to the work [27].
+
+Modality Compensation Decoder. In the modality compensation decoder, we introduce two sets of learnable modality prototypes to represent the global modality information of RGB and IR modalities respectively, which are denoted as $\mathbf{P}^R = [p_1^R;p_2^R;\dots ;p_p^R ]$ $\mathbf{P}^{I} = [p_{1}^{I};p_{2}^{I};\ldots ;p_{p}^{I}]\in \mathbb{R}^{p\times d}$ , where $p_i^I$ is the modality prototype for the $i$ -th part feature in the IR modality. Following the standard architecture of the transformer [27], we first use a self-attention layer to incorporate the local context information between prototypes. The implementation is the same as the self-attention layer in the representation encoder, but the
+
+keys, queries and values arise from IR/RGB modality prototypes. Subsequently, we compensate for the missing modality features by the cross-attention between the modality prototypes and part features. Given the RGB/IR feature map of the encoder output $\tilde{\mathbf{F}}^R = \left[\tilde{f}_1^R;\tilde{f}_2^R;\dots ;\tilde{f}_p^R\right] / \tilde{\mathbf{F}}^I = \left[\tilde{f}_1^I;\tilde{f}_2^I;\dots ;\tilde{f}_p^I\right]\in \mathbb{R}^{p\times d}$ ( $\tilde{f}_i^R$ and $\tilde{f}_i^I$ represent the $i^{th}$ part feature of RGB and IR samples, respectively), we take RGB features as an example to elaborate on the compensation process of the IR modality. Specifically, the IR modality prototypes $\mathbf{P}^I$ are taken as the queries $\mathbf{Q}^I$ , and the RGB part features $\tilde{\mathbf{F}}^R$ are taken as keys $\mathbf{K}^R$ and values $\mathbf{V}^R$ of the modality compensation decoder. Formally:
+
+$$
+\mathbf {Q} ^ {I} = \mathbf {P} ^ {I} \mathbf {W} ^ {Q}, \mathbf {K} ^ {R} = \tilde {\mathbf {F}} ^ {R} \mathbf {W} ^ {K}, \mathbf {V} ^ {R} = \tilde {\mathbf {F}} ^ {R} \mathbf {W} ^ {V}. \tag {3}
+$$
+
+Then, we can obtain the dot-production attention scores between queries $\mathbf{Q}^I$ and keys $\mathbf{K}^R$ , which can be regarded as the soft correspondences between the modality prototypes and part features. To compensate for the missing modality features, we can project the part features into the corresponding modality space according to the attention weights. Concretely, the compensated IR part features $\hat{\mathbf{F}}^I = \left[\hat{f}_1^I;\hat{f}_2^I;\dots;\hat{f}_p^I\right]$ for the RGB sample are derived as the weighted sum over all values $\mathbf{V}^R$ :
+
+$$
+\begin{array}{l} \hat {\mathbf {F}} ^ {I} = \text {A t t e n t i o n} \left(\mathbf {Q} ^ {I}, \mathbf {K} ^ {R}, \mathbf {V} ^ {R}\right) \\ = \operatorname {s o f t m a x} \left(\frac {\mathbf {Q} ^ {I} \left(\mathbf {K} ^ {R}\right) ^ {T}}{\sqrt {d}}\right) \mathbf {V} ^ {R}, \tag {4} \\ \end{array}
+$$
+
+where $\hat{\mathbf{F}}^I\in \mathbb{R}^{p\times d}$ . Similarly, the compensated RGB part features $\hat{\mathbf{F}}^R$ for the samples with the IR modality can also be derived by Equation (3) and Equation (4). Finally, the complete modality representations can be acquired by combining the original features and the compensated modality features:
+
+$$
+\mathbf {R} = \mathbf {F} ^ {R} + \hat {\mathbf {F}} ^ {I}, \quad \mathbf {I} = \mathbf {F} ^ {I} + \hat {\mathbf {F}} ^ {R}, \tag {5}
+$$
+
+where $\mathbf{R}$ and $\mathbf{I}$ are the complete RGB and IR modality representations, respectively. These complete representations are in the shared embedding space, where the samples with different modalities can be aligned well. In this way, our modality compensation decoder can achieve a robust modality-level alignment and bridge the inter-modality discrepancies, which can facilitate a better cross-modality retrieval.
+
+Modality Consistency Loss. As we have no ground truths for the compensated modality features, the learning of the decoder is difficult. To resolve this issue, we design a modality consistency loss to guide the learning of modality prototypes, which constrains the compensated RGB/IR features to be aligned with the real RGB/IR modality features. We first compute the two centroid features of each identity for two modalities in the mini-batch:
+
+$$
+\mathbf {C} _ {i} ^ {R} = \frac {1}{K} \sum_ {j = 1} ^ {K} \mathbf {F} _ {i, j} ^ {R}, \quad \mathbf {C} _ {i} ^ {I} = \frac {1}{K} \sum_ {j = 1} ^ {K} \mathbf {F} _ {i, j} ^ {I}, \tag {6}
+$$
+
+where $\mathbf{F}_{i,j}^{R},\mathbf{F}_{i,j}^{I}$ denote the $j^{th}$ RGB/IR image feature of the $i^{th}$ person in the mini-batch, and $\mathbf{C}_i^R$ $\mathbf{C}_i^I$ represent the RGB/IR centroid features of the $i^{th}$ person. Based on the centroids, the modality consistency loss $\mathcal{L}_{cyc}^{R}$ and $\mathcal{L}_{cyc}^{I}$ for RGB/IR modalities are defined as:
+
+$$
+\mathcal {L} _ {c y c} ^ {R} = \frac {1}{N K} \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {K} \| \hat {\mathbf {F}} _ {i, j} ^ {R} - \mathbf {C} _ {i} ^ {R} \| _ {2}, \tag {7}
+$$
+
+$$
+\mathcal {L} _ {c y c} ^ {I} = \frac {1}{N K} \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {K} \| \hat {\mathbf {F}} _ {i, j} ^ {I} - \mathbf {C} _ {i} ^ {I} \| _ {2}, \tag {8}
+$$
+
+where $\hat{\mathbf{F}}_{i,j}^{R},\hat{\mathbf{F}}_{i,j}^{I}$ are the compensated RGB, IR features. Constrained by $\mathcal{L}_{cyc}^{R}$ and $\mathcal{L}_{cyc}^{I}$ , the modality prototypes are forced to learn the corresponding modality information to approach the real modality features, which consequently facilitates a more reliable modality compensation.
+
+ID Loss. To guide the complete representations $\mathbf{R}$ and $\mathbf{I}$ to focus on the ID-related discriminative information, we design an ID loss consisting of an identity classification loss $\mathcal{L}_{cls}$ and a hetero-center based triplet loss $\mathcal{L}_{hc\_tri}$ following the practice in [18]. Concretely, the ID loss is formulated as:
+
+$$
+\mathcal {L} _ {I D} = \mathcal {L} _ {c l s} + \mathcal {L} _ {h c \_ t r i} \tag {9}
+$$
+
+$$
+\mathcal {L} _ {c l s} = E (- \log p (R)) + E (- \log p (I)) \tag {10}
+$$
+
+$$
+\mathcal {L} _ {h c _ {-} t r i} = E \left[ \alpha + d _ {c _ {a}, c _ {p}} - d _ {c _ {a}, c _ {n}} \right] _ {+}, \tag {11}
+$$
+
+where $p(\cdot)$ is the probability of correct prediction, and $E$ represents the expectation. In Equation (11), $c_{a}$ denotes the centroid feature calculated by the RGB features $\mathbf{R}$ or IR features $\mathbf{I}$ in the current mini-batch. $c_{a}$ and $c_{p}$ form a positive pair of centroid features belonging to the same person but with different modalities, while $c_{a}$ and $c_{n}$ form a negative pair of centroid features belonging to different persons, and $\alpha$ is a margin parameter.
+
+# 3.2 Instance-level Alignment Module
+
+Due to the large intra-class variations like viewpoint changes and background clutter, the feature distribution of different samples with the same ID has large differences. Therefore, we propose an instance-level alignment module, where we leverage the characteristics of the given query to automatically adapt the instance features by the query-adaptive modulator. Specifically, the modulator employs an affine transformation to excite the query-related channels by the learned modulation parameters. Next we will give the details.
+
+Parameter Generator. The Instance-level Alignment Module is symmetry for the visible and infrared modality. Given any sample feature $X \in \mathbb{R}^{p \times d}$ in the current mini-batch from RGB or IR modality, we take it as the query and transform the query characteristics into the modulation parameters. Concretely,
+
+we propose two parameter generators $g_{\gamma}$ and $g_{\beta}$ to obtain the channel-wise modulation parameters, i.e., the scaling parameter $\gamma$ and the shifting parameter $\beta$ . Each generator contains two linear layers, with the first layer followed by a ReLU activation function. Formally, the modulation parameters $\gamma$ and $\beta$ are generated by
+
+$$
+\gamma = g _ {\gamma} (G A P (X)), \beta = g _ {\beta} (G A P (X)), \tag {12}
+$$
+
+where $\gamma, \beta \in \mathbb{R}^d$ , and $GAP$ represents the global average pooling, which is used to aggregate the part features. After the end-to-end training, the parameter generators $g_{\gamma}$ and $g_{\beta}$ can extract key characteristics in the query feature, and project them into the modulation weights that indicate which channels could be useful in the instance-level alignment. Although sharing a similar network structure with SENet [12], the parameter generator is designed to modulate other samples rather than enhance the samples themselves.
+
+Query-adaptive Modulation. The modulation parameters reveal the most discriminative patterns of $X$ , and can be employed to perform the query-adaptive modulation on the other sample features $Y$ in the current mini-batch to achieve the instance-level alignment. Specifically, the query-adaptive modulation layer employs an affine transformation by the scaling parameter $\gamma$ and the shifting parameter $\beta$ on $Y$ :
+
+$$
+\bar {Y} _ {i} = Y _ {i} \odot \gamma + \beta , \tag {13}
+$$
+
+where $\odot$ denotes a point-wise vector multiplication, and $Y_{i}$ represents the $i^{th}$ part features of the sample $Y$ , $\bar{Y}_i$ is the modulated feature. In the modulation, the crucial query-related channels of the $Y$ can be strengthened and the irrelevant channels can be suppressed based on the modulation weights of $\gamma$ and $\beta$ . In this way, the instances that have the same ID with the query can be better aligned together. During the testing, the query-adaptive feature modulation will adjust the gallery representations according to the query features, which promotes the alignment between the query and gallery with the same ID, and contributes to a better retrieval.
+
+Modulation Discriminative Loss. Without the constraints, the modulation on the channels may cause some disturbances to the representations, which will undermine the discrimination power of each instance. To help the modulated features preserve the discriminative ability, we propose a modulation discriminative loss to restrain the modulated features, which takes the form of the triplet loss:
+
+$$
+\mathcal {L} _ {\text {m o d}} = E \left[ \alpha + d _ {X, \bar {Y} _ {p}} - d _ {X, \bar {Y} _ {n}} \right] _ {+}, \tag {14}
+$$
+
+where $X$ and $\bar{Y}_p$ form a positive pair of feature vectors belonging to the same person, $X$ and $\bar{Y}_n$ form a negative pair of feature vectors belonging to different persons, $\alpha$ is a margin parameter.
+
+# 3.3 Training and Inference
+
+For the VI-ReID task, our proposed CMT is trained by minimizing the overall objective with identity labels as defined in
+
+$$
+\mathcal {L} _ {C M T} = \mathcal {L} _ {I D} + \mathcal {L} _ {c y c} ^ {R} + \mathcal {L} _ {c y c} ^ {I} + \lambda \mathcal {L} _ {\text {m o d}}. \tag {15}
+$$
+
+During the testing stage, we first extract query features, and then generate modulation parameters according to query features to adjust the feature embedding of galleries. Finally, we reshape the feature dimension to $\mathbb{R}^{pd}$ for the feature retrieval.
+
+# 4 Experiments
+
+In this section, we first introduce datasets and implementation details. Then, we show experimental results and some visualizations.
+
+# 4.1 Dataset and Evaluation Protocol
+
+SYSU-MM01 [34] is the first large-scale benchmark dataset for VI-ReID collected by 6 cameras, including 4 visible and 2 infrared cameras. Specially, four cameras are deployed in the outdoor environments and two are deployed in the indoor environments. SYSU-MM01 contains 491 persons with a total of 287,628 visible images and 15,792 infrared images. The training set contains 395 persons, including 22258 visible images and 11909 infrared images. The test set contains 96 persons, with 3,803 IR images for query and 301/3010 (one-shot/multi-shot) randomly selected RGB images as the gallery. Meanwhile, it contains two different testing settings, all-search and indoor-search settings. Detailed descriptions of the experimental settings can be found in [34].
+
+RegDB [23] is collected by a dual-camera system, including one visible and one infrared camera. There are 412 identities and 8,240 images in total, with 206 identities for training and 206 identities for testing. For each person, there are 10 visible images and 10 infrared images. The testing stage also contains two evaluation settings. One is Visible to Infrared to search IR images from a RGB image. The other setting is Infrared to Visible to search RGB images from a IR image. The evaluation procedure is repeated for 10 trials to record the mean values.
+
+Evaluation Protocol. Two evaluation metrics are used to measure the performance. The first one is the Cumulative Matching Characteristic (CMC) curves. The CMC represents the probability that a query identity appears in different sized candidate lists. We report the rank-1,10,20 accuracy in experiments. The other is the Mean Average Precision (mAP).
+
+# 4.2 Implementation Details
+
+The proposed method is implemented with the PyTorch framework on a single RTX3090Ti GPU. Following the existing methods [33,25,20], we choose ResNet-50 [10] pretrained on ImageNet as the backbone network and reduce the stride of
+
+Table 1. Performance comparison with state-of-the-art methods on SYSU-MM01 dataset. Rank-k accuracy (\%) and mAP (\%) are reported.
+
+| Method | Venue | All-Search | Indoor-Search | |
| Single-Shot | Multi-Shot | Single-Shot | Multi-Shot | |
| R1 | R10 | R20 | mAP | R1 | R10 | R20 | mAP | R1 | R10 | R20 | mAP | R1 | R10 | R20 | mAP |
| Zero-Padding [34] | ICCV-17 | 14.80 | 54.12 | 71.33 | 15.95 | 19.13 | 61.40 | 78.41 | 10.89 | 20.58 | 68.38 | 85.79 | 26.92 | 24.43 | 75.86 | 91.32 | 18.86 |
| cmGAN [4] | IJCAI-18 | 26.97 | 67.51 | 80.56 | 27.80 | 31.49 | 72.74 | 85.01 | 22.27 | 31.63 | 77.23 | 89.18 | 42.19 | 37.00 | 80.94 | 92.11 | 32.76 |
| D2RL [32] | CVPR-19 | 28.90 | 70.60 | 82.40 | 29.20 | - | - | - | - | - | - | - | - | - | - | - | - |
| Hi-CMD [3] | CVPR-20 | 34.94 | 77.58 | - | 35.94 | - | - | - | - | - | - | - | - | - | - | - | - |
| JSIA-RefID [28] | AAAI-20 | 38.10 | 80.70 | 89.90 | 36.90 | 45.10 | 85.70 | 93.80 | 29.50 | 43.80 | 86.20 | 94.20 | 52.90 | 52.70 | 91.10 | 96.40 | 42.70 |
| AlignGAN [29] | ICCV-19 | 42.40 | 85.00 | 93.70 | 40.70 | 51.50 | 89.40 | 95.70 | 33.90 | 45.90 | 87.60 | 94.40 | 54.30 | 57.10 | 92.70 | 97.40 | 45.30 |
| cm-SFST(sq) [20] | CVPR-20 | 47.70 | - | - | 54.10 | - | - | - | - | 57.40 | - | - | 59.10 | - | - | - | - |
| XIV [15] | AAAI-20 | 49.92 | 89.79 | 95.96 | 50.73 | - | - | - | - | - | - | - | - | - | - | - | - |
| DDAG [39] | ECCV-20 | 54.75 | 90.39 | 95.81 | 53.02 | - | - | - | - | 61.02 | 94.06 | 98.41 | 67.98 | - | - | - | - |
| LbA [25] | ICCV-21 | 55.41 | - | - | 54.1 | 57.4 | - | - | 59.1 | - | - | - | - | - | - | - | - |
| NFS [2] | CVPR-21 | 56.91 | 91.34 | 96.52 | 55.45 | 63.51 | 94.42 | 97.81 | 48.56 | 62.79 | 96.53 | 99.07 | 69.79 | 70.03 | 97.7 | 99.51 | 61.45 |
| HCT [18] | TMM-20 | 61.68 | 93.1 | 97.17 | 57.51 | - | - | - | - | 63.41 | 91.69 | 95.28 | 68.17 | - | - | - | - |
| CM-NAS [7] | ICCV-21 | 61.99 | 92.87 | 97.25 | 60.02 | 68.68 | 94.92 | 98.36 | 53.45 | 67.01 | 97.02 | 99.32 | 72.95 | 76.48 | 98.68 | 99.91 | 65.11 |
| MCLNet [8] | ICCV-21 | 65.40 | 93.33 | 97.14 | 61.98 | - | - | - | - | 72.56 | 96.98 | 99.20 | 76.58 | - | - | - | - |
| SMCL [33] | ICCV-21 | 67.39 | 92.87 | 96.76 | 61.78 | 72.15 | 90.66 | 94.32 | 54.93 | 68.84 | 96.55 | 98.77 | 75.56 | 79.57 | 95.33 | 98.00 | 66.57 |
| MPANet [35] | CVPR-21 | 70.58 | 96.21 | 98.80 | 68.24 | 75.58 | 97.91 | 99.43 | 62.91 | 76.74 | 98.21 | 99.57 | 80.95 | 84.22 | 99.66 | 99.96 | 75.11 |
| CMT(our) | ECCV-22 | 71.88 | 96.45 | 98.87 | 68.57 | 80.23 | 97.91 | 99.53 | 63.13 | 76.9 | 97.68 | 99.64 | 79.91 | 84.87 | 99.41 | 99.97 | 74.11 |
+
+the last convolutional block from 2 to 1. For each mini-batch, we randomly choose 8 identities from each modality and sample 8 person images for each identity. The input images are first resized to $384 \times 144$ , then we adopt random cropping with zero-padding, random horizontal flipping, and random erasing for data augmentation. In addition, we use the Adam optimizer for optimization with an initial learning rate of $3.5 \times 10^{-4}$ , and the weight decay is set to $5 \times 10^{-4}$ . We decay the learning rate by 0.1 and 0.01 at 60 and 90 epochs. The whole training process consists of 120 epochs. The number of part features $p$ is set to 6. The hyper-parameters $\lambda$ is set to 0.2.
+
+# 4.3 Comparison with the State-of-the-art Methods
+
+Comparisons on SYSU-MM01. We compare our CMT with various state-of-the-art methods under both all-search and single-search settings. As shown in Table 1, our CMT ranks either the first or the second among all settings, and sets the new state-of-the-art results in all-search setting, which strongly proves the effectiveness of our method. In the indoor-search setting, our method also performs comparably with the state-of-the-art methods. Based on the results, we have the following observations. (1) Compared with the methods (cmGAN [4], Hi-CMD [3], AlignGAN [29]) that only focus on learning modality-shared features by feature disentanglement, our method achieves much better performance on all settings. This is because the modality-shared features lose some useful identity information, such as colors. Therefore, with modality-shared cues only, the upper bound of the discrimination ability of the feature representation is limited. Differently, we design a modality-level alignment module to adaptively compensate for the lacking modality-special information via a transformer encoder-decoder architecture. (2) Compared with the best modality compensation method (i.e., cm-SSFT [20] in a multi-query setting), our method improves the Rank-1 accuracy and mAP by $10.28\%$ and $5.37\%$ in the all-search single shot setting. The reason is that the compensated features in [20] are produced solely based on
+
+Table 2. Comparison of the Rank-k accuracy (%) and mAP (%) performances with state-of-the-art methods on RegDB.
+
+| Method | Venue | Visible to Infrared | Infrared to Visible |
| R1 | R10 | R20 | mAP | R1 | R10 | R20 | mAP |
| Zero-Padding [34] | ICCV-17 | 17.75 | 34.21 | 44.35 | 18.90 | 16.63 | 34.68 | 44.25 | 17.82 |
| D²RL [32] | CVPR-19 | 43.4 | 66.1 | 76.3 | 44.1 | - | - | - | - |
| JSIA-ReID [28] | AAAI-20 | 48.50 | - | - | 48.90 | - | - | - | - |
| AlignGAN [29] | ICCV-19 | 57.90 | - | - | 53.60 | 56.30 | - | - | 53.40 |
| XIV [15] | AAAI-20 | - | - | - | - | 62.21 | 83.13 | 91.72 | 60.18 |
| cm-SSFT(sq) [20] | CVPR-20 | 65.4 | - | - | 65.6 | 63.8 | - | - | 64.2 |
| DDAG [39] | ECCV-20 | 69.34 | 86.19 | 91.49 | 63.46 | 68.06 | 85.15 | 90.31 | 61.80 |
| Hi-CMD [3] | CVPR-20 | 70.93 | 86.39 | - | 66.04 | - | - | - | - |
| LbA [25] | ICCV-21 | 74.17 | - | - | 67.64 | 72.43 | - | - | 65.46 |
| MCLNet [8] | ICCV-21 | 80.31 | 92.70 | 96.03 | 73.07 | 75.93 | 90.93 | 94.59 | 69.49 |
| NFS [2] | CVPR-21 | 80.54 | 91.96 | 95.07 | 72.1 | 77.95 | 90.45 | 93.62 | 69.79 |
| MPANet [35] | CVPR-21 | 83.7 | - | - | 80.9 | 82.8 | - | - | 80.7 |
| SMCL [33] | ICCV-21 | 83.93 | - | - | 79.83 | 83.05 | - | - | 78.57 |
| CM-NAS [7] | ICCV-21 | 84.54 | 95.18 | 97.85 | 80.32 | 82.57 | 94.51 | 97.37 | 78.31 |
| HCT [18] | TMM-20 | 91.05 | 97.16 | 98.57 | 83.28 | 89.3 | 96.41 | 98.16 | 81.46 |
| CMT(our) | ECCV-22 | 95.17 | 98.82 | 99.51 | 87.3 | 91.97 | 97.92 | 99.07 | 84.46 |
+
+the samples of the current mini-batch. This strategy suffers from a certain randomness, and does not match the default single query settings of most methods. Notably, we introduce several modality prototypes to store the global modality characteristics without relying on the current mini-batch. (3) Compared with JSIA-ReID [28] that is based on instance-level alignment between the cross-modality paired images generated by the GAN, our method acquires a better performance in all results. This is because different from JSIA-ReID, we exploit query-adaptive feature modulation to conduct more diverse and flexible instance-level alignment. In our method, the gallery instances can be adaptively refined according to the query features, while other methods do not take this into account.
+
+Comparisons on RegDB. As shown in Table 2, it can be seen that our CMT has distinct advantages over the state-of-the-art methods on RegDB. Under the Visible to Infrared setting, compared with the state-of-the-art HCT [18], our method improves the Rank-1 accuracy and mAP by $4.12\%$ and $4.02\%$ . When switching to the Infrared to Visible setting, our method surpasses the HCT by $4.02\%$ and $3\%$ in terms of the Rank-1 accuracy and the mAP, respectively. Hence, it can be proved that our proposed method is robust against different query settings.
+
+# 4.4 Ablation Study
+
+In this section, we perform detailed ablation studies on SYSU-MM01 dataset under the all-search setting to evaluate each component of our CMT. We denote the Modality-level Alignment Module as MAM and the Instance-level Alignment Module as IAM. The results are shown in Table 3.
+
+Baseline. We adopt the HCT [18] as our baseline method, which explores the two-stream network with shared parameters and uses a hetero-center based
+
+Table 3. Analysis of the effectiveness of different components on SYSU-MM01 dataset under the all-search setting. Rank-k accuracy (\%) and mAP (\%) are reported.
+
+| Base | MAM | IAM | Rank-1 | Rank-10 | Rank-20 | mAP |
| ✓ | X | X | 65.35 | 93.57 | 97.58 | 64.27 |
| ✓ | ✓ | X | 70.55 | 95.27 | 98.21 | 66.50 |
| ✓ | X | ✓ | 68.5 | 94.21 | 98.34 | 67.25 |
| ✓ | ✓ | ✓ | 71.88 | 96.45 | 98.87 | 68.57 |
+
+
+(a)
+
+
+(b)
+Fig.3. The effect of weight $\lambda$ in Equation (15) on SYSU-MM01 dataset under the all-search setting and the number of parts $p$ on RegDB dataset. Rank-1 and mAP (\%) are reported.
+
+triplet loss to improve the traditional triplet loss. In addition, we replace the optimizer with the Adam optimizer and add random erasing as extra data augmentation. The details of the implementation can be found in Section 4.2.
+
+Effectiveness of the Modality-level Alignment. Compared with the baseline model, the modality-level alignment module improves the Rank-1 accuracy and mAP by $5.2\%$ and $2.23\%$ . The improvements can be mainly ascribed to two reasons. For one thing, we automatically explore the modality prototypes by the modality consistency constraint, which can adaptively learn the modality-related information. The other reason is that, we conduct the modality feature compensation by the transformer, which can project the features of different modalities into a common complete space to achieve a better modality-level alignment.
+
+Effectiveness of the Instance-level Alignment. Compared with the baseline model, adding the instance-level alignment, the performance is greatly improved by $2.98\%$ and up to $67.25\%$ mAP. Besides, on top of the modality-level alignment, the instance-level alignment can still achieve $2.07\%$ improvements in mAP. This shows that the instance-level alignment is useful to reduce the distances of the samples in the same class. The complete version of our CMT gives the best results on SYSU-MM01 dataset under all-search setting, achieving a whopping accuracy gain of $6.53\%$ and $4.3\%$ on in Rank-1 and mAP, which proves the effectiveness of CMT.
+
+
+(a) RGB modality $(\pmb{F}^R$ and $\widehat{\pmb{F}}^{R}$
+
+
+(b) IR modality $(\pmb{F}^l$ and $\widehat{\pmb{F}}^l)$
+Fig. 4. The t-SNE visualization of features on SYSU-MM01 dataset.The colors represent different categories. Circles represent original RGB/IR features and triangles represent compensated RGB/IR features.
+
+# 4.5 Model Analysis
+
+Parameters Analysis. We first evaluate the effect of the weight $\lambda$ in Equation (15) on SYSU-MM01 dataset under the all-search setting. The Rank-1 and the mAP results of CMT with different $\lambda$ are exhibited in Figure 3 (a). The most suitable parameter setting is to set $\lambda$ as 0.2. Then, we compare the performance of CMT and our baseline model HCT [18] with different number of parts $p$ . As shown in Figure 3 (b), with $p$ increasing, the performance keeps improving before $p$ arrives 6 on RegDB dataset. This is because a bigger $p$ allows the network to pay more attention to the details. Besides, we can observe that CMT shows surprisingly powerful results and significant improvements over the baseline under the same $p$ setting. Compared with the HCT, CMT is more robust to $p$ , which further verifies the effectiveness of our method.
+
+Visualization Analysis. To further verify the effectiveness of our modality-level alignment module, we use t-SNE [22] to visualize the original modality features $(\mathbf{F}^R$ and $\mathbf{F}^I)$ and the compensated modality features $(\hat{\mathbf{F}}^R$ and $\hat{\mathbf{F}}^I)$ . As shown in Figure 4, compensated RGB/IR features are aligned with original RGB/IR features of the same ID in the feature space. It proves that our work can compensate for the lacking modality information to achieve a better modality-level alignment.
+
+# 5 Conclusion
+
+In this paper, we propose a novel Cross-Modality Transformer (CMT) to jointly explore a modality-level alignment module and an instance-level module for VI-REID. The proposed modality-level alignment module is able to compensate for the missing modality-specific information via a Transformer encoder-decoder architecture. We have also designed an instance-level alignment module to adaptively adjust the sample features, which is achieved by query-adaptive feature modulation. Extensive experimental results on two standard benchmarks demonstrate that our model performs favorably against state-of-the-art methods.
+
+Acknowledgments This work was partially supported by the National Nature Science Foundation of China (62022078, 12150007, 62021001), National Defense Basic Scientific Research Program (JCKY2020903B002), and University Synergy Innovation Program of Anhui Province No. GXXT-2019-025.
+
+# References
+
+1. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: European conference on computer vision. pp. 213-229. Springer (2020)
+2. Chen, Y., Wan, L., Li, Z., Jing, Q., Sun, Z.: Neural feature search for rgb-infrared person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 587-597 (2021)
+3. Choi, S., Lee, S., Kim, Y., Kim, T., Kim, C.: Hi-cmd: Hierarchical cross-modality disentanglement for visible-infrared person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 10257-10266 (2020)
+4. Dai, P., Ji, R., Wang, H., Wu, Q., Huang, Y.: Cross-modality person re-identification with generative adversarial training. In: International Joint Conference on Artificial Intelligence. vol. 1, p. 2 (2018)
+5. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
+6. Feng, Z., Lai, J., Xie, X.: Learning modality-specific representations for visible-infrared person re-identification. IEEE Transactions on Image Processing 29, 579-590 (2019)
+7. Fu, C., Hu, Y., Wu, X., Shi, H., Mei, T., He, R.: Cm-nas: Cross-modality neural architecture search for visible-infrared person re-identification. arXiv preprint arXiv:2101.08467 (2021)
+8. Hao, X., Zhao, S., Ye, M., Shen, J.: Cross-modality person re-identification via modality confusion and center aggregation. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 16403-16412 (2021)
+9. Hao, Y., Wang, N., Li, J., Gao, X.: Hsme: hypersphere manifold embedding for visible thermal person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 33, pp. 8385-8392 (2019)
+0. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 770-778 (2016)
+1. He, S., Luo, H., Wang, P., Wang, F., Li, H., Jiang, W.: Transreid: Transformer-based object re-identification. arXiv preprint arXiv:2102.04378 (2021)
+2. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7132-7141 (2018)
+3. Jiang, K., Zhang, T., Zhang, Y., Wu, F., Rui, Y.: Self-supervised agent learning for unsupervised cross-domain person re-identification. IEEE Transactions on Image Processing 29, 8549–8560 (2020)
+4. Kniaz, V.V., Knyaz, V.A., Hladuvka, J., Kropatsch, W.G., Mizginov, V.: Thermalgan: Multimodal color-to-thermal image translation for person re-identification in multispectral dataset. In: Proceedings of the European Conference on Computer Vision Workshops. pp. 0–0 (2018)
+5. Li, D., Wei, X., Hong, X., Gong, Y.: Infrared-visible cross-modal person re-identification with an x modality. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 4610-4617 (2020)
+6. Li, W., Zhu, X., Gong, S.: Harmonious attention network for person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 2285–2294 (2018)
+
+17. Li, Y., He, J., Zhang, T., Liu, X., Zhang, Y., Wu, F.: Diverse part discovery: Occluded person re-identification with part-aware transformer. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2898-2907 (2021)
+18. Liu, H., Tan, X., Zhou, X.: Parameter sharing exploration and hetero-center triplet loss for visible-thermal person re-identification. IEEE Transactions on Multimedia (2020)
+19. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 10012-10022 (2021)
+20. Lu, Y., Wu, Y., Liu, B., Zhang, T., Li, B., Chu, Q., Yu, N.: Cross-modality person re-identification with shared-specific feature transfer. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 13379–13389 (2020)
+21. Luo, H., Gu, Y., Liao, X., Lai, S., Jiang, W.: Bag of tricks and a strong baseline for deep person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops. pp. 0–0 (2019)
+22. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008)
+23. Nguyen, D.T., Hong, H.G., Kim, K.W., Park, K.R.: Person recognition system based on a combination of body images from visible light and thermal cameras. Sensors 17, 605 (2017)
+24. Oh Song, H., Xiang, Y., Jegelka, S., Savarese, S.: Deep metric learning via lifted structured feature embedding. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4004-4012 (2016)
+25. Park, H., Lee, S., Lee, J., Ham, B.: Learning by aligning: Visible-infrared person re-identification using cross-modal correspondences. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 12046–12055 (2021)
+26. Sun, Y., Zheng, L., Yang, Y., Tian, Q., Wang, S.: Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In: Proceedings of the European Conference on Computer Vision. pp. 480-496 (2018)
+27. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems. pp. 5998-6008 (2017)
+28. Wang, G.A., Zhang, T., Yang, Y., Cheng, J., Chang, J., Liang, X., Hou, Z.G.: Cross-modality paired-images generation for rgb-infrared person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 12144–12151 (2020)
+29. Wang, G., Zhang, T., Cheng, J., Liu, S., Yang, Y., Hou, Z.: Rgb-infrared cross-modality person re-identification via joint pixel and feature alignment. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 3623-3632 (2019)
+30. Wang, G., Yuan, Y., Chen, X., Li, J., Zhou, X.: Learning discriminative features with multiple granularities for person re-identification. In: Proceedings of the ACM International Conference on Multimedia. pp. 274-282 (2018)
+31. Wang, W., Xie, E., Li, X., Fan, D.P., Song, K., Liang, D., Lu, T., Luo, P., Shao, L.: Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 568-578 (2021)
+
+32. Wang, Z., Wang, Z., Zheng, Y., Chuang, Y.Y., Satoh, S.: Learning to reduce dual-level discrepancy for infrared-visible person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 618-626 (2019)
+33. Wei, Z., Yang, X., Wang, N., Gao, X.: Syncretic modality collaborative learning for visible infrared person re-identification. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 225–234 (2021)
+34. Wu, A., Zheng, W.S., Yu, H.X., Gong, S., Lai, J.: RGB-infrared cross-modality person re-identification. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 5380-5389 (2017)
+35. Wu, Q., Dai, P., Chen, J., Lin, C.W., Wu, Y., Huang, F., Zhong, B., Ji, R.: Discover cross-modality nuances for visible-infrared person re-identification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4330-4339 (2021)
+36. Yang, X., Zhou, P., Wang, M.: Person reidentification via structural deep metric learning. IEEE Transactions on Neural Networks and Learning Systems 30(10), 2987-2998 (2018)
+37. Ye, M., Lan, X., Leng, Q., Shen, J.: Cross-modality person re-identification via modality-aware collaborative ensemble learning. IEEE Transactions on Image Processing 29, 9387–9399 (2020)
+38. Ye, M., Lan, X., Li, J., Yuen, P.: Hierarchical discriminative learning for visible thermal person re-identification. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 32 (2018)
+39. Ye, M., Shen, J., J. Crandall, D., Shao, L., Luo, J.: Dynamic dual-attentive aggregation learning for visible-infrared person re-identification. In: Proceedings of the European Conference on Computer Vision. pp. 229-247. Springer (2020)
+40. Ye, M., Shen, J., Lin, G., Xiang, T., Shao, L., Hoi, S.C.: Deep learning for person re-identification: A survey and outlook. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021)
+41. Ye, M., Wang, Z., Lan, X., Yuen, P.C.: Visible thermal person re-identification via dual-constrained top-ranking. In: International Joint Conference on Artificial Intelligence. vol. 1, p. 2 (2018)
+42. Zheng, L., Yang, Y., Hauptmann, A.G.: Person re-identification: Past, present and future. arXiv preprint arXiv:1610.02984 (2016)
+43. Zheng, W.S., Gong, S., Xiang, T.: Reidentification by relative distance comparison. IEEE Transactions on Pattern Analysis and Machine Intelligence 35(3), 653-668 (2012)
+44. Zhong, Z., Zheng, L., Cao, D., Li, S.: Re-ranking person re-identification with k-reciprocal encoding. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 1318-1327 (2017)
+45. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J.: Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159 (2020)
\ No newline at end of file
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/images.zip b/crossmodalitytransformerforvisibleinfraredpersonreidentification/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..22d40bbefca94c1853ec316b005c7b10f212ee48
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d12af2c54ae7b6ff54ddb2a3e6df42e45aa4dcdbe93ddb8fc04390aaf225637e
+size 461539
diff --git a/crossmodalitytransformerforvisibleinfraredpersonreidentification/layout.json b/crossmodalitytransformerforvisibleinfraredpersonreidentification/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c42434c7e7118a5f104c3381dd719034c2e6a786
--- /dev/null
+++ b/crossmodalitytransformerforvisibleinfraredpersonreidentification/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0721f54576bd0fe5c3c29443630b17dedb303877abc21e50cff62bc5f75c2255
+size 426314
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_content_list.json b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f93811149d2f6807e68536355286b620378689f8
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0538ef540f693327096cbd1f27f7eb969c5966a39fd86b3a36f652fc4f0fcf9
+size 78845
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_model.json b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..46006e6e7a191043c8fadca097ee3061ad373b45
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1f412166ad50cb5c7c64a18fcb920740c8944779a71433b3c74f50f8d1379caa
+size 95244
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_origin.pdf b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..80beba75facb08b99d2b37b12dfc615b0c05f0d1
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/01c49bfa-2068-4b17-9d54-d3611c674925_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85a36815edbffd8b2d6833b7d7ae24a3ecd7927c2eab23ac89d0bb75de56805d
+size 1386768
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/full.md b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..999a8e45e9dfdb7b1d4b67661a2f977d50ae3318
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/full.md
@@ -0,0 +1,271 @@
+# Cross-Modal Knowledge Transfer Without Task-Relevant Source Data
+
+Sk Miraj Ahmed1, Suhas Lohit2, Kuan-Chuan Peng2, Michael J. Jones2, and Amit K. Roy-Chowdhury1
+
+1 University of California, Riverside, CA 92507, USA
+
+{sahme047@,amitrc@ece.}ucr.edu
+
+$^{2}$ Mitsubishi Electric Research Laboratories (MERL), Cambridge, MA 02139, USA
+
+https://www.merl.com{slohit, kpeng,mjones}@merl.com
+
+Abstract. Cost-effective depth and infrared sensors as alternatives to usual RGB sensors are now a reality, and have some advantages over RGB in domains like autonomous navigation and remote sensing. As such, building computer vision and deep learning systems for depth and infrared data are crucial. However, large labeled datasets for these modalities are still lacking. In such cases, transferring knowledge from a neural network trained on a well-labeled large dataset in the source modality (RGB) to a neural network that works on a target modality (depth, infrared, etc.) is of great value. For reasons like memory and privacy, it may not be possible to access the source data, and knowledge transfer needs to work with only the source models. We describe an effective solution, SOCKET:SOource-free Cross-modal Knowledge Transfer for this challenging task of transferring knowledge from one source modality to a different target modality without access to task-relevant source data. The framework reduces the modality gap using paired task-irrelevant data, as well as by matching the mean and variance of the target features with the batch-norm statistics that are present in the source models. We show through extensive experiments that our method significantly outperforms existing source-free methods for classification tasks which do not account for the modality gap.
+
+# 1 Introduction
+
+Depth sensors like Kinect and RealSense, LIDAR for measuring point clouds directly, or high resolution infra-red sensors such as from FLIR, allow for expanding the range of applications of computer vision compared to using only visible wavelengths. Sensing depth directly can provide an approximate three-dimensional picture of the scene and thus improve the performance of applications like autonomous navigation, while sensing in the infra-red wavelengths can allow for easier pedestrian detection or better object detection in adverse atmospheric conditions like rain, fog, and smoke. These are just a few examples.
+
+Building computer vision applications using the now-straightforward supervised deep learning approach for modalities like depth and infrared needs large
+
+
+Fig.1. SOCKET: We describe the problem of single/multi-source cross-modality knowledge transfer using no data used to train the source models. To effectively perform knowledge transfer, we minimize the modality gap by enforcing consistency of cross modal features on task-irrelevant paired data in feature space, and by matching the distributions of the unlabeled task-relevant features and the source features
+
+amounts of diverse labeled data. However, such large and diverse datasets do not exist for these modalities and the cost of building such datasets can be prohibitively high. In such cases, researchers have developed methods like knowledge distillation to transfer the knowledge from a model trained on a modality like RGB, where large amounts of labeled data are available, to the modality of interest like depth [1].
+
+In contrast to prior work, we tackle a novel and challenging problem in the context of cross-modal knowledge transfer. We assume that we have access only to (a) the source models trained for the task of interest (TOI), and (b) unlabeled data in the target modality where we need to construct a model for the same TOI. The key aspect is that we assume we have no access to any data in the source modality for TOI. Such a problem setup is important in cases where memory and privacy considerations do not allow for sharing the training data from the source modality; only the trained models can be shared [2-5].
+
+We develop SOCKET: SOource-free Cross-modal Knowledge Transfer as an effective solution to this problem for bridging the gap between the source and target modalities. To this end, we show that employing an external dataset of source-target modality pairs, which are not relevant to TOI - which we call Task-Irrelevant (TI) data - can help in learning an effective target model by bringing the features of the two modalities closer. In addition to using TI data, we encourage matching the statistics of the features of the unlabeled target data - which are Task-Relevant (TR) by definition - with the statistics of the source data which are available to us from the normalization layers that are present in the trained source model.
+
+We provide important empirical evidence showing that the modality-shift from a source modality like RGB to a target modality like depth can be much more challenging than a domain shift from one RGB dataset to another. This shows that the proposed framework is necessary to help minimize the modality
+
+gap, so as to make the knowledge transfer more effective. Based on the above ideas, we show that we can improve on existing state-of-the-art methods which were devised only for cross-domain setting in the same modality. We summarize our main contributions below:
+
+1. We formulate a novel problem for knowledge transfer from a model trained for a source modality to a different target modality without any access to task-relevant source data and when the target data is unlabeled.
+2. In order to bridge the gap between modalities, we propose a novel framework, SOCKET, for cross-modal knowledge transfer without access to source data (a) using an external task-irrelevant paired dataset, and (b) by matching the moments obtained from the normalization layers in the source models with the moments computed on the unlabeled target data.
+3. Extensive experiments on multiple datasets - both for knowledge transfer from RGB to depth, and from RGB to IR, and both for single-source and multi-source cases - show that SOCKET is useful in reducing the modality gap in the feature space and produces significantly better performance (improvement of as high as $12\%$ for some cases) over the existing source-free domain adaptation baselines which do not account for the modality difference between the source and target modalities.
+4. We also show empirically that, for the datasets of interest, the problem of knowledge transfer between modalities like RGB and depth is harder than domain shifts in the same modality such as sensor changes and viewpoint shifts, considered previously in literature.
+
+# 2 Related work
+
+Cross-modal distillation methods. Cross-modal knowledge distillation (CMKD) methods aim to learn representations for a modality which does not have a large amount of labeled data from a large labeled dataset of another modality [1]. These methods have been used for a variety of practical computer vision and learning tasks [6-9]. Most of these works assume access to task-relevant paired data across modalities [1, 8, 10, 11]. A recent line of work relaxed this assumption in the context of domain generalization, where one does not have access to the Task-Relevant paired data on the target domain but has access to them for the source domain [12]. There also exist some works regarding domain translation across modalities for better classification of indoor scenes [13-15]. However these methods consider UDA across domains, where the target domain has unlabeled RGB-D pairs instead of a single modality. All of the above works either utilize the Task-Relevant paired data for cross modal knowledge transfer [1], or consider cross modal paired data as a domain [12, 13]. There are also works in zero-shot domain adaptation that utilize external task-irrelevant paired data [16] but need access to the source data. Our work takes steps to allow for different source and target modalities, and can perform effective knowledge transfer without access to the TR paired data between source and target.
+
+Table 1. We compare the proposed work SOCKET with existing problem settings in literature for knowledge transfer across different domains and modalities. The competitive settings described in this table are: (1) UDA (Unsupervised Domain Adaptation), DT (Domain Translation) [13-15, 17-20] $\left[\mathcal{C}_1\right]$ , (2) MSDA (Multi-source domain adaptation) [21] $\left[\mathcal{C}_2\right]$ , (3) SFDA (Source free single source DA) [3, 22-26] $\left[\mathcal{C}_3\right]$ , (4) MSFDA (Source free multi-source DA) [4] $\left[\mathcal{C}_4\right]$ , (5) CMKD (Cross modal knowledge distillation) [1, 6-8] $\left[\mathcal{C}_5\right]$ , and (6) ZDDA (Zero shot DA) [16] $\left[\mathcal{C}_6\right]$ , respectively. We group citations into $\left[\mathcal{C}_1\right]$ to $\left[\mathcal{C}_6\right]$ based on problem settings. Only SOCKET allows cross-modal knowledge transfer from multiple sources without any access to relevant source training data for an unlabeled target dataset of a different modality
+
+| Property\Problem setting | UDA+DT [C1] | MSDA [C2] | SFDA [C3] | MSFDA [C4] | CMKD [C5] | ZDDA [C6] | SOCKET |
| Multiple sources | X | ✓ | X | X | X | X | ✓ |
| No source data | X | X | ✓ | ✓ | X | X | ✓ |
| Unlabeled target data | ✓ | ✓ | X | ✓ | X | X | ✓ |
| Different target modality | X | X | X | X | ✓ | ✓ | ✓ |
| Usage of Task-Irrelevant Data | X | X | X | X | X | ✓ | ✓ |
+
+Unsupervised domain adaptation methods without source data. Most UDA methods that have been used for a wide variety of tasks [17-20] need access to the source data while adapting to a new target domain [21, 27]. To combat the storage or privacy issue regarding the source data, a new line of work named Hypothesis Transfer Learning (HTL) [2, 5] has emerged recently, where one has access only to the trained source model instead of the source data [3, 4]. Here, people have explored adapting target domain data, which has limited labels [2] or no labels at all [3] in the presence of both single source [3, 22, 23] or multiple source models [4]. [3, 26] adapts a single source model to an unlabeled target domain via information maximization and an iterative self-supervised pseudo-label based cross entropy loss. [22] ensured that the adapted source model performs well, both on source and target domains, while [23] proposed a source free domain adaptation (SFDA) method by encouraging label consistency among local target features. [24] proposed to add an extra classifier for refinement of the source decision boundary, while [25] proposed a more robust adaptation method which works well in the presence of noisy pseudo-labels. The authors in [4] proposed fusion of multiple source models with appropriate weights so as to minimize the effect of negative transfer, which we refer to as multiple source free domain adaptation (MSFDA) in Table 1. Both these methods do not work well in a regime where the unlabeled target set is from a different modality than the source. We solve this problem by modality gap reduction via feature matching of the task-irrelevant external data, as well as data statistics matching between the source and target modalities.
+
+Table 1 summarizes the related work and compares them with SOCKET.
+
+
+Fig. 2. SOCKET description: Our framework can be split into two parts: (i) Before Knowledge Transfer (left): We freeze the source models and pass the task-irrelevant (TI) source data through the source feature encoders to extract the TI source features. As task-relevant (TR) source feature maps are not available, we extract the stored moments of its distribution from the BN layers. (ii) During Knowledge Transfer (right): We freeze only the classification layers and feed the TI and unlabeled TR target data through the models to get batch-wise TI target features and the TR target moments, respectively, which we match with pre-extracted source features and moments to jointly train all the feature encoders along with the mixing weights, $\zeta_k$ 's. The final target model is the optimal linear combination of the updated source models
+
+
+
+# 3 Problem setup and notation
+
+We address the problem of source-data free cross-modality knowledge transfer by devising specialized loss functions that help reduce the gap between source and target modality features. We focus on the task of classification where both the source and target data belong to the same $N$ classes. Let us consider that we have $n$ source models of the same modality (e.g., RGB). We denote the trained source classifiers as $\{\mathcal{F}_{S_k}^{m_S}\}_{k=1}^n$ , where $S_k$ denotes the $k$ -th source model and $m_S$ represents the modality on which the source models were trained. The source models are denoted as $\mathcal{F}_{S_k}^{m_S}$ which are trained models that map images from the source modality distribution $\mathcal{X}_{S_k}^{m_S}$ to probability distribution over the classes. $\{x_{S_k}^i, y_{S_k}^i\}_{i=1}^{n_k} \sim \mathcal{X}_{S_k}^{m_S}$ are the data on which the $k$ -th source model was trained, $n_k$ being the number of training data points corresponding to the $k$ -th source. In our problem setting, at the time of knowledge transfer to the target modality, the source data are unavailable for all the sources.
+
+We also have access to an unlabeled dataset in the target modality $\{x_T^i\}_{i = 1}^{n_T}\sim \mathcal{X}_T^{m_T}$ , where $n_T$ is the number of target samples. Note that the target modality, $m_{T}$ , is different from the source modality. Traditional source free UDA methods try to mitigate domain shift by adapting the source models to unlabeled target data that belong to the same modality [3, 4]. As we will show, applying these methods directly to the cross-modal setting results in poor performance. Hence, we propose to solve this problem using two novel losses as regularization terms which minimize the modality gap between source and target modalities. Our
+
+goal is to learn a target classifier $\mathcal{F}_T^{m_T}$ , that adapts well on a target distribution obtained from a different sensor modality (e.g., depth or NIR).
+
+To train $\mathcal{F}_T^{m_T}$ , we employ (a) methods that enable learning feature embeddings for the target modality that closely match with the source modality embeddings, which we group under modality-specific losses, since it bridges the gap between two different modalities; (b) modality-agnostic loss terms which operate only on the unlabeled target data and do not take into account shift in modality.
+
+We split each of the source models into two blocks - feature encoder and classifier. For the $k$ -th source model, we denote these blocks as $f_{k}$ and $g_{k}$ , respectively. The function $f_{k}:\mathbb{R}^{H\times W}\to \mathbb{R}^{\eta}$ maps the input image to an $\eta$ dimensional feature vector and $g_{k}:\mathbb{R}^{\eta}\to \mathbb{R}^{N}$ maps those features to the probability distributions over the $N$ classes, the maximum of which is treated as the classifier prediction. We can thus write $\mathcal{F}_{S_k}^{ms} = g_k\circ f_k$ , where “ $\circ$ ” is a function composition. Since the classifier layer $g_{k}$ contains the information about unseen $k$ -th source domain distribution, following the protocol of [4], we freeze all the $g_{k}$ 's and train the target specific feature encoders by optimizing over all $f_{k}$ 's.
+
+# 4 Cross-Modal Feature Alignment
+
+Traditional source free UDA methods [3, 4] use domain specific but modality-agnostic losses which do not help in reducing the feature distance between the source and target modalities. In order to train the target model, $\mathcal{F}_T^{m_T}$ , with reduced modality-gap, we propose SOCKET, which uses task-irrelevant feature matching and task-relevant distribution matching which are described next.
+
+# 4.1 Task-irrelevant feature matching
+
+Capturing the mapping between two modalities effectively requires lots of paired data from both modalities [28]. For our task of interest, we do not have task relevant (TR) data on the source side. As a result, it is not possible to match the target modality with the source modality by using the data from task relevant classes directly. Hence, we propose to use Task-Irrelevant (TI) paired data from both modalities to reduce modality gap. TI data contain only classes that are completely disjoint from the TR classes and can be from any external dataset. For modalities like RGB-depth and RGB-IR, we can access a large amount of paired TI data that contain classes with no privacy concerns, which are available in public datasets or can be collected using multi-modal sensors. Moreover there are many real world applications where pairwise TI data can be collected and used beyond RGB-D or RGB-IR, such as autonomous driving, adaptation of LiDAR data, medical applications [29]. We denote paired TI data as $\{x_{TI_i}^{m_S}, x_{TI_i}^{m_T}\}_{i=1}^{n_{TI}}$ , where $x_{TI_i}^{m_S}$ is the $i$ -th TI data point from source modality and $x_{TI_i}^{m_T}$ is its paired counterpart from the target modality, $n_{TI}$ the total number of pairs. We compute our proposed loss $\mathcal{L}_{TI}$ using TI data as follows:
+
+Step 1: We feed source modality images of the TI dataset through each of the source models to pre-compute features that are good representations of modality
+
+$m_{S}$ . We denote the $i$ -th TI source feature extracted from source $j$ as $\psi_j^i$ :
+
+$$
+\psi_ {j} ^ {i} = f _ {j} \left(x _ {T I _ {i}} ^ {m _ {S}}\right). \tag {1}
+$$
+
+Step 2: During the knowledge transfer phase, we feed the target modality images of the TI dataset which are encouraged to match the corresponding pre-extracted source modality features. We do so by minimizing $\mathcal{L}_{TI}$ defined below with respect to the parameters in the feature encoders for the target modality:
+
+$$
+\mathcal {L} _ {T I} = \sum_ {i = 1} ^ {n _ {T I}} \sum_ {j = 1} ^ {n} \left\| \zeta_ {j} \left(\psi_ {j} ^ {i} - f _ {j} \left(x _ {T I _ {i}} ^ {m _ {T}}\right)\right) \right\| ^ {2}. \tag {2}
+$$
+
+# 4.2 Task-relevant distribution matching
+
+In the task-irrelevant feature matching, we match the TI features of two modalities in the feature space. Even if this captures some class independent cross modal mapping between source and target modalities, it has no information about the TR-class conditional cross modal mapping. By this term we refer to the cross modal relationship between source and target, given the relevant classes. Assuming that the marginal distribution of the source features across the batches can be modeled as Gaussian, such feature statistics can be fully characterized by its mean and variance. We propose to match the feature statistics across the source and target, to reduce the modality gap further.
+
+It might seem as though some amount of source data would be required to estimate the batch-wise mean and variance of its feature map, but the running average statistics stored in the conventional BatchNorm (BN) layers are good enough to serve our purpose. The BN layers normalize the feature maps during the course of training to mitigate the covariate shifts [30, 31]. As a result it is able to capture the channel-wise feature statistics cumulatively over all the batches, which gives rise to a rough estimate of the expected mean and variance of the batch-wise feature map, at the end of training. Let us consider that the BN layer corresponding to the $l$ -th convolution layer $(\mathcal{B}_l)$ has $r_l$ nodes and there exist $b$ number of such layers per source model. Then we refer to the expected batch-wise mean and variance of the $l$ -th convolution layer of the $k$ -th source model as $\mathbb{E}\big[\mu_l|\mathcal{X}_{S_k}^{m_s}\big]\in \mathbb{R}^{r_l}$ and $\mathbb{E}\big[\sigma_l^2 |\mathcal{X}_{S_k}^{m_s}\big]\in \mathbb{R}^{r_l}$ .
+
+Prior to the start of the knowledge transfer phase, we pre-extract the information about the source feature statistics from all of the pre-trained source models. During the knowledge transfer phase, for each iteration we calculate the batch-wise mean and variance of the feature map of target data from all the source models, linearly combine them according to the weights $\zeta_{i}$ and minimize the distance of this weighted combination with the weighted combination of the pre-computed source feature statistics. We calculate this loss $\mathcal{L}_d$ given by
+
+$$
+\mathcal {L} _ {d} = \sum_ {l = 1} ^ {b} \left(\left\| \sum_ {j = 1} ^ {n} \zeta_ {j} \mathbb {E} \left[ \mu_ {l} \mid \mathcal {X} _ {S _ {j}} ^ {m _ {S}} \right] - \sum_ {j = 1} ^ {n} \zeta_ {j} \hat {\mu} l _ {j} \right\| + \left\| \sum_ {j = 1} ^ {n} \zeta_ {j} \mathbb {E} \left[ \sigma_ {l} ^ {2} \mid \mathcal {X} _ {S _ {j}} ^ {m _ {S}} \right] - \sum_ {j = 1} ^ {n} \zeta_ {j} \hat {\sigma} ^ {2} l _ {j} \right\|\right), \tag {3}
+$$
+
+where $\mathbb{E}\big[\mu_l|\mathcal{X}_{S_j}^{m_s}\big]$ and $\mathbb{E}\big[\sigma_l^2 |\mathcal{X}_{S_j}^{m_s}\big]$ are the running mean and variance of the batchnorm layer corresponding to the $l$ -th convolution layer of source $j$ , which we refer as $\mathcal{B}_l^j$ , and $\hat{\mu}_{l_j} = \frac{1}{n_T}\sum_{k = 1}^{n_T}\mathcal{B}_l^j (x_T^k)$ and $\hat{\sigma}^2_{l_j} = \frac{1}{n_T}\sum_{k = 1}^{n_T}(\mathcal{B}_l^j (x_T^k) - \hat{\mu}_{l_j})^2$ denote the mean and variance of the target output from the same batchnorm layer. The losses $\mathcal{L}_{TI}$ and $\mathcal{L}_d$ minimize the modality gap between source and target. We name the combination of these two losses as Modality Specific Loss $\mathcal{L}_{ms} = \lambda_{TI}\mathcal{L}_{TI} + \lambda_d\mathcal{L}_d$ , where $\lambda_{TI}$ and $\lambda_{d}$ are regularization hyper-parameters.
+
+# 4.3 Overall optimization
+
+The two proposed methods above help to reduce the modality gap between source and target without accessing task-relevant source data. In addition to them, we employ the unlabeled target data directly for knowledge transfer. Specifically, we perform information maximization along with minimization of a self-supervised pseudo-label loss, which have shown promising results in source-free UDA [3, 4] where the source and target modalities are the same.
+
+Information Maximization (IM): IM is essentially the task of performing maximization of the mutual information between distribution of the target data and its labels predicted by the source models. This mutual information is a combination of a conditional and a marginal entropy of the target label distribution.
+
+Motivated by [4], we calculate the conditional entropy $\mathcal{L}_{ent}$ and the marginal entropy termed as diversity $\mathcal{L}_{div}$ as follows:
+
+$$
+\mathcal {L} _ {e n t} = - \frac {1}{n _ {T}} \Big [ \sum_ {i = 1} ^ {n _ {T}} (\mathcal {F} _ {T} ^ {m _ {T}} (x _ {T} ^ {i})) \log (\mathcal {F} _ {T} ^ {m _ {T}} (x _ {T} ^ {i})) \Big ], \mathcal {L} _ {d i v} = - \sum_ {j = 1} ^ {N} \bar {p} _ {j} \log \bar {p} _ {j}, \quad (4)
+$$
+
+where $\mathcal{F}_T^{m_T}(x_T^i) = \sum_{k=1}^n \zeta_k \mathcal{F}_{S_k}^{m_S}(x_T^i)$ , $\zeta_k$ is the weight assigned to the $k$ -th source such that $\zeta_k \geq 0$ , $\sum_{k=1}^n \zeta_k = 1$ and $\bar{p} = \frac{1}{n_T} \sum_{i=1}^{n_T} \left[ \mathcal{F}_T^{m_T}(x_T^i) \right] \in \mathbb{R}^N$ is the empirical label distribution. The mutual information is calculated as $\mathcal{L}_{IM} = \mathcal{L}_{div} - \mathcal{L}_{ent}$ . Maximization of $\mathcal{L}_{IM}$ (or minimization of $-\mathcal{L}_{IM}$ ) ensures the target labels, as predicted by the sources, more confident and diverse in nature.
+
+Pseudo-label loss: Maximizing $\mathcal{L}_{IM}$ helps to obtain labels that are more confident in prediction and globally diverse. However, that does not prevent mislabeling (i.e., assigning wrong labels to the inputs), which leads to confirmation bias [32]. To alleviate this problem, we adopt a self-supervised pseudo-label based cross entropy loss, inspired by [3, 4] (see the supplement for the exact details about computing the self-supervised pseudo-labels.) After calculating pseudolabels we compute the pseudo-label cross entropy loss $\mathcal{L}_{pl}$ as follows:
+
+$$
+\mathcal {L} _ {p l} = - \frac {1}{n _ {T}} \sum_ {i = 1} ^ {n _ {T}} \sum_ {k = 1} ^ {K} \mathbf {1} \{\hat {y} _ {T} ^ {i} = k \} \log \left[ \mathcal {F} _ {T} ^ {m _ {T}} (x _ {T} ^ {i}) \right] _ {k}, \tag {5}
+$$
+
+where $\hat{y}_T^i$ is the pseudo-label for the $i$ -th target data point and $\mathbf{1}\{\cdot\}$ is an indicator function that gives value 1 when the argument is true. Our final loss is the
+
+combination of the above two losses. We call this combination modality agnostic loss $\mathcal{L}_{ma}$ , which is expressed as $\mathcal{L}_{ma} = -\mathcal{L}_{IM} + \lambda_{pl}\mathcal{L}_{pl}$ .
+
+We calculate the overall objective function as the sum of modality agnostic and modality specific losses and optimize Eq. (6) using Algorithm 1.
+
+$$
+\underset {\left\{f _ {j} \right\} _ {j = 1} ^ {n}, \zeta} {\text {m i n i m i z e}} \quad \mathcal {L} _ {m a} + \mathcal {L} _ {m s} \quad \text {s . t .} \sum_ {k = 1} ^ {n} \zeta_ {k} = 1, \zeta_ {k} \geq 0 \tag {6}
+$$
+
+Algorithm 1: Algorithm to Solve Eq. (6)
+Input: $n$ source models trained on modality $m_S\{\mathcal{F}_{S_k}^{m_S}\}_{k = 1}^n = \{g_k\circ f_k\}_{k = 1}^n$ unlabeled target data $\{x_T^i\}_{i = 1}^{n_T}$ from modality $mT$ , TI cross modal pairs $\{x_{TI_i}^{m_S},x_{TI_i}^{m_T}\}_{i = 1}^{n_{TI}}$ , mixing weights $\{\zeta_k\}_{k = 1}^n$ , max number of epochs $E$ regularization parameters $\lambda_{TI}$ $\lambda_{d}$ , number of batches $B$
+Output: Optimal adapted feature enocoders $\{f_k^*\}_{k = 1}^n$ , mixing weights $\{\zeta_k^*\}_{k = 1}^n$
+Initialization: Freeze final classification layers $\{g_k\}_{k = 1}^n$ , set $\zeta_{k} = \frac{1}{n}$ for all $k$ Calculate $\{\psi_j^i\}_{j = 1}^n\forall i\in [1,2\dots ,n_{TI}]$ using Eq. (1)
+Retrieve $\mathbb{E}\big[\mu_l|\mathcal{X}_{S_j}\big]$ and $\mathbb{E}\big[\sigma_l^2 |\mathcal{X}_{S_j}\big]$ for all $j$ and $l$ as in Section 4.2
+Knowledge Transfer Phase:
+for epoch $= 1$ to $E$ do
+for iteration $= 1$ to $B$ do Sample a mini batch of target data and feed it through each of the source models Calculate loss terms in Eq. (2), (3), (4), and (5) Compute overall objective from Eq. (6) Update parameters in $\{f_j\}_{j = 1}^n$ and $\{\zeta_k\}_{k = 1}^n$ by optimizing (6) Make $\zeta$ non-negative by setting $\zeta_{k}\coloneqq 1 / (1 + e^{-\zeta_{k}})$ Normalize $\zeta$ by setting $\zeta_{k}\coloneqq \zeta_{k} / \sum_{i = 1}^{n}\zeta_{i}$
+end
+end
+Final target model $\mathcal{F}_T^{m_T} = \sum_{k = 1}^n\zeta_k^\star (g_k\circ f_k^\star)$
+
+# 5 Experiments
+
+We first describe the datasets, baselines and experimental details we employ. Next, we show results of single and multi-source cross modal transfer which show the efficacy of our method. In Section 5.3 we demonstrate experimentally why source free cross modal is a much harder problem compared to cross domain knowledge transfer. We conclude this section by performing analysis on different hyperparameters.
+
+# 5.1 Datasets, baselines and experimental details
+
+Datasets: To show the efficacy of our method we extensively test on publicly available cross-modal datasets. We show results on two RGB-D (RGB and
+
+Depth) datasets - SUN RGB-D [33] and DIML RGB+D [34], and the RGB-NIR Scene (RGB and Near Infrared) dataset [35]. We summarize the statistics of the datasets in Table 2. In the supplement, we provide examples from each dataset and the list of classes which we use as TI and TR data in our experiments.
+
+1. SUN RGB-D: A scene understanding benchmark dataset which contains 10335 RGB-D image pairs of indoor scenes. The dataset has images acquired from four different sensors named Kinect version1 (kv1), Kinect version2 (kv2), Intel RealSense and Asus Xtion. We treat these four sensors as four different domains. Out of total 45 classes, 17 common classes are treated as TR classes and the remaining 28 classes as TI classes. To train four source models, one for each domain, we use the RGB images from the TR classes, specific to that particular domain. We treat the TR depth images from each of the domains as the target modality data.
+2. DIML RGB+D: This dataset consists of more than 200 indoor/outdoor scenes. We use the smaller sample dataset instead of the full dataset, which has 1500/500 RGB-D pairs for training/testing distributed among 18 scene classes. We split the training pairs into RGB and depth, and treat those two as source and target, respectively. The synchronized RGB-D frames are captured using Kinect v2 and Zed stereo camera [36-38].
+3. RGB-NIR Scene: This dataset consists of 477 images from 9 scene categories captured in RGB and Near-infrared (NIR). The images were captured using separate exposures from modified SLR cameras, using visible and NIR [35]. We perform single source knowledge transfer from RGB to NIR and vice versa for this dataset. For all the datasets, TR/TI split is done according to Table 2.
+
+**Baseline Methods:** The problem statement we focus on in this paper is new and has not been considered in literature before. As such, there is no direct baseline for our method. However, the closest related works are source free cross domain knowledge transfer methods that operates under both single and multisource cases [3, 4, 22-26]. SHOT [3] and DECISION [4] are the best-known works on single source and multi-source SFDA and we compare against only these two methods. Unlike SOCKET, neither of these baselines employ strategies to overcome modality differences and use only the modality-agnostic loss $\mathcal{L}_{ma}$ for training the target models. Using scene classification as the task of interest, we will show that SOCKET outperforms these baselines for cross-modal knowledge transfer with no access to task-relevant source data. We provide details about the network architecture in the supplement. We note that there a few more recent works [22-26] which have shown small improvements over SHOT, and are orthogonal to the ideas in this paper. Incorporating these improvements for SOCKET as well can be interesting and consider this future work.
+
+Performing knowledge transfer: Recall that we initialize the target models with the source weights and the classifier layers are frozen. The weights in the feature encoders and source mixing weight parameters $(\zeta_k$ 's) in the case of multi-source are the optimization parameters. The values of various parameters like the learning rate are given in the supplement.
+
+Table 2. Datasets statistics
+
+ | SUN-RGBD [33] | RGB-NIR Scene [35] | DIML [34] |
| Number of domains | 4 | 1 | 1 |
| Domain names | kv1,kv2,Realsense,Xtion | N/A | N/A |
| # of TR images for source training | 1264,1234,238,2512 | 204 | 527 |
| # of TR unlabeled images | 1264,1234,238,2512 | 204 | 527 |
| Number of TI paired images | 1709 | 153 | 1088 |
| Number of TR & TI classes | 17 & 28 | 6 & 3 | 6 & 12 |
| Modalities | RGB-D | RGB-NIR | RGB-D |
+
+Table 3. Results on the SUN RGB-D dataset [33] for the task of single-source cross-modal knowledge transfer from RGB to depth modality without access to task relevant source data. The rows represent RGB domains on which the source models are trained. The columns represent the knowledge transfer results on the depth domains for three methods - Unadapted shows results with unadapted source, SHOT[3] and SOCKET.
+
+| Target depth Source RGB | Kinect v1 | Kinect v2 | Realsense | Xtion |
| Unadapted SHOT SOCKET | Unadapted SHOT SOCKET | Unadapted SHOT SOCKET | Unadapted SHOT SOCKET |
| Kinect v1 | 14.8 | 16.7 | 25.3 | 14.6 | 20.3 | 23.6 | 9.0 | 11.9 | 13.4 | 7.1 | 15.3 |
| Kinect v2 | 4.0 | 12.8 | 13.6 | 17.0 | 29.4 | 35.2 | 10.8 | 19.3 | 22.8 | 10.6 | 7.0 |
| Realsense | 2.0 | 7.9 | 20.3 | 7.1 | 18.4 | 23.5 | 14.7 | 27.4 | 30.0 | 5.1 | 9.5 |
| Xtion | 0.7 | 9.5 | 14.2 | 6.0 | 20.2 | 24.2 | 9.0 | 21.8 | 23.5 | 8.1 | 13.2 |
| Average | 5.4 | 11.7 | 18.4 | 11.2 | 22.1 | 26.6 | 10.9 | 20.1 | 22.4 | 7.7 | 11.3 |
+
+$\lambda_{pl}$ is set as 0.3 for all the experiments following [4]. For the regularization parameters $\lambda_{TI}$ and $\lambda_{d}$ of modality specific losses, we set them to be equal. We empirically choose those parameters in such a way so as to balance it with the modality agnostic losses such that no loss component overpowers the other by a large margin. Empirically we found that a range of (0.1, 0.5) works best. All of the values in this range outperform the baselines and we report the best accuracies amongst those. For images from the modalities other than RGB, which are depth and NIR, we repeat the single-channel images into three-channel images, to be able to feed it through the feature encoders which are initialized from the source models trained on RGB images. We use a batch size of 32 for all of our experiments. We run our method 3 times for all experiments with 3 random seeds in PyTorch [39] and report the average accuracies over those.
+
+# 5.2 Main results
+
+Results on the SUN RGB-D dataset [33]: Our method is general enough to deal with any number of sources and we demonstrate both single and multisource knowledge transfer. In Table 3, we show single source RGB to depth results for all of the four domains. Treating the unlabeled depth data of each domain as target, we adapt these using source models trained on RGB data from each of the four domains. It is easily evident from Table 3, that for the target domains Kinect V1, Kinect V2, Realsense and Xtion, SOCKET consistently outperforms the baseline by a good margin of $6.7\%$ , $4.5\%$ , $2.3\%$ , and $3.8\%$ , respectively, thus proving the efficacy of SOCKET in a source-free cross modal
+
+Table 4. Results on the SUN RGB-D dataset [33] for the task of multiple cross-modal knowledge transfer from RGB to depth modality without access to task relevant source data. The rows show the six combinations of two trained source models on RGB data from four different domains. The columns represent the knowledge transfer results on the domain specific depth data for DECISION[4], the current SOTA for multiple source adaptation without source data, and SOCKET
+
+| Target depth
+Source RGB | Kinect v1 | Kinect v2 | Realsense | Xtion |
| DECISION | SOCKET | DECISION | SOCKET | DECISION | SOCKET | DECISION | SOCKET |
| Kinect v1 + Kinect v2 | 17.9 | 19.5 | 34.2 | 36.6 | 18.8 | 19.8 | 14.6 | 18.0 |
| Kinect v1 + Realsense | 12.6 | 18.0 | 23.3 | 26.8 | 24.3 | 24.7 | 10.9 | 12.2 |
| Kinect v1 + Xtion | 11.7 | 23.9 | 29.6 | 35.7 | 20.3 | 21.1 | 16.7 | 20.0 |
| Kinect v2 + Realsense | 7.4 | 11.7 | 22.7 | 33.1 | 28.4 | 29.4 | 6.9 | 9.1 |
| Kinect v2 + Xtion | 14.8 | 16.2 | 27.0 | 31.0 | 25.4 | 25.0 | 11.6 | 18.3 |
| Realsense + Xtion | 8.3 | 10.7 | 23.1 | 25.2 | 30.1 | 31.5 | 9.5 | 10.8 |
| Average | 12.1 | 16.6 | 26.7 | 31.4 | 24.6 | 25.3 | 11.7 | 14.7 |
+
+Table 5. Classification accuracy (%) on DIML dataset with different TI data
+
+| TI data | Unadapted N/A | SHOT [3] N/A | SOCKET DIML RGB+D | SOCKET SUN RGB-D |
| RGB→Depth | 26.9 | 41.4 | 46.1 | 53.2 |
+
+setting. In some of the cases SOCKET outperforms the baseline by a very large margin, as high as $12.4\%$ (Realsense-RGB to Kinect V1-depth). We show two-source RGB to depth adaptation results in Table 4. For four domains we get six two-source combinations, each of which is used for adaptation to depth data from all four domains. We see that in this case also, on average SOCKET outperforms the baseline for all four target domains by good margins. SOCKET shows good improvement for some individual cases like (Kinect v1 + Xtion)-RGB to Kinect v1 depth - improvement of $12.2\%$ - and (Kinect v2 + Realsense)-RGB to Kinect v2 depth - improvement of $10.4\%$ .
+
+Results on the DIML RGB+D dataset [34]: We performed a single source adaptation experiment (Table 5) by restructuring the dataset according to Table 2. In Table 5, we use the TI data from both the DIML RGB+D as well as SUN RGB-D datasets in two separate columns, where the TI data of SUN RGB+D is the same that have been used for experiments related to the SUN RGB-D dataset. By doing so, we show that SOCKET can perform well even with TI data from a completely different dataset, and find that SOCKET has a gain of $4.7\%$ and $11.8\%$ over baseline for these two TI data settings, respectively.
+
+Results on the RGB-NIR scene dataset [35]: We now show that SOCKET also outperforms baslines when the modalities are RGB and NIR using the RGB-NIR dataset. We follow the splits described in Table 2. We do experiments on both RGB to NIR and vice versa. The results are given in Table 6. For RGB to NIR transfer, SOCKET shows $3.5\%$ improvement, while for NIR to RGB transfer, it shows $0.5\%$ improvement over the competing method.
+
+Table 6. Results on RGB-NIR dataset [35] for the task of single-source cross-modal knowledge transfer from RGB to NIR and vice versa without task-relevant source data
+
+| Setting\Method | Unadapted SHOT [3] | SOCKET |
| RGB → NIR | 84.8 | 86.7 | 90.2 |
| NIR → RGB | 65.2 | 92.2 | 92.7 |
+
+Table 7. Cross modal vs cross domain knowledge transfer for SUN RGB-D dataset scene classification using SHOT[3]: (1) The first column shows the accuracies for RGB to depth transfer within the same domain. (2) The second column is generated by transferring knowledge from one RGB domain to other three RGB domains taking the average of the accuracies
+
+| Source | Cross-Modal | Cross-Domain |
| Kinect v1 | 16.7 | 24.5 |
| Kinect v2 | 29.4 | 39.6 |
| Realsense | 27.4 | 29.7 |
| Xtion | 13.2 | 43.1 |
| Average | 21.7 | 34.2 |
+
+# 5.3 Cross Modal vs Cross Domain
+
+In order to show the importance of the novel problem we consider, we compare the single-source knowledge transfer results on the SUN RGB-D dataset for modality change vs domain shift in Table 7. We use SHOT [3] which is a source-free UDA method for this experiment. All the domain-specific source models are trained on RGB images. For domain shift, the targets are all the RGB images of the remaining 3 domains and we report the average over them. Domain shift involves changes in sensor configuration, viewpoints, etc. For modality change, the target data are depth images from the same domain. The scenes are the same as in the RGB source, except they are captured using the depth sensor. The table clearly shows that the accuracy drops by a large margin of $12.5\%$ when we transfer knowledge across modalities instead of domains of the same modality. This shows that a cross-modal knowledge transfer is not the same as DA and a framework like SOCKET is necessary to reduce the modality gap.
+
+# 5.4 Ablation and sensitivity analysis
+
+Contribution of loss components: In Table 8, the first row has the result with just the modality agnostic loss $\mathcal{L}_{ma}$ , whereas second and third row shows the individual effect of our proposed modality specific losses along with the $\mathcal{L}_{ma}$ . For all cases, SOCKET outperforms the baseline and using both losses in conjunction with $\mathcal{L}_{ma}$ yields best results.
+
+Effect of number of TI images: We randomly chose six classes from SUN RGB-D dataset as TI data. Table 9 clearly shows that increasing per class
+
+Table 8. Ablation of contribution of our proposed novel loss components. The first accuracy column (a) corresponds to single source adaptation from RGB to depth on $kv2$ domain, whereas the second column (b) shows the multi-source adaptation result from $kv1 + xton$ to $kv1$ domain of SUN RGB-D dataset. We show the accuracy gain over using $\mathcal{L}_{ma}$ only inside the parentheses
+
+| Lma | Ld | LTI | (a) accuracy (%) | (b) accuracy (%) |
| ✓ | | 30.0 | 11.7 | |
| ✓ | ✓ | 31.6 (↑1.6) | 18.3 (↑6.6) | |
| ✓ | | 34.9 (↑4.9) | 22.6 (↑10.9) | |
| ✓ | ✓ | 36.3 (↑6.3) | 23.9 (↑12.2) | |
+
+Table 9. Left: Effect of number of TI data. We perform knowledge transfer from Kinect v1 RGB to unlabeled depth data. We use six random TI classes and vary the number of TI images per class from 0 to 60 in steps of 20. Right: Effect of regularization hyper-parameters. We perform Kinect v1 and Kinect v2 RGB to Kinect v1 depth transfer with varying $(\lambda_{TI},\lambda_d)$ and tabulate the accuracy of SOCKET
+
+| Images per class | 60 | 40 | 20 | 0 | (λTI,λd) | 0.00 | 0.05 | 0.10 | 0.50 | 1.00 |
| Accuracy (%) | 25.0 | 22.5 | 20.3 | 16.7 | Kinect v1 | 16.1 | 15.0 | 16.6 | 23.4 | 21.0 |
| Kinect v2 | 29.3 | 34.2 | 35.0 | 36.7 | 16.3 |
+
+samples of TI data results in improving the scene-classification accuracy for RGB to depth transfer on the SUN RGB-D dataset. In short, for a fixed number of TI classes, the more TI images per class, the better SOCKET performs.
+
+Effect of regularization parameters: In Table 9, we observe the effect of test accuracy vs the regularization hyper-parameters for our novel losses proposed as a part of SOCKET. We keep $\lambda_{TI}$ and $\lambda_d$ equal to each other for values between 0 to 1. Using the value of 0 is the same as using SHOT. From the table, we see that as the value of the parameter increases the accuracy also increases up to a certain point, and then it starts decreasing.
+
+# 6 Conclusion
+
+We identify the novel and challenging problem of cross-modality knowledge transfer with no access to the task-relevant data from the source sensor modality, and only unlabeled data in the target. We propose our framework, SOCKET, which includes devising loss functions that help bridge the gap between the two modalities in the feature space. Our results for both RGB-to-depth and RGB-to-NIR experiments show that SOCKET outperforms the baselines which cannot effectively handle modality shift.
+
+Acknowledgements. SMA, SL, KCP and MJ were supported by Mitsubishi Electric Research Laboratories. SMA and ARC were partially supported by ONR grant N00014-19-1-2264 and the NSF grants CCF-2008020 and IIS-1724341.
+
+# Bibliography
+
+[1] Gupta, S., Hoffman, J., Malik, J.: Cross modal distillation for supervision transfer. In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2016) 2827-2836
+[2] Ahmed, S.M., Lejbolle, A.R., Panda, R., Roy-Chowdhury, A.K.: Camera on-boarding for person re-identification using hypothesis transfer learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2020) 12144–12153
+[3] Liang, J., Hu, D., Feng, J.: Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In: International Conference on Machine Learning, PMLR (2020) 6028-6039
+[4] Ahmed, S.M., Raychaudhuri, D.S., Paul, S., Oymak, S., Roy-Chowdhury, A.K.: Unsupervised multi-source domain adaptation without access to source data. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2021) 10103-10112
+[5] Perrot, M., Habrard, A.: A theoretical analysis of metric hypothesis transfer learning. In: International Conference on Machine Learning, PMLR (2015) 1708-1717
+[6] Thoker, F.M., Gall, J.: Cross-modal knowledge distillation for action recognition. In: 2019 IEEE International Conference on Image Processing (ICIP), IEEE (2019) 6-10
+[7] Dai, R., Das, S., Bremond, F.: Learning an augmented rgb representation with cross-modal knowledge distillation for action detection. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. (2021) 13053-13064
+[8] Garcia, N.C., Bargal, S.A., Ablavsky, V., Morerio, P., Murino, V., Sclaroff, S.: Dmcl: Distillation multiple choice learning for multimodal action recognition. arXiv preprint arXiv:1912.10982 (2019)
+[9] Wang, J., Tang, Z., Li, X., Yu, M., Fang, Q., Liu, L.: Cross-modal knowledge distillation method for automatic cued speech recognition. arXiv preprint arXiv:2106.13686 (2021)
+[10] Sayed, N., Brattoli, B., Ommer, B.: Cross and learn: Cross-modal self-supervision. In: German Conference on Pattern Recognition, Springer (2018) 228-243
+[11] Hoffman, J., Gupta, S., Leong, J., Guadarrama, S., Darrell, T.: Cross-modal adaptation for rgb-d detection. In: 2016 IEEE international conference on robotics and automation (ICRA), IEEE (2016) 5032-5039
+[12] Zhao, L., Peng, X., Chen, Y., Kapadia, M., Metaxas, D.N.: Knowledge as priors: Cross-modal knowledge generalization for datasets without superior knowledge. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2020) 6528-6537
+[13] Ferreri, A., Bucci, S., Tommasi, T.: Translate to adapt: RGB-d scene recognition across domains. arXiv preprint arXiv:2103.14672 (2021)
+
+[14] Du, D., Wang, L., Wang, H., Zhao, K., Wu, G.: Translate-to-recognize networks for rgb-d scene recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2019) 11836-11845
+[15] Ayub, A., Wagner, A.R.: Centroid based concept learning for rgb-d indoor scene classification. arXiv preprint arXiv:1911.00155 (2019)
+[16] Peng, K.C., Wu, Z., Ernst, J.: Zero-shot deep domain adaptation. In: Proceedings of the European Conference on Computer Vision (ECCV). (2018) 764-781
+[17] Hsu, H.K., Yao, C.H., Tsai, Y.H., Hung, W.C., Tseng, H.Y., Singh, M., Yang, M.H.: Progressive domain adaptation for object detection. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. (2020) 749-757
+[18] Tzeng, E., Hoffman, J., Saenko, K., Darrell, T.: Adversarial discriminative domain adaptation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2017) 7167-7176
+[19] Paul, S., Tsai, Y.H., Schulter, S., Roy-Chowdhury, A.K., Chandraker, M.: Domain adaptive semantic segmentation using weak labels. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part IX 16, Springer (2020) 571-587
+[20] Hoffman, J., Tzeng, E., Park, T., Zhu, J.Y., Isola, P., Saenko, K., Efros, A., Darrell, T.: Cycada: Cycle-consistent adversarial domain adaptation. In: International conference on machine learning, PMLR (2018) 1989-1998
+[21] Peng, X., Bai, Q., Xia, X., Huang, Z., Saenko, K., Wang, B.: Moment matching for multi-source domain adaptation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. (2019) 1406-1415
+[22] Yang, S., Wang, Y., van de Weijer, J., Herranz, L., Jui, S.: Generalized source-free domain adaptation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. (2021) 8978-8987
+[23] Yang, S., Wang, Y., van de Weijer, J., Herranz, L., Jui, S.: Exploiting the intrinsic neighborhood structure for source-free domain adaptation. arXiv preprint arXiv:2110.04202 (2021)
+[24] Yang, S., Wang, Y., van de Weijer, J., Herranz, L., Jui, S.: Casting a bait for offline and online source-free domain adaptation. arXiv preprint arXiv:2010.12427 (2020)
+[25] Agarwal, P., Paudel, D.P., Zaech, J.N., Van Gool, L.: Unsupervised robust domain adaptation without source data. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. (2022) 2009-2018
+[26] Liang, J., Hu, D., Wang, Y., He, R., Feng, J.: Source data-absent unsupervised domain adaptation through hypothesis transfer and labeling transfer. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021)
+[27] Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. The journal of machine learning research 17(1) (2016) 2096–2030
+
+[28] Bridle, J.S., Heading, A.J., MacKay, D.J.: Unsupervised classifiers, mutual information and phantom targets'. (1992)
+[29] Kutbi, M., Peng, K.C., Wu, Z.: Zero-shot deep domain adaptation with common representation learning. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021)
+[30] Ioffe, S., Normalization, C.S.B.: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167
+[31] Yin, H., Molchanov, P., Alvarez, J.M., Li, Z., Mallya, A., Hoiem, D., Jha, N.K., Kautz, J.: Dreaming to distill: Data-free knowledge transfer via deepinversion. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. (2020) 8715-8724
+[32] Tarvainen, A., Valpola, H.: Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In: Advances in neural information processing systems. (2017) 1195–1204
+[33] Song, S., Lichtenberg, S.P., Xiao, J.: Sun rgb-d: A rgb-d scene understanding benchmark suite. In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2015) 567-576
+[34] Cho, J., Min, D., Kim, Y., Sohn, K.: Deep monocular depth estimation leveraging a large-scale outdoor stereo dataset. Expert Systems with Applications 178 (2021) 114877
+[35] Brown, M., Susstrunk, S.: Multi-spectral sift for scene category recognition. In: CVPR 2011, IEEE (2011) 177-184
+[36] Kim, Y., Ham, B., Oh, C., Sohn, K.: Structure selective depth superresolution for rgb-d cameras. IEEE Transactions on Image Processing 25(11) (2016) 5227-5238
+[37] Kim, S., Min, D., Ham, B., Kim, S., Sohn, K.: Deep stereo confidence prediction for depth estimation. In: 2017 IEEE International Conference on Image Processing (ICIP), IEEE (2017) 992-996
+[38] Kim, Y., Jung, H., Min, D., Sohn, K.: Deep monocular depth estimation via integration of global and local predictions. IEEE transactions on Image Processing 27(8) (2018) 4131-4144
+[39] Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al.: Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems 32 (2019) 8026-8037
\ No newline at end of file
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/images.zip b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..aab19182638ccbf1085806a09c97ef982576d3e8
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8abee483c974af2255bec95ca9664d0494b9eeeac27acbdf6d97b71b034062f5
+size 326707
diff --git a/crossmodalknowledgetransferwithouttaskrelevantsourcedata/layout.json b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..59b798eaa101f288f729bae6f75b1194195fc6ff
--- /dev/null
+++ b/crossmodalknowledgetransferwithouttaskrelevantsourcedata/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4eb1be3f8673e7cc31064d8afd018e5ba29e1c3202e34a1b53ecc29fbf332c97
+size 420228
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_content_list.json b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b43ea1086b5c1bccb0944bee71229d165d2afa3b
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79963bb0f757c5406f78607024aed9d85a1b5d35848dd1fed7f1263c274b9045
+size 81537
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_model.json b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9005ef1e61f02b7c2421b66bf75a652447c3ef10
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69b1c20f6770485b757dd4412548407df4fccb2d914aef25ae7d8037fbfaaaea
+size 99527
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_origin.pdf b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..e2a5894b30dceca899f0525a6f6e73cc98ab247a
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/b3b69c17-23d9-4caf-817f-212f8b316b3a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:61fa472a0fb07021d09089d071a4295ceeb38cf4188a84ddf5c7c2b0c68558cf
+size 1994614
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/full.md b/crossmodalprototypedrivennetworkforradiologyreportgeneration/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7e9fa0b152feaff4908a2ae181b1ab225534f3fb
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/full.md
@@ -0,0 +1,307 @@
+# Cross-modal Prototype Driven Network for Radiology Report Generation
+
+Jun Wang, Abhir Bhalerao, and Yulan He
+
+Department of Computer Science, University of Warwick, UK {jun.wang.3, abhir.bhalerao, yulan.he}@warwick.ac.uk
+
+Abstract. Radiology report generation (RRG) aims to describe automatically a radiology image with human-like language and could potentially support the work of radiologists, reducing the burden of manual reporting. Previous approaches often adopt an encoder-decoder architecture and focus on single-modal feature learning, while few studies explore cross-modal feature interaction. Here we propose a Cross-modal PROtotype driven NETwork (XPRONET) to promote cross-modal pattern learning and exploit it to improve the task of radiology report generation. This is achieved by three well-designed, fully differentiable and complementary modules: a shared cross-modal prototype matrix to record the cross-modal prototypes; a cross-modal prototype network to learn the cross-modal prototypes and embed the cross-modal information into the visual and textual features; and an improved multi-label contrastive loss to enable and enhance multi-label prototype learning. XPRONET obtains substantial improvements on the IU-Xray and MIMIC-CXR benchmarks, where its performance exceeds recent state-of-the-art approaches by a large margin on IU-Xray and comparable performance on MIMIC-CXR. $^{1}$
+
+Keywords: Radiology Report Generation, Cross-Modal Pattern Learning, Prototype Learning, Transformers
+
+# 1 Introduction
+
+Radiology images, e.g., X-Ray and MRI, are widely used in medicine to support disease diagnosis. Nonetheless, traditional clinical practice is laborious since it requires the medical expert, such as a radiologist, to carefully analyze an image and then produce a medical report, which often takes more than five minutes [13]. This process could also be error-prone due to subjective factors, such as fatigue and distraction. Automatic radiology report generation, as an alternative to expert diagnosis, has therefore gained increasing attention from researchers. Automatic medical report generation has the potential to rapidly produce a report and assist a radiologist to make the final diagnosis significantly reducing the workload of radiologists and saving medical resources, especially in developing countries where well-trained radiologists can be in short supply.
+
+
+Fig.1: An example generated report and the selected cross-modal prototype indices using XPRONET. The selected word "lungs" is marked as red and the associated image patch is highlighted in the red rectangle. The prototype indices selected both from the image patch and from the text instance are marked as red.
+
+
+Fig.2: A visualization of the cross-modal prototype matrix on the MIMIC-CXR dataset using T-SNE [25]. Points with the same colour come from the same prototype category.
+
+Owing to developments in computer vision models for image captioning and availability of large-scale datasets, recently there have been significant advancements in automated radiology report generation [44,13,22]. Nevertheless, radiology report generation still remains a challenging task and is far from being solved. The reasons are three-fold. Firstly, unlike the traditional image captioning task which often produces only a single sentence, a medical report consists of several sentences and its length might be four-times longer than an image caption. Secondly, medical reports often exhibit more sophisticated linguistic and semantic patterns. Lastly, commonly used datasets suffer from notable data biases: the majority of the training samples are of normal cases, any abnormal regions often only exist in a small parts of an image, and even in pathological cases, most statements may be associated with a description of normal findings, e.g. see Figure 4. Overall, these problems present a substantial challenge to the modelling of cross-modal pattern interactions and learning informative features for accurate report generation.
+
+Existing methods often focus on learning discriminative, single-modal features and ignore the importance of cross-modal interaction, essential for dealing with complex image and text semantic interrelationships. Thus, cross-modal interaction is of great importance as the model is required to generate a meaningful report only given the radiology image. Previous studies normally model cross-modal interaction by a self-attention mechanism on the extracted visual and textual features in an encoder-decoder architecture, which cannot adequately capture complex cross-modal patterns. Motivated by this, we propose a novel framework called Cross-modal PROtoType driven NETwork (XPRONET) which learns the cross-modal prototypes on the fly and utilizes them to embed cross-modal information into the single-model features. XPRONET regards the cross-modal prototypes as intermediate representations and explicitly establishes a cross-modal information flow to enrich single-modal features. Figure 1 shows
+
+an example of the cross-modal information flow where the visual and textual features select almost the same (9 of top 10) cross-modal prototypes to perform interaction. These enriched features are more likely to capture the sophisticated patterns required for accurate report generation. Additionally, the imbalance problem is addressed by forcing single-model features to interact with their cross-modal prototypes via a class-related, cross-modal prototype querying and responding module. Our work makes three principal contributions:
+
+1. We propose a novel end-to-end cross-modal prototype driven network where we utilize the cross-modal prototypes to enhance image and text pattern interactions. Leveraging cross-modal prototypes in this way for RRG has not been explicitly explored.
+2. We employ a memory matrix to learn and record the cross-modal prototypes which are regarded as intermediate representations between the visual and textual features. A cross-modal prototype network is designed to embed cross-modal information into the single-modal features.
+3. We propose an improved multi-label contrastive loss to learn cross-modal prototypes while simultaneously accommodating label differences via an adaptive controller term.
+
+After a discussion of related work, our methods and implementation are described in detail in Section 3. Experimental results presented in Section 4 demonstrate that our approach outperforms a number of state-of-the-art methods over two widely-used benchmarks. We also undertake ablation studies to verify the effectiveness of individual components of our method. Discussion and proposals are given to inspire future work.
+
+# 2 Related Work
+
+Image Captioning Image captioning aims to generate human-like sentences to describe a given image. This task is considered as a high-level visual understanding problem which combines the research of computer vision and natural language processing. Recent state-of-the-art approaches [32,38,20,24,42,33] follow an encoder-decoder architecture and have demonstrated a great improvement in some traditional image captioning benchmarks. In particular, the most successful models [5,8,30,11] usually adopt the Transformer [36] as their backbone due to its self-attention mechanism and its impressive capability of extracting meaningful features for the task. However, these methods are designed for short textual description generation and are less capable for generating long reports. Though several works [16,26] have been proposed to deal with long text generation, they often cannot capture the specific medical observations and tend to produce reports ignoring abnormal regions in images, resulting in unsatisfactory performance.
+
+Radiology Report Generation Inspired by the great success of encoder-decoder based frameworks in image captioning, recent radiology report generation methods have also employed similar architectures. Specifically, Jing et
+
+al. [13] developed a hierarchical LSTM model to produce long reports and proposed a co-attention mechanism to detect abnormal patches. Liu et al. [22] proposed to firstly determine the topics of each report, which are then conditioned upon for report generation. Similarly, Zhang et al. [44] also ascertained the disease topics and utilized prior knowledge to assist report generation via a preconstructed knowledge graph. Liu et al. [21] extended this work by presenting a PPKED model which distills both the prior and posterior knowledge into report generation. A few works [27,29] have investigated reinforcement learning for improving the consistency of the generated reports. These encoder-decoder approaches often focus on extracting discriminative single-modal features (visual or textual), while few study explores the importance of the cross-modal pattern interactions.
+
+The most similar work to ours is R2GenCMN [3] which utilizes an extra memory to learn the cross-modal patterns. Nonetheless, there are three main differences. First, we design a shared cross-modal prototype matrix to learn the class-related cross-modal patterns and propose an improved multi-label contrastive loss, while Chen et al. [3] randomly initialize a memory matrix and use a cross entropy loss. Additionally, our querying and responding process is class-related, that is, cross-modal pattern learning is only performed over the cross-modal prototypes sharing the same labels rather than on all cross-modal prototypes. Moreover, we adopt a more effective approach to distill the cross-modal information into the single-modal representations rather than the simple averaging function used in R2GenCMN. XPRONET is driven by the cross-modal prototypes which, to the best of our knowledge, has not been explored before in radiology report generation.
+
+# 3 Methods
+
+Our aim is to learn important informative cross-modal patterns and utilize them to explicitly model cross-modal feature interactions for radiology report generation, Figure 3 shows the overall architecture of XPRONET. The details of the main three modules, i.e., the image feature extractor, the cross-modal prototype network, and the encoder-decoder are described in the following subsections.
+
+# 3.1 Image Feature Extractor
+
+Given an input radiology image $\pmb{I}$ , a ResNet-101 [9] is utilized to extract the image features $\pmb{v} \in \mathbb{R}^{H \times W \times C}$ , shown in the blue-dashed rectangle in Figure 3. In particular, image features $\pmb{v}$ are extracted from the last convolution layer, before the final average pooling operation. Here $H$ , $W$ and $C$ are the height, width and the number of channels of an image, respectively. Once extracted, we linearize the image features $\pmb{v}$ by concatenating the rows of the image features and regard each region (position) feature as a visual word token. The final feature representation sequence $\pmb{v}_s \in \mathbb{R}^{HW \times C}$ is taken as the input for the subsequent
+
+
+Fig. 3: The architecture of XPRONET: An image is fed into the Visual Feature Extractor to obtain patch features. A word at time step $T$ (e.g. "lungs") is mapped onto a word embedding via an embedding layer. The visual and textual representations are then sent to the cross-modal prototype querying and responding module to perform cross-modal interaction on the selected cross-modal prototypes based on the associated pseudo label. Then the single-model feature are enriched by the generated responses through a linear layer and taken as the source inputs of the Transformer encoder-decoder to generate the report.
+
+modules and is expressed as:
+
+$$
+\left\{v _ {1} ^ {s}, v _ {2} ^ {s}, \dots , v _ {i} ^ {s}, \dots , v _ {N ^ {s} - 1} ^ {s}, v _ {N ^ {s}} ^ {s} \right\} = f _ {i f e} (\boldsymbol {I}), \tag {1}
+$$
+
+where $v_{i}$ denotes the region features in the $i^{th}$ position of $\pmb{v}_{s}$ , $N^{s} = H\times W$ , and $f_{ife}(\cdot)$ is the image feature extractor.
+
+# 3.2 Cross-modal Prototype Network
+
+Learning complex related patterns between image features and related textual descriptions is challenging. But cross-modal learning enables jointly learn informative representations of image and text. Central to our network is a prototype matrix which contains image pseudo-labels, initialized using an approach described below.
+
+Pseudo Label Generation Cross-modal prototypes require category information for each sample, which is however often not provided in the datasets. To address this problem for prototype learning, we utilize CheXbert [34], an automatic radiology report labeler, to generate a pseudo label for each image-text pair. We denote the report associated with image $I$ as:
+
+$$
+\boldsymbol {R} = \left\{w _ {1}, w _ {2}, \dots , w _ {i}, \dots , w _ {N ^ {r} - 1}, w _ {N ^ {r}} \right\}, \tag {2}
+$$
+
+where $w_{i}$ is the $i^{th}$ word in the report and $N^r$ is the number of words in the report. The labelling process can then be formulated as:
+
+$$
+\left\{y _ {1}, y _ {2}, \dots , y _ {i}, \dots , y _ {N ^ {l} - 1}, y _ {N ^ {l}} \right\} = f _ {a l} (\boldsymbol {R}), \tag {3}
+$$
+
+where the result is an one-hot vector and $y_{i} \in \{0,1\}$ is the prediction result for $i^{th}$ category. Note that the value of one indicates the existence of that category, $N^l$ is the number of categories, and $f_{al}(\cdot)$ denotes the automatic radiology report labeler.
+
+Prototype Matrix Initialization Existing methods often directly model the cross-modal information interactions using the encoded features and learn implicitly cross-modal patterns. The length of the report, the imbalanced distribution of text descriptions of normal and abnormal cases, and complex cross modal patterns, make it hard to capture cross-modal patterns effectively. For better cross-modal pattern learning, we design a shared cross-modal prototype matrix $PM \in \mathbb{R}^{N^l \times N^p \times D}$ to learn and store the cross-modal patterns, which can be considered as intermediate representations. Here $N^p$ and $D$ are the number of learned cross-modal prototypes for each category and the dimension for each prototype, respectively. $PM$ is updated and learned during training, and then utilized by the class-related prototype querying and responding modules to explicitly embed the cross-modal information to the single-modal features.
+
+The initialization of the prototype matrix is critical. One way is to randomly initialize the matrix [3], but this does not capture any meaningful semantic information and hampers the subsequent prototype learning. Therefore, we propose to utilize prior information to initialize a semantic cross-modal prototype matrix. Specifically, for an image-text pair $< I,R >$ with the associated pseudo class labels $\pmb{y}$ , we employ a pretrained ResNet-101 and BERT [34] to extract the global visual and textual representations, $\pmb{o}^i\in \mathbb{R}^{1\times C_1}$ and $\pmb{o}^t\in \mathbb{R}^{1\times C_2}$ , where $C_1$ and $C_2$ are the number of channels extracted of the visual and textual representations, respectively. To improve robustness, we also extract the flipped image features $\pmb{o}^{if}\in \mathbb{R}^{1\times C_1}$ . By repeating this process on all the training samples, we can obtain a group of feature sets for each class, formulated as:
+
+$$
+\boldsymbol {R} _ {k} ^ {I} = \left\{o _ {u} ^ {i (f)} | y _ {u, k} = 1 \right\}, \quad \boldsymbol {R} _ {k} ^ {T} = \left\{o _ {u} ^ {t} | y _ {u, k} = 1 \right\}. \tag {4}
+$$
+
+Here $\pmb{R}_k^I$ and $\pmb{R}_k^T$ are the visual and textual feature sets for category $k$ , $i(f)$ means either the original image $i$ or the flipped image $if$ , and $y_{u,k}$ denotes the label of category $k$ for sample $u$ . After that, we concatenate the visual and textual representations to form the cross-modal features, $\pmb{r} \in \mathbb{R}^{1 \times D}$ . Note that $D = C_1 + C_2$ . Finally, K-Means [23] is employed to cluster each feature set into $N_p$ clusters and the average of features in each cluster is used as an initial
+
+cross-modal prototype for $PM$ . This process can be summarised as:
+
+$$
+o _ {u} = \operatorname {C o n c a t} \left(o _ {u} ^ {i (f)}, o _ {u} ^ {t}\right), \tag {5}
+$$
+
+$$
+\{\boldsymbol {g} _ {1} ^ {k}, \dots , \boldsymbol {g} _ {N ^ {p} - 1} ^ {k}, \boldsymbol {g} _ {N ^ {p}} ^ {k} \} = f _ {k m} (\boldsymbol {R} _ {k}), \quad \boldsymbol {g} _ {i} ^ {k} = \left\{o _ {1} ^ {k, i}, \dots , o _ {N _ {k, i} ^ {d}} ^ {k, i} \right\}, \tag {6}
+$$
+
+$$
+\boldsymbol {P} \boldsymbol {M} (k, i) = \frac {1}{N _ {k , i} ^ {s}} \sum_ {j = 0} ^ {N} r _ {j} ^ {k, i}, \tag {7}
+$$
+
+Where $o_{u}$ and $R_{k}$ are the concatenated cross-modal representation for sample $u$ and the cross-modal feature set for category $k$ , $g_{i}^{k}$ is the $i^{th}$ grouped cluster for $k^{th}$ category returned by the K-Mean algorithm $f_{km}$ . $N_{k,i}^{d}$ is the number of samples in the $i^{th}$ cluster for $k^{th}$ category. $PM(k,i)$ then represents the $i^{th}$ vector in the cross-modal prototype set for the $k^{th}$ category.
+
+Cross-modal Prototype Querying After obtaining the prototype matrix, similar to [3], we adopt a querying and responding process to explicitly embed the cross-modal information into the single-modal features. Different from [3], given an image, our cross-modal prototype querying measures the similarity between its single-modal representation and the cross-modal prototype vectors under the same label as the image, and selects the top $\gamma$ vectors having the highest similarity to interact with the single-model representations. This process is illustrated in the yellow-dashed rectangle in Figure 3.
+
+Given the image-text training pair $< I,R>$ and the associated pseudo label $\pmb{y}$ , the queried cross-modal prototype vectors for the sample are then generated. The queried cross-modal prototype vectors $\pmb{pv} = \{\pmb{PM}(k)|y_k = 1\}$ , where $\pmb{PM}(k)$ is the cross-modal prototype set for the $k^{th}$ category generated by Equations (5) - (8). To filter out possible noise, a linear projection is applied to $\pmb{pv}$ to map it to $C_P$ dimensions before sending it into the querying process, as follows:
+
+$$
+\boldsymbol {p} = \boldsymbol {p v} \cdot \boldsymbol {W} _ {p v}, \tag {8}
+$$
+
+where $W_{pv}\in \mathbb{R}^{D\times C_P}$ is a learnable weight matrix.
+
+We denote the report representation output by the embedding layer as $\pmb{v}_t = \{v_1^t,v_2^t,\dots,v_i^t,\dots,v_{N^t -1}^t,v_{N^t}^t\}$ and a cross-modal prototype vector as $p_i$ , where $v_{i}^{t}\in \mathbb{R}^{1\times C}$ is the $i^{th}$ word embedding of the report. Before performing the querying, we linearly project the visual feature sequence $\pmb{v}_{s}$ , textual report embeddings $\pmb{v}_t$ and the cross-modal prototype vector $p_i$ into the same dimension $d$ since they may have different dimensions:
+
+$$
+v _ {i} ^ {s *} = v _ {i} ^ {s} \cdot \boldsymbol {W} _ {v}, \quad v _ {i} ^ {t *} = v _ {i} ^ {t} \cdot \boldsymbol {W} _ {v}, \quad p _ {i} ^ {*} = p _ {i} \cdot \boldsymbol {W} _ {p}, \tag {9}
+$$
+
+where $\mathbf{W}_v \in \mathbb{R}^{C \times d}$ and $\mathbf{W}_p \in \mathbb{R}^{C_P \times d}$ are two learnable weights. A similarity between each single-modal feature and cross-modal prototype vector pair is computed by:
+
+$$
+D _ {(i, u)} ^ {s} = \frac {v _ {j} ^ {s *} \cdot p _ {u} ^ {*}}{d}, \quad D _ {(j, u)} ^ {t} = \frac {v _ {j} ^ {t *} \cdot p _ {u} ^ {*}}{d}. \tag {10}
+$$
+
+Since the majority of the cross-modal prototypes might be irrelevant to the queried vectors, which may introduce noisy cross-modal patterns, we only select $\gamma$ most similar vectors to respond to the query vectors. After that, we calculate the weights among these selected prototype vectors based on the similarities. This process between a cross-modal prototype $p_u^*$ , a visual region representation $v_i^{s*}$ and a textual word embedding $v_i^{t*}$ is captured by:
+
+$$
+w _ {(i, u)} ^ {s} = \frac {D _ {(i , u)} ^ {s}}{\sum_ {j = 1} ^ {\gamma} D _ {(i , j)} ^ {s}}, \quad w _ {(i, u)} ^ {t} = \frac {D _ {(i , u)} ^ {t}}{\sum_ {j = 1} ^ {\gamma} D _ {(i , j)} ^ {t}} \tag {11}
+$$
+
+Cross-modal Prototype Responding After obtaining the top $\gamma$ similar cross-modal prototype vectors and their weights, the next step is to generate the responses for the visual and textual features. In particular, we firstly transform the queried prototype vectors to the same representation space of the query vectors via a fully connected layer. The responses for the visual and textual features are created by taking the weighted sum over these transformed cross-modal prototype vectors:
+
+$$
+e _ {(i, j)} ^ {s} = p _ {(i, j)} ^ {s *} \cdot \boldsymbol {W} _ {e}, \quad e _ {(i, j)} ^ {t} = p _ {(i, j)} ^ {t *} \cdot \boldsymbol {W} _ {e}, \tag {12}
+$$
+
+$$
+r _ {i} ^ {s} = \sum_ {j = 1} ^ {\gamma} w _ {(i, j)} ^ {s} \cdot e _ {(i, j)} ^ {s}, \quad r _ {i} ^ {t} = \sum_ {j = 1} ^ {\gamma} w _ {(i, j)} ^ {t} \cdot e _ {(i, j)} ^ {t}, \tag {13}
+$$
+
+where $p_{(i,j)}^{s*}$ and $p_{(i,j)}^{t*}$ are the $j^{th}$ prototype vectors in the most similar cross-modal prototype sets for the $i^{th}$ image patch and word, respectively. Similarly, the $j^{th}$ transformed prototype vectors for $i^{th}$ image patch and word are denoted as $e_{(i,j)}^s$ and $e_{(i,j)}^t$ . We represent the responses for $i^{th}$ image patch and word as $r_i^s$ and $r_i^t$ . The $w_{(i,j)}^s$ and $w_{(i,j)}^t$ are the weights obtained by Equations (11) to (12).
+
+Feature Interaction Module The selected cross-modal prototype vectors contain class-related and cross-modal patterns. The last step is to introduce these informative patterns into the single-modal features via feature interaction. In [3], this is achieved by directly adding the single-model features and their associated responses, which pays the same attention to the responses and the single-modal features. However, this simple approach might be suboptimal given possibly noisy responses or non-discriminative single-model features. To mitigate this problem, we propose to automatically learn the importance difference and filter out noisy signals.
+
+Specifically, we firstly concatenate the single-modal features with their associated responses. A linear layer is then applied to fuse the single-modal features and the cross-modal prototype vectors. Remember that the fused representations contain rich class-related features and cross-modal patterns. The process is:
+
+$$
+\boldsymbol {l} ^ {s} = \boldsymbol {F C N} (\text {C o n c a t} (\boldsymbol {v} ^ {s}, \boldsymbol {r} ^ {s})), \quad \boldsymbol {l} ^ {t} = \boldsymbol {F C N} (\text {C o n c a t} (\boldsymbol {v} ^ {t}, \boldsymbol {r} ^ {t})), \tag {14}
+$$
+
+where $FCN$ denotes the fully connected layer and $Concat$ is the concatenating function. The outputs of the Feature Interaction Module are taken as the source inputs for the following Transformer module to generate the reports.
+
+# 3.3 Reports Generation with Transformer
+
+Transformers have been shown to be quite potent for NLP tasks, e.g., sentiment analysis [40,4,41], machine translation [43,39,2] and question answering [28,15,45]. Consequently, we adopt a transformer to generate the final reports. Generally, the Transformer consists of the Encoder and Decoder. At the first step, the responded visual features $l^s$ are fed into the Encoder to obtain the intermediate representations. Combined with the current fused textual representation sequence $l^t = \{l_1^t, l_2^t, \dots, l_i^t, \dots, l_{T-1}^s\}$ , these intermediate representations are then taken as the source inputs for the Decoder to predict the current output. In general, the encoding and decoding processes can be expressed as:
+
+$$
+\left\{m _ {1}, m _ {2}, \dots , m _ {N ^ {s}} \right\} = \boldsymbol {\mathit {E n c o d e r}} \left(l _ {1} ^ {s}, l _ {2} ^ {s}, \dots , l _ {N ^ {s}} ^ {s}\right), \tag {15}
+$$
+
+$$
+p _ {T} = \mathbf {D e c o d e r} \left(m _ {1}, m _ {2}, \dots , m _ {N ^ {*}}; l _ {1} ^ {t}, l _ {2} ^ {t}, \dots , l _ {T - 1} ^ {t}\right), \tag {16}
+$$
+
+where $p_T$ denotes the word prediction for time step $T$ . The complete report is obtained by repeating the above process.
+
+# 3.4 Improved Multi-Label Contrastive Loss
+
+Though the cross-modal prototype matrix is deterministically initialized, further learning is required to learn class-related and informative cross-modal patterns, since the cross-modal patterns are actually far more sophisticated than the simple concatenation of the visual and textual representations in the Prototype Initialization module. Moreover, the cross-modal prototype features extractor (pre-trained ResNet-101 and BERT) are not trained on our target benchmarks, leading to potentially noisy signals. Therefore, online cross-modal prototype learning becomes of greater significance.
+
+A simple way is to utilize the widely used contrastive loss to supervise the learning of the cross-modal prototypes. Nonetheless, the vanilla contrastive loss is designed for the single-label prototype learning, while each training sample can belong to multiple categories in our task. Therefore, we modify the contrastive loss into a multi-label scenario by regarding the samples having at least one common label (excluding label 0) as positive pairs. If two samples do not share any common label, they form a negative pair. Instead of employing the contrastive loss on the responded features, we propose applying the loss on the responses since the fused features are used for medical report generation rather than for classification.
+
+Given the visual responses $\pmb{r}^s = \{r_1^s, r_2^s, \dots, r_i^s, \dots, r_{N^s - 1}^s, r_{N^s}^s\}$ and textual responses $\pmb{r}^t = \{r_1^t, r_2^t, \dots, r_i^t, \dots, r_{N^t - 1}^t, r_{N^t}^s\}$ , our modified multi-label contrastive
+
+loss is formulated as:
+
+$$
+\begin{array}{l} \boldsymbol {L} _ {i c n} ^ {s} = \frac {1}{B ^ {2}} \sum_ {i = 1} ^ {B} \sum_ {\substack {j: \boldsymbol {y} _ {i} \otimes \boldsymbol {y} _ {j} \neq 0 \\ D}} ^ {B} \left(\boldsymbol {\theta} ^ {- \frac {\boldsymbol {h} _ {\boldsymbol {d}}}{h _ {t}}} - \operatorname {S i m} \left(\sigma \left(r _ {i} ^ {s}, r _ {j} ^ {s}\right)\right)\right) + \tag{17} \\ \sum_ {j: \boldsymbol {y} _ {i} \otimes \boldsymbol {y} _ {j} = 0} ^ {B} \max \left(S i m \left(\sigma \left(r _ {i} ^ {s}, r _ {j} ^ {s}\right)\right) - \alpha , 0\right) \\ \end{array}
+$$
+
+Here $B$ denotes the number of training samples in one batch and $\otimes$ is the dot product operation. $\pmb{y}_i\otimes \pmb{y}_j\neq 0$ ensures that the responses $r_i^s$ and $r_j^s$ have at least one common label (excluding 0). $\sigma (\cdot)$ and $Sim(\cdot)$ are the average function over all the image patch responses followed by the $L_{2}$ normalization and the cosine similarity function, respectively. Only negative pairs with similarity larger than a constant margin $\alpha$ can make a contribution to $L_{cn}^{s}$ .
+
+Note that different from a standard contrastive loss, the maximum positive similarity (or one) is replaced with a label difference term, $\theta^{(\cdot)}$ . In this way, the model can tolerate some dissimilarity between the positive pairs in terms of the label difference, instead of forcing them to be the same which is unreasonable under a multi-label setting:
+
+$$
+h _ {d} = \epsilon \left(\operatorname {a b s} \left(\boldsymbol {y} _ {i} - \boldsymbol {y} _ {j}\right)\right), \quad h _ {t} = \epsilon \left(\boldsymbol {y} _ {i} + \boldsymbol {y} _ {j}\right), \tag {18}
+$$
+
+where $abs$ and $\epsilon$ are the absolute value and the summary functions, respectively. $h_d$ calculates the number of different labels and $h_t$ denotes the number of total labels of two training samples (excluding zero). Thus $\theta$ controls the relative tolerance where a smaller value represents less tolerance given the same label difference. An improved contrastive loss for textual responses $L_{icn}^t$ is obtained in a similar way.
+
+Objective Function Given the entire predicted report sequence $\{p_i\}$ and the associated ground truth report $\{w_i\}$ , XPRONET is jointly optimized with a cross-entropy loss and our improved multi-label contrastive loss by:
+
+$$
+\boldsymbol {L} _ {c e} = - \frac {1}{N ^ {r}} \sum_ {i = 1} ^ {N ^ {r}} w _ {i} \cdot \log \left(p _ {i}\right), \tag {19}
+$$
+
+$$
+\boldsymbol {L} _ {f n l} = \boldsymbol {L} _ {c e} + \lambda \boldsymbol {L} _ {i c n} ^ {s} + \delta \boldsymbol {L} _ {i c n} ^ {t}, \tag {20}
+$$
+
+Here $\lambda$ and $\delta$ are two hyper-parameters which balance the loss contributions.
+
+# 4 Experiments
+
+We verify the effectiveness of XPRONET on two widely used medical report generation benchmarks, i.e., IU-Xray and MIMIC-CXR. Four common natural language processing evaluation metrics: BLEU{1-4} [31], ROUGE-L [19], ME-TEOR [7] and CIDEr [37], are utilized to gauge performance. The implementation details are given in Appendix A.1.
+
+Table 1: Comparative results of XPRONET with previous studies. The best values are highlighted in bold and the second best are underlined. BL, RG and MTOR are the abbreviations of BLEU, ROUGE and METEOR. The symbol * denotes our replicated results with the official codes.
+
+| Dataset | Method | BL-1 | BL-2 | BL-3 | BL-4 | RG-L | MTOR | CIDEr |
| IU-Xray | ST [35] | 0.216 | 0.124 | 0.087 | 0.066 | 0.306 | - | - |
| ADAATT [24] | 0.220 | 0.127 | 0.089 | 0.068 | 0.308 | - | 0.295 |
| ATT2IN [33] | 0.224 | 0.129 | 0.089 | 0.068 | 0.308 | - | 0.220 |
| SentSAT + KG [44] | 0.441 | 0.291 | 0.203 | 0.147 | 0.304 | - | 0.304 |
| HRGR [18] | 0.438 | 0.298 | 0.208 | 0.151 | 0.322 | - | 0.343 |
| CoAT[13] | 0.455 | 0.288 | 0.205 | 0.154 | 0.369 | - | 0.277 |
| CMAS - RL [12] | 0.464 | 0.301 | 0.210 | 0.154 | 0.362 | - | 0.275 |
| KERP [17] | 0.482 | 0.325 | 0.226 | 0.162 | 0.339 | - | 0.280 |
| R2GenCMN* [3] | 0.474 | 0.302 | 0.220 | 0.168 | 0.370 | 0.198 | - |
| XPRONET(Ours) | 0.525 | 0.357 | 0.262 | 0.199 | 0.411 | 0.220 | 0.359 |
| MIMIC-CXR | RATCHET [10] | 0.232 | - | - | - | 0.240 | 0.101 | - |
| ST [35] | 0.299 | 0.184 | 0.121 | 0.084 | 0.263 | 0.124 | - |
| ADAATT [24] | 0.299 | 0.185 | 0.124 | 0.088 | 0.266 | 0.118 | - |
| ATT2IN [33] | 0.325 | 0.203 | 0.136 | 0.096 | 0.276 | 0.134 | - |
| TopDown[1] | 0.317 | 0.195 | 0.130 | 0.092 | 0.267 | 0.128 | - |
| R2GenCMN* [3] | 0.354 | 0.212 | 0.139 | 0.097 | 0.271 | 0.137 | - |
| XPRONET(Ours) | 0.344 | 0.215 | 0.146 | 0.105 | 0.279 | 0.138 | - |
+
+Datasets IU-Xray [6] is a widely used benchmark which contains 7,470 X-ray images and 3,955 corresponding reports established by Indiana University. The majority of patients provided both the frontal and lateral radiology images. MIMIC-CXR [14] is a recently released large chest X-ray dataset with 473,057 X-ray images and 206,563 reports provided by the Beth Israel Deaconess Medical Center. Both of these two datasets are publicly available $^{2}$ . We follow the same data splits proportions as [18] to divide the IU-Xray dataset into train (70%), validation (10%) and test (20%) sets, while the official data split is adopted for the MIMIC-CXR dataset.
+
+Comparisons with Previous Studies Here, we compare the experimental results with previous studies on the IU-Xray and MIMIC-CXR datasets. As shown in Table 1, ours (XPRONET) outperforms the previous best SOTA method of R2GenCMN by a notable margin on the IU-Xray dataset. In particular, XPRONET surpasses the second best-performing method by $4.3\%$ , $3.1\%$ and $4.1\%$ on BLEU-1, BLEU-4 and RG-L scores respectively. A similar pattern can be seen on the MIMIC-CXR benchmark where XPRONET achieves the best performance on all the evaluation metrics except BLEU-1 in which it is slightly inferior to R2GenCMN. We mainly attribute the improved performance to the enriched single-modal feature representation via the cross-modal prototype learning. The superiority of XPRONET on IU-Xray is more obvious than MIMIC-CXR. This could be partly explained by the data size differences as the number of samples in MIMIC-CXR is almost 50 times larger than IU-Xray, hence
+
+Table 2: The experimental results of ablation studies on the IU-Xray and MIMIC-CXR datasets. The best values are highlighted in bold. BL and RG are the abbreviations of BLEU and ROUGE.
+
+| IU-Xray | BL-1 | BL-2 | BL-3 | BL-4 | RG-L | METEOR |
| XPRONET | 0.525 | 0.357 | 0.262 | 0.199 | 0.411 | 0.220 |
| w/o PI | 0.476 | 0.307 | 0.218 | 0.160 | 0.371 | 0.196 |
| w/o IMLCS | 0.471 | 0.307 | 0.215 | 0.159 | 0.377 | 0.196 |
| w/o CMPNet | 0.467 | 0.303 | 0.210 | 0.155 | 0.367 | 0.197 |
| MIMIC-CXR | BL-1 | BL-2 | BL-3 | BL-4 | RG-L | METEOR |
| XPRONET | 0.344 | 0.215 | 0.146 | 0.105 | 0.279 | 0.138 |
| w/o PI | 0.329 | 0.205 | 0.139 | 0.100 | 0.275 | 0.133 |
| w/o IMLCS | 0.336 | 0.204 | 0.137 | 0.098 | 0.269 | 0.135 |
| w/o CMPNet | 0.321 | 0.198 | 0.133 | 0.095 | 0.273 | 0.131 |
+
+it is more difficult to learn informative and class-related cross-modal prototypes. We present a visual example in Figure 4 and give a further analysis below.
+
+Ablation Analysis Ablation studies were conducted to further explore the impact of each component of XPRONET on report generation performance. We investigated the following variants:
+
+- XPRONET w/o CMPNet: the base model which only consists of the visual extractor (ResNet-101) and the encoder-decoder (Transformer) without other extensions.
+- XPRONET w/o PI: XPRONET without the cross-modal Prototype Initialization (PI), i.e., the cross-modal prototype matrix is randomly initialized.
+- XPRONET w/o IMLCS: XPRONET without the improved multi-label contrastive loss (IMLCS). We replace the adaptable maximum similarity $\theta^{-\frac{h_d}{h_t}}$ in Equation (17) with one to switch it back to the standard multi-label contrastive loss.
+
+The main results of the ablation studies of XPRONET are shown in Table 2. First, all the three components, i.e., prototype initialization, improved multi-label contrastive loss and the whole cross-modal prototype network architecture, significantly boost the performance as a notable drop can be seen when any of them is removed. For instance, the BLEU-4 score decreases from 0.199 to 0.160 and 0.105 to 0.100 on the IU-Xray and MIMIC-CXR datasets when the prototype initialization is removed. Similarly, removing the improved multi-label contrastive loss lead to lower scores on BLEU-2 and ROUGE-L. These results verify the importance of informatively initializing the cross-modal prototype and allowing some dissimilarity between positive pairs under the multi-label, cross-modal prototype learning settings.
+
+
+
+
+Fig. 4: An example of the report generated by different models. The ground truth report is shown in the blue dashed rectangle. Words that occurred in the ground truth are marked as red.
+
+XPRONET: frontal and lateral views of the chest were obtained. The lungs are hyperinflated with flattening of the diaphragms suggesting chronic obstructive pulmonary disease. no focal consolidation pleural effusion or evidence of pneumothorax is seen. the cardiac and mediastinal silhouettes are unremarkable.
+
+XPRONET w/o CMPNet: heart size is normal. the mediastinal and hilar contours are normal. the pulmonary vasculature is normal. lungs are hyperinflated but clear . no pleural effusion or pneumothorax is seen . there are no acute osseous abnormalities.
+
+XPRONET w/o IMCLC: pa and lateral views of the chest provided there is no focal consolidation effusion or pneumothorax, the cardiomediastinal silhouette is normal. imaged osseous structures are intact. no free air below the right hemidiaphragm is seen.
+
+XPRONET w/o PI: pa and lateral views of the chest provided . there is no focal consolidation effusion or pneumothorax . the cardiomediastinal silhouette is normal. imaged osseous structures are intact. no free air below the right hemidiaphragm is seen.
+
+Moreover, the biggest performance drop can be seen on the model without the whole cross-modal prototype network on all the evaluation metrics, e.g., 0.525 to 0.467 and 0.344 to 0.321 of BL-1 on IU-Xray and MIMIC-CXR dataset respectively. An example visualization is shown in Figure 4 to illustrate the strength of XPRONET. More example visualizations are given in Appendix A.2. As we can see, XPRONET can capture the abnormal information and generate a better report, while the reaming models tend to produce sentences ignoring the abnormal patterns observed in images. This could be attributed to the welllearned cross-modal prototypes and the class-related querying and responding module which better capture the cross-modal flow and embed the prototype information into the feature learning procedure. We illustrate the cross-modal prototype matrix extracted from the linear projection (Equation (8)) in Figure 2. It can be seen that there is an obvious clustering pattern shown in the cross-modal prototype matrix. It should be mentioned that XPRONET can tolerate some dissimilarities between positive pairs, hence a category always occurring with other categories may lead to the associated prototypes being scattered with others (e.g., the orange), which is an expected outcome. To further explore the effectiveness of the XPRONET, we show an example of the generated report and the selected cross-modal prototype indices in Figure 1. For the word "lungs" and its corresponding image patch, the majority (nine of ten) of their selected responding cross-modal prototypes are the same, indicating that they learn the same cross-modal patterns and establish the cross-modal information flow via XPRONET, which is the expected behavior.
+
+The sensitivity of XPRONET to the number of responding prototype vectors $\gamma$ is shown in Figure 5. The BL-4 score reduces modestly when $\gamma$ increases from 13 to 14, and then culminates at (0.199) at 15, after which the score decreases steadily to 0.171 with the $\gamma$ increasing to 17 on the IU-Xray dataset. Generally, excessive or less responding prototype vectors can lead to notable performance drop. The reason being that excessive cross-modal prototype vectors may introduce noisy information, while inadequate numbers cannot provide sufficient cross-modal and class-related patterns. Figure 6 illustrates the influence of the tolerance rate controller term $\theta$ of XPRONET on the MIMIC-CXR benchmark. As we can see, the best performance is achieved with a $\theta$ value of 1.750, and performance drops at other values. A smaller $\theta$ represents a larger maximum similarity which forces the positive pairs to be more similar, causing a performance drop given dissimilar positive pairs. In contrast, XPRONET cannot learn useful cross-modal prototypes with a large $\theta$ which leads to a small maximum similarity. Therefore, it appears important to strike a good balance between the cross-modal prototype learning and dissimilarity tolerance.
+
+
+Fig. 5: Effect of varying $\gamma$ , number of responding prototype vectors on (BLEU-4 score).
+
+
+Fig.6: Effect of varying $\theta$ , tolerance rate control on (BLEU-4 score).
+
+# 5 Conclusions
+
+We propose a novel cross-modal prototype driven framework for medical report generation, XPRONET, which aims to explicitly model cross-modal pattern learning via a cross-modal prototype network. The class-related cross-modal prototype querying and responding module distills the cross-modal information into the single-model features and addresses the data bias problem. An improved multi-label contrastive loss is designed to better learn the cross-modal prototypes and can be easily incorporated into existing works. Experimental results on two publicly available benchmark datasets verify the superiority of XPRONET. We also provide ablation studies to demonstrate the effectiveness of the proposed component parts. A potential way to improve XPRONET is to increase the number of cross-modal prototypes, especially for larger datasets. In addition, we speculate that a more effective clustering approach in cross-modal prototype matrix initialization could bring further improvements.
+
+# References
+
+1. Anderson, P., He, X., Buehler, C., Teney, D., Johnson, M., Gould, S., Zhang, L.: Bottom-up and top-down attention for image captioning and visual question answering. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 6077-6086 (2018)
+2. Bao, G., Zhang, Y., Teng, Z., Chen, B., Luo, W.: G-transformer for document-level machine translation. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). pp. 3442-3455 (2021)
+3. Chen, Z., Shen, Y., Song, Y., Wan, X.: Cross-modal memory networks for radiology report generation. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). pp. 5904-5914 (2021)
+4. Cheng, J., Fostiropoulos, I., Boehm, B., Soleymani, M.: Multimodal phased transformer for sentiment analysis. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. pp. 2447-2458 (2021)
+5. Cornia, M., Stefanini, M., Baraldi, L., Cucchiara, R.: Meshed-memory transformer for image captioning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 10578-10587 (2020)
+6. Demner-Fushman, D., Kohli, M.D., Rosenman, M.B., Shooshan, S.E., Rodriguez, L., Antani, S., Thoma, G.R., McDonald, C.J.: Preparing a collection of radiology examinations for distribution and retrieval. Journal of the American Medical Informatics Association 23(2), 304-310 (2016)
+7. Denkowski, M., Lavie, A.: Meteor 1.3: Automatic metric for reliable optimization and evaluation of machine translation systems. In: Proceedings of the sixth workshop on Statistical Machine Translation. pp. 85-91 (2011)
+8. Guo, L., Liu, J., Zhu, X., Yao, P., Lu, S., Lu, H.: Normalized and geometry-aware self-attention network for image captioning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10327-10336 (2020)
+9. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 770-778 (2016)
+0. Hou, B., Kaissis, G., Summers, R.M., Kainz, B.: Ratchet: Medical transformer for chest x-ray diagnosis and reporting. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 293-303. Springer (2021)
+1. Ji, J., Luo, Y., Sun, X., Chen, F., Luo, G., Wu, Y., Gao, Y., Ji, R.: Improving image captioning by leveraging intra-and inter-layer global representation in transformer network. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 35, pp. 1655-1663 (2021)
+2. Jing, B., Wang, Z., Xing, E.: Show, describe and conclude: On exploiting the structure information of chest x-ray reports. In: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. pp. 6570-6580 (2019)
+3. Jing, B., Xie, P., Xing, E.: On the automatic generation of medical imaging reports. In: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). pp. 2577-2586 (2018)
+4. Johnson, A.E., Pollard, T.J., Greenbaum, N.R., Lungren, M.P., Deng, C.y., Peng, Y., Lu, Z., Mark, R.G., Berkowitz, S.J., Horng, S.: Mimic-cxr-jpg, a large publicly available database of labeled chest radiographs. arXiv preprint arXiv:1901.07042 (2019)
+
+15. Kacupaj, E., Plepi, J., Singh, K., Thakkar, H., Lehmann, J., Maleshkova, M.: Conversational question answering over knowledge graphs with transformer and graph attention networks. In: Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume. pp. 850-862 (2021)
+16. Krause, J., Johnson, J., Krishna, R., Fei-Fei, L.: A hierarchical approach for generating descriptive image paragraphs. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 317-325 (2017)
+17. Li, C.Y., Liang, X., Hu, Z., Xing, E.P.: Knowledge-driven encode, retrieve, paraphrase for medical image report generation. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 33, pp. 6666-6673 (2019)
+18. Li, Y., Liang, X., Hu, Z., Xing, E.P.: Hybrid retrieval-generation reinforced agent for medical image report generation. Advances in Neural Information Processing Systems 31 (2018)
+19. Lin, C.Y.: Rouge: A package for automatic evaluation of summaries. In: Text Summarization Branches Out. pp. 74-81 (2004)
+20. Liu, F., Ren, X., Liu, Y., Wang, H., Sun, X.: simnet: Stepwise image-topic merging network for generating detailed and comprehensive image captions. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. pp. 137-149 (2018)
+21. Liu, F., Wu, X., Ge, S., Fan, W., Zou, Y.: Exploring and distilling posterior and prior knowledge for radiology report generation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 13753-13762 (2021)
+22. Liu, G., Hsu, T.M.H., McDermott, M., Boag, W., Weng, W.H., Szolovits, P., Ghassemi, M.: Clinically accurate chest x-ray report generation. In: Machine Learning for Healthcare Conference. pp. 249-269. PMLR (2019)
+23. Lloyd, S.: Least squares quantization in pcm. IEEE Transactions on Information Theory 28(2), 129-137 (1982)
+24. Lu, J., Xiong, C., Parikh, D., Socher, R.: Knowing when to look: Adaptive attention via a visual sentinel for image captioning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 375-383 (2017)
+25. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of Machine Learning Research 9(11) (2008)
+26. Melas-Kyriazi, L., Rush, A.M., Han, G.: Training for diversity in image paragraph captioning. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. pp. 757-761 (2018)
+27. Miura, Y., Zhang, Y., Tsai, E., Langlotz, C., Jurafsky, D.: Improving factual completeness and consistency of image-to-text radiology report generation. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. pp. 5288-5304 (2021)
+28. Naseem, T., Ravishankar, S., Mihindukulasooriya, N., Abdelaziz, I., Lee, Y.S., Kapanipathi, P., Roukos, S., Gliozzo, A., Gray, A.: A semantics-aware transformer model of relation linking for knowledge base question answering. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). pp. 256-262 (2021)
+29. Nishino, T., Ozaki, R., Momoki, Y., Taniguchi, T., Kano, R., Nakano, N., Tagawa, Y., Taniguchi, M., Ohkuma, T., Nakamura, K.: Reinforcement learning with imbalanced dataset for data-to-text medical report generation. In: Findings of the Association for Computational Linguistics: EMNLP 2020. pp. 2223-2236 (2020)
+
+30. Pan, Y., Yao, T., Li, Y., Mei, T.: X-linear attention networks for image captioning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 10971-10980 (2020)
+31. Papineni, K., Roukos, S., Ward, T., Zhu, W.J.: Bleu: a method for automatic evaluation of machine translation. In: Proceedings of the 40th annual meeting of the Association for Computational Linguistics. pp. 311-318 (2002)
+32. Pei, W., Zhang, J., Wang, X., Ke, L., Shen, X., Tai, Y.W.: Memory-attended recurrent network for video captioning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8347-8356 (2019)
+33. Rennie, S.J., Marcheret, E., Mroueh, Y., Ross, J., Goel, V.: Self-critical sequence training for image captioning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 7008-7024 (2017)
+34. Smit, A., Jain, S., Rajpurkar, P., Pareek, A., Ng, A.Y., Lungren, M.: Combining automatic labelers and expert annotations for accurate radiology report labeling using bert. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). pp. 1500-1519 (2020)
+35. Sukhbaatar, S., Weston, J., Fergus, R., et al.: End-to-end memory networks. Advances in Neural Information Processing Systems 28 (2015)
+36. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017)
+37. Vedantam, R., Lawrence Zitnick, C., Parikh, D.: Cider: Consensus-based image description evaluation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4566-4575 (2015)
+38. Wang, J., Tang, J., Luo, J.: Multimodal attention with image text spatial relationship forOCR-basedimage captioning.In: Proceedings of the 28th ACM International Conference on Multimedia.pp.4337-4345 (2020)
+39. Wang, Q., Li, B., Xiao, T., Zhu, J., Li, C., Wong, D.F., Chao, L.S.: Learning deep transformer models for machine translation. In: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. pp. 1810-1822 (2019)
+40. Wang, Z., Wan, Z., Wan, X.: Transmodality: An end2end fusion method with transformer for multimodal sentiment analysis. In: Proceedings of The Web Conference 2020. pp. 2514-2520 (2020)
+41. Yang, K., Xu, H., Gao, K.: Cm-bert: Cross-modal bert for text-audio sentiment analysis. In: Proceedings of the 28th ACM International Conference on Multimedia. pp. 521-528 (2020)
+42. You, Q., Jin, H., Wang, Z., Fang, C., Luo, J.: Image captioning with semantic attention. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 4651-4659 (2016)
+43. Zhang, J., Luan, H., Sun, M., Zhai, F., Xu, J., Zhang, M., Liu, Y.: Improving the transformer translation model with document-level context. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. pp. 533-542 (2018)
+44. Zhang, Y., Wang, X., Xu, Z., Yu, Q., Yuille, A., Xu, D.: When radiology report generation meets knowledge graph. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 34, pp. 12910-12917 (2020)
+45. Zhao, X., Xiao, F., Zhong, H., Yao, J., Chen, H.: Condition aware and revise transformer for question answering. In: Proceedings of The Web Conference 2020. pp. 2377-2387 (2020)
\ No newline at end of file
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/images.zip b/crossmodalprototypedrivennetworkforradiologyreportgeneration/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ff9b4632f87b636f2bcb89cfea420346349597e3
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:334997d533a8bd57621ae70f91ddf240d5f7f6592609678f7a4bcbd89a523c8c
+size 426284
diff --git a/crossmodalprototypedrivennetworkforradiologyreportgeneration/layout.json b/crossmodalprototypedrivennetworkforradiologyreportgeneration/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e6e65c9f1acfed6466c01043b406447cf1f1ec33
--- /dev/null
+++ b/crossmodalprototypedrivennetworkforradiologyreportgeneration/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:81aa7ad8b4017270d610e617b7242a7bd832bf15e4b9ac7a7f624bfb13c332f5
+size 427321
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_content_list.json b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..dfa52954e056ba50ceacfb21842a343f73159170
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:761bb2cce035de6fdc5d4895e6df0096111fc4e8cac6ee716db2174574d8c70c
+size 80024
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_model.json b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..30c38b3baa894d689e2edd881848932af4fd6ada
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c603af2aa810b0c636919275f799919ffadbd93810a8448f91acfe1c3d209bf
+size 101724
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_origin.pdf b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c479c3fd6eea9a4e349ff822cb62f8fd59c388db
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/9438c134-49f6-4def-ae69-7a16a161a8e7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:152ad8df2cd643dbf6914924f26e2f59a5bd2f58cb2a859514faa964a458a28f
+size 2573125
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/full.md b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..06afdfb4b49802cb29d6fc620f31030d4df06967
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/full.md
@@ -0,0 +1,287 @@
+# CryoAI: Amortized Inference of Poses for Ab Initio Reconstruction of 3D Molecular Volumes from Real Cryo-EM Images
+
+Axel Levy $^{1,2,*}$ , Frédéric Poitevin $^{1,*}$ , Julien Martel $^{2,*}$ , Youssef Nashed $^{3}$ , Ariana Peck $^{1}$ , Nina Miolane $^{4}$ , Daniel Ratner $^{3}$ , Mike Dunne $^{1}$ , and Gordon Wetzstein $^{2}$
+
+$^{1}$ LCLS, SLAC National Accelerator Laboratory, Menlo Park, CA, USA
+ $^{2}$ Stanford University, Department of Electrical Engineering, Stanford, CA, USA
+ $^{3}$ ML Initiative, SLAC National Accelerator Laboratory, Menlo Park, CA, USA
+ $^{4}$ University of California Santa Barbara, Department of Electrical and Computer Engineering, Santa Barbara, CA, USA
+
+Abstract. Cryo-electron microscopy (cryo-EM) has become a tool of fundamental importance in structural biology, helping us understand the basic building blocks of life. The algorithmic challenge of cryo-EM is to jointly estimate the unknown 3D poses and the 3D electron scattering potential of a biomolecule from millions of extremely noisy 2D images. Existing reconstruction algorithms, however, cannot easily keep pace with the rapidly growing size of cryo-EM datasets due to their high computational and memory cost. We introduce cryoAI, an ab initio reconstruction algorithm for homogeneous conformations that uses direct gradient-based optimization of particle poses and the electron scattering potential from single-particle cryo-EM data. CryoAI combines a learned encoder that predicts the poses of each particle image with a physics-based decoder to aggregate each particle image into an implicit representation of the scattering potential volume. This volume is stored in the Fourier domain for computational efficiency and leverages a modern coordinate network architecture for memory efficiency. Combined with a symmetric loss function, this framework achieves results of a quality on par with state-of-the-art cryo-EM solvers for both simulated and experimental data, one order of magnitude faster for large datasets and with significantly lower memory requirements than existing methods.
+
+Keywords: Cryo-electron Microscopy, Neural Scene Representation
+
+# 1 Introduction
+
+Understanding the 3D structure of proteins and their associated complexes is crucial for drug discovery, studying viruses, and understanding the function of the fundamental building blocks of life. Towards this goal, cryo-electron microscopy (cryo-EM) of isolated particles has been developed as the go-to method for imaging and studying molecular assemblies at near-atomic resolution [21,31,39]. In a
+
+
+Fig. 1. (a) (Top) Illustration of a cryo-EM experiment. Molecules are frozen in a random orientation and their electron scattering potential (i.e., volume) $V$ interacts with an electron beam imaged on a detector. (Bottom) Noisy projections (i.e., particles) of $V$ selected from the full micrograph measured by the detector. (b) Output of a reconstruction algorithm: poses $\phi_i$ and volume $V$ . Each pose is characterized by a rotation in $SO(3)$ (hue represents in-plane rotation) and a translation in $\mathbb{R}^2$ (not shown). An equipotential surface of $V$ is shown on the right. (c) Evolution of the maximum number of images collected in one day [29] and established and emerging state-of-the-art reconstruction methods.
+
+
+
+
+
+
+$V:\mathbb{R}^3\to \mathbb{R}$
+
+cryo-EM experiment, a purified solution of the molecule of interest is frozen in a thin layer of vitreous ice, exposed to an electron beam, and randomly oriented projections of the electron scattering potential (i.e., the volume) are imaged on a detector (Fig. 1 (a)). These raw micrographs are then processed by an algorithm that reconstructs the volume and estimates the unknown pose, including orientation and centering shift, of each particle extracted from the micrographs (Fig. 1 (b)).
+
+Recent advances in sample preparation, instrumentation, and data collection capabilities have resulted in very large amounts of data being recorded for each cryo-EM experiment [4,29] (Fig. 1 (c)). Millions of noisy (images of) particles, each with an image size on the order of $100^{2} - 400^{2}$ pixels, need to be processed by the reconstruction algorithm to jointly estimate the pose of each particle and the unknown volume. Most existing algorithms that have been successful with experimental cryo-EM data address this problem using a probabilistic approach that iteratively alternates between updating the volume and the estimated poses [44,37,59,61]. The latter "orientation matching" step, however, is computationally expensive, requiring an exhaustive search in a 5-dimensional space $(\phi_{i}\in SO(3)\times \mathbb{R}^{2})$ for each particle. In spite of using smart pose search strategies and optimization schedules, the orientation matching step is the primary bottleneck of existing cryo-EM reconstruction algorithms, requiring hours to estimate a single volume and scaling poorly with increasing dataset sizes.
+
+We introduce cryoAI, a technique that uses direct gradient-based optimization to jointly estimate the poses and the electron scattering potential of a nondeformable molecule (homogeneous reconstruction). Our method operates in an unsupervised manner over a set of images with an encoder-decoder pipeline. The encoder learns a discriminative model that associates each particle image with a pose and the decoder is a generative physics-based pipeline that uses the
+
+predicted pose and a description of the volume to predict an image. The volume is maintained by an implicit, i.e., neural network-parameterized, representation in the decoder, and the image formation model is simulated in Fourier space, thereby avoiding the approximation of integrals via the Fourier-slice theorem (see Sec. 3.1). By learning a mapping from images to poses, cryoAI avoids the computationally expensive step of orientation matching that limits existing cryo-EM reconstruction methods. Our approach thus amortizes over the size of the dataset and provides a scalable approach to working with modern, large-scale cryo-EM datasets. We demonstrate that cryoAI performs homogeneous reconstructions of a comparable resolution but with nearly one order of magnitude faster runtime than state-of-the-art methods using datasets containing millions of particles.
+
+Specifically, our contributions include
+
+- a framework that learns to map images to particle poses while reconstructing an electron scattering potential for homogeneous single-particle cryo-EM;
+- demonstration of reconstruction times and memory consumption that amortize over the size of the dataset, with nearly an order of magnitude improvement over existing algorithms on large datasets;
+formulations of a symmetric loss function and an implicit Fourier-domain volume representation that enable the high-quality reconstructions we show.
+
+Source code is available at https://github.com/compSPI/cryoAI.
+
+# 2 Related Work
+
+Estimating the 3D structure of an object from its 2D projections with known orientations is a classical problem in tomography and has been solved using backprojection-based methods [18,43] or compressive sensing-style solvers [8,12]. In cryo-EM, the reconstruction problem is complicated by several facts: (1) the poses of the unknown object are also unknown for all projections; (2) the signal-to-noise ratio (SNR) is extremely low (around $-20$ dB for experimental datasets [6,5]); (3) the molecules in a sample can deform and be frozen in various (unknown) conformations. Unlike homogeneous reconstruction methods, heterogeneous methods take into account the deformations of the molecule and reconstruct a discrete set or a low-dimensional manifold of conformations. Although they give more structural information, most recent heterogeneous methods [59,36,62,9] assume the poses to be known. For each particle $i$ , a pose $\phi_{i}$ is defined by a rotation $R_{i} \in SO(3)$ and a translation $\mathbf{t}_{i} \in \mathbb{R}^{2}$ . In this work, we do not assume the poses to be known and aim to estimate the electron scattering function $V$ of a unique underlying molecule in a homogeneous setting. We classify previous work on pose estimation into two inference categories [11]: non-amortized and amortized.
+
+Non-amortized Inference refers to a class of methods where the posterior distribution of the poses $p(\phi_i | Y_i, V)$ is computed independently for each image $Y_i$ . Common-line approaches [51,47,55,16,35,57], projection-matching strategies [33,3] and Bayesian formulations [24,10,45,37] belong to this category. The
+
+software package RELION [44] widely popularized the Bayesian approach by performing Maximum-A-Posteriori (MAP) optimization through Expectation-Maximization (EM). Posterior distributions over the poses (and the optional conformational states) are computed for each image in the expectation step and all frequency components of the volume are updated in the maximization step, which makes the approach computationally costly. The competing software cryoSPARC [37] proposed to perform MAP optimization jointly using stochastic gradient descent (SGD) to optimize the volume $V$ and branch-and-bound algorithms [22] to estimate the poses $\phi_{i}$ . While a gradient-based optimization scheme for $V$ circumvents the costly updates in the maximization step of RELION, a pose must be estimated for each image by aligning each 2D projection $Y_{i}$ with the estimated 3D volume $V$ . Although branch-and-bound algorithms can accelerate the pose search, this step remains computationally expensive and is one of the bottlenecks of the method in terms of runtime. Ullrich et al. [50] proposed a variational and differentiable formulation of the optimization problem in the Fourier domain. Although they demonstrated that their method can estimate the volume when poses are known, they also showed that jointly optimizing the pose posterior distributions by SGD fails due to the high non-convexity of the problem. Instead of parameterizing the volume with a 3D voxel array, Zhong et al. proposed in cryoDRGN [60,59,61] to use a coordinate-based representation (details in Sec. 3.4) to directly approximate the electron scattering function in Fourier space. Their neural representation takes 3D Fourier coordinates and a latent vector encoding the conformational state as input, therefore accounting for continuous deformations of the molecule. The latest published version of cryoDRGN [59] reports excellent results on the reconstruction of conformation heterogeneities but assumes the poses to be determined by a consensus reconstruction. Poses are jointly estimated with $V$ in cryoDRGN-BNB [60] and cryoDRGN2 [61], but in spite of a frequency-marching strategy, the use of a branch-and-bound algorithm and a later introduced multi-resolution approach the global 5D pose search remains the most computationally expensive step in their pipeline.
+
+Amortized Inference techniques, on the other hand, learn a parameterized function $q_{\xi}(Y_i)$ that approximates the posterior distribution of the poses $p(\phi_i|Y_i,V)$ [14]. At the expense of optimizing the parameter $\xi$ , these techniques avoid the orientation matching step which is the main computational bottleneck in non-amortized methods. Lian et al [23] demonstrated the possibility of using a convolutional neural network to approximate the mapping between cryo-EM images and orientations, but their method cannot perform end-to-end volume reconstruction. In cryoVAEGAN [27], Miolane et al. showed that the in-plane rotation could be disentangled from the contrast transfer function (CTF) parameters in the latent space of an encoder. Rosenbaum et al. [41] were the first to demonstrate volume reconstruction from unknown poses in a framework of amortized inference. In their work, distributions of poses and conformational states are predicted by the encoder of a Variational Autoencoder (VAE) [20]. In their model-based decoder, the predicted conformation is used to deform a base
+
+backbone frame of Gaussian blobs and the predicted pose is used to make a projection of these blobs. The reconstructed image is compared to the measurement in order to optimize the parameters of both the encoder and the decoder. While this method is able to account for conformational heterogeneity in a dataset, it requires a priori information about the backbone frame. CryoPoseNet [30] proposed a non-variational autoencoder framework that can perform homogeneous reconstruction with a random initialization of the volume, avoiding the need for prior information about the molecule. Although it demonstrated the possibility of using a non-variational encoder to predict the orientations $R_{i}$ , cryoPoseNet assumes the translations $\mathbf{t}_i$ to be given and the volume is stored in real space in the decoder (while the image formation model is in Fourier space, see Sec. 3.1), thereby requiring a 3D Fourier transform at each forward pass and making the overall decoding step slow. The volume reconstructed by cryoPoseNet often gets stuck in local minima, which is a problem we also address in this paper (see Sec. 3.5). Finally, the two last methods only proved they could be used with simulated datasets and, to the best of our knowledge, no amortized inference technique for volume estimation from unknown poses have been proven to work with experimental datasets in cryo-EM.
+
+Previous methods differ in the way poses are inferred in the generative model. Yet, the only variable of interest is the description of the conformational state (for heterogeneous methods) and associated molecular volumes, while poses can be considered "nuisance" variables. As a result, recent works have explored methods that avoid the inference of poses altogether, such as GAN-based approaches [1]. CryoGAN [17], for example, used a cryo-EM simulator and a discriminator neural network to optimize a 3D volume. Although preliminary results are shown on experimental datasets, the reconstruction cannot be further refined with other methods due to the absence of predicted poses.
+
+Our approach performs an amortized inference of poses and therefore circumvents the need for expensive searches over $SO(3) \times \mathbb{R}^2$ , as in non-amortized techniques. In the implementation, no parameter needs to be statically associated with each image. Consequently, the memory footprint and the runtime of our algorithm does not scale with the number of images in the dataset. We introduce a loss function called "symmetric loss" that prevents the model from getting stuck in local minima with spurious planar symmetries. Finally, in contrast to previous amortized inference techniques, our method can perform volume reconstruction on experimental datasets.
+
+# 3 Methods
+
+# 3.1 Image Formation Model and Fourier-slice Theorem
+
+In a cryo-EM sample, the charges carried by each molecule and their surrounding environment create an electrostatic potential that scatters probing electrons, which we refer to as the electron scattering "volume," and consider as a mapping
+
+
+Fig. 2. Overview of our pipeline. The encoder, parameterized by $\xi$ learns to map images $Y_{i}$ to their associated pose $\phi_i = (R_i,\mathbf{t}_i)$ . The matrix $R_{i}$ rotates a slice of 3D coordinates in Fourier space. The coordinates are fed into a neural representation of $\hat{V}$ , parameterized by $\theta$ . The output is multiplied by the CTF $C_i$ and the translation operator $\hat{T}_{\mathbf{t}_i}$ to build $\hat{X}_i$ , a noise-free estimation of $\mathcal{F}_{\mathrm{2D}}[Y_i] = \hat{Y}_i$ . $\hat{X}_i$ and $\hat{Y}_i$ are compared via the symmetric loss $\mathcal{L}_{\mathrm{sym}}$ . Differentiable parameters are represented in blue.
+
+$$
+V: \mathbb {R} ^ {3} \rightarrow \mathbb {R}. \tag {1}
+$$
+
+In the sample, each molecule $i$ is in an unknown orientation $R_{i}\in SO(3)\subset \mathbb{R}^{3\times 3}$ . The probing electron beam interacts with the electrostatic potential and its projections
+
+$$
+Q _ {i}: (x, y) \mapsto \int_ {z} V \left(R _ {i} \cdot [ x, y, z ] ^ {T}\right) d z \tag {2}
+$$
+
+are considered mappings from $\mathbb{R}^2$ to $\mathbb{R}$ . The beam then interacts with the lens system characterized by the Point Spread Function (PSF) $P_{i}$ and individual particles are cropped from the full micrograph. The obtained images may not be perfectly centered on the molecule and small translations are modeled by $\mathbf{t}_i\in \mathbb{R}^2$ . Finally, taking into account signal arising from the vitreous ice into which the molecules are embedded as well as the non-idealities of the lens and the detector, each image $Y_{i}$ is generally modeled as
+
+$$
+Y _ {i} = T _ {\mathbf {t} _ {i}} * P _ {i} * Q _ {i} + \eta_ {i} \tag {3}
+$$
+
+where $*$ is the convolution operator, $T_{\mathbf{t}}$ the $\mathbf{t}$ -translation kernel and $\eta_{i}$ white Gaussian noise on $\mathbb{R}^2$ [53,44].
+
+With a formulation in real space, both the integral over $z$ in Eq. (2) and the convolution in Eq. (3) make the simulation of the image formation model computationally expensive. A way to avoid these operations is to use the Fourier-slice Theorem [7], which states that for any volume $V$ and any orientation $R_{i}$ ,
+
+$$
+\mathcal {F} _ {\mathrm {2 D}} \left[ Q _ {i} \right] = \mathcal {S} _ {i} \left[ \mathcal {F} _ {\mathrm {3 D}} [ V ] \right], \tag {4}
+$$
+
+where $\mathcal{F}_{\mathrm{2D}}$ and $\mathcal{F}_{\mathrm{3D}}$ are the 2D and 3D Fourier transform operators and $\mathcal{S}_i$ the "slice" operator defined such that for any $\hat{V}:\mathbb{R}^3\to \mathbb{C}$
+
+$$
+\mathcal {S} _ {i} [ \hat {V} ]: (k _ {x}, k _ {y}) \mapsto \hat {V} \left(R _ {i} \cdot \left[ k _ {x}, k _ {y}, 0 \right] ^ {T}\right). \tag {5}
+$$
+
+That is, $S_{i}[\hat{V}]$ corresponds to a 2D slice of $\hat{V}$ with orientation $R_{i}$ and passing through the origin. In a nutshell, if $\hat{Y}_{i} = \mathcal{F}_{\mathrm{2D}}[Y_{i}]$ and $\hat{V} = \mathcal{F}_{\mathrm{3D}}[V]$ , the image formation model in Fourier space can be expressed as
+
+$$
+\hat {Y} _ {i} = \hat {T} _ {\mathbf {t} _ {i}} \odot C _ {i} \odot S _ {i} [ \hat {V} ] + \hat {\eta} _ {i}, \tag {6}
+$$
+
+where $\odot$ is the element-wise multiplication, $C_i = \mathcal{F}_{2\mathrm{D}}[P_i]$ is the Contrast Transfer Function (CTF), $\hat{T}_{\mathbf{t}}$ the $\mathbf{t}$ -translation operator in Fourier space (phase shift) and $\hat{\eta}_i$ complex white Gaussian noise on $\mathbb{R}^2$ . Based on this generative model, cryoAI solves the inverse problem of inferring $\hat{V}$ , $R_i$ and $\mathbf{t}_i$ from $\hat{Y}_i$ assuming $C_i$ is known.
+
+# 3.2 Overview of CryoAI
+
+CryoAI is built with an autoencoder architecture (see Fig. 2). The encoder takes an image $Y_{i}$ as input and outputs a predicted orientation $R_{i}$ along with a predicted translation $\mathbf{t}_{i}$ (Sec. 3.3). $R_{i}$ is used to rotate a 2-dimensional grid of $L^{2}$ 3D-coordinates $[k_x, k_y, 0] \in \mathbb{R}^3$ which are then fed into the neural network $\hat{V}_{\theta}$ . This neural network is an implicit representation of the current estimate of the volume $\hat{V}$ (in Fourier space), and this query operation corresponds to the "slicing" defined by Eq. (5) (Sec. 3.4). Based on the estimated translation $\mathbf{t}_{i}$ and given CTF parameters $C_i$ , the rest of the image formation model described in Eq. (6) is simulated to obtain $\hat{X}_i$ , a noise-free estimation of $\hat{Y}_i$ . These images are compared using a loss described in Sec. 3.5 and gradients are backpropagated throughout the differentiable model in order to optimize both the encoder and the neural representation.
+
+# 3.3 Pose Estimation
+
+CryoAI uses a Convolutional Neural Network (CNN) to predict the parameters $R_{i}$ and $\mathbf{t}_i$ from a given image, thereby avoiding expensive orientation matching computations performed by other methods [44,37,61]. The architecture of this encoder has three layers.
+
+1. Low-pass filtering: $Y_{i} \in \mathbb{R}^{L \times L}$ is fed into a bank of Gaussian low-pass filters.
+2. Feature extraction: the filtered images are stacked channel-wise and fed into a CNN whose architecture is inspired by the first layers of VGG16 [46], which is known to perform well on image classification tasks.
+3. Pose estimation: this feature vector finally becomes the input of two separate fully-connected neural networks. The first one outputs a vector of dimension 6 of $S^2 \times S^2$ [63] (two vectors on the unitary sphere in $\mathbb{R}^3$ ) and converted into a matrix $R_i \in \mathbb{R}^{3 \times 3}$ using the PyTorch3D library [38]. The second one outputs a vector of dimension 2, directly interpreted as a translation vector $\mathbf{t}_i \in \mathbb{R}^2$ .
+
+We call $\xi$ the set of differentiable parameters in the encoder described above. We point the reader to Supp. B for more details about the architecture of the encoder.
+
+# 3.4 Neural Representation in Fourier Space (FourierNet)
+
+Instead of using a voxel-based representation, we maintain the current estimate of the volume using a neural representation. This representation is parameterized by $\theta$ and can be seen as a mapping $\hat{V}_{\theta}:\mathbb{R}^{3}\to \mathbb{C}$ .
+
+In imaging and volume rendering, neural representations have been used to approximate signals defined in real space [32,2,13,25,49]. Neural Radiance Field (NeRF) [26] is a successful technique to maintain a volumetric representation of a real scene. A view-independent NeRF model, for example, maps real 3D-coordinates $[x,y,z]$ to a color vector and a density scalar using positional encoding [52] and a set of fully-connected layers with ReLU activation functions. Sinusoidal Representation Networks (SIRENs) [48] can also successfully approximate 3D signed distance functions with a shallow fully-connected neural network using sinusoidal activation functions. However, these representations are tailored to approximate signals defined in real space. Here, we want to directly represent the Fourier transform of the electrostatic potential of a molecule. Since this potential is a smooth function of the spatial coordinates, the amplitude of its Fourier coefficients $\hat{V} (\mathbf{k})$ is expected to decrease with $|\mathbf{k}|$ , following a power law (see Supp. C for more details). In practice, this implies that $|\hat{V} |$ can vary over several orders of magnitude and SIRENs, for example, are known to poorly approximate these types of functions [48]. The first method to use neural representations for volume reconstruction in cryo-EM, cryoDRGN [60,61], proposed to use a Multi-Layer Perceptron (MLP) with positional encoding in Hartley space (where the FST still applies).
+
+With our work, we introduce a new kind of neural representation (Fourier-Net), tailored to represent signals defined in the Fourier domain, inspired by the success of SIRENs for signals defined in real space. Our idea is to allow a SIREN to represent a signal with a high dynamic range by raising its output in an exponential function. Said differently, the SIREN only represents a signal that scales logarithmically with the approximated function. Since Fourier coefficients are defined on the complex plane, we use a second network in our implicit representation to account for the phase variations. This architecture is summarized in Fig. 2 and details on memory requirements are given in Supp. C. Input coordinates $[k_x, k_y, k_z]$ are fed into two separate SIRENs outputting 2-dimensional vectors. For one of them, the exponential function is applied element-wise and the two obtained vectors are finally element-wise multiplied to produce a vector in $\mathbb{R}^2$ , mapped to $\mathbb{C}$ with the Cartesian coordinate system. Since $\hat{V}_{\theta}$ must represent the Fourier transform of real signals, we know that it should verify $\hat{V}_{\theta}(-\mathbf{k}) = \hat{V}_{\theta}(\mathbf{k})^{*}$ . We enforce this property by defining
+
+$$
+\hat {V} _ {\theta} (\mathbf {k}) = \hat {V} _ {\theta} (- \mathbf {k}) ^ {*} \quad \text {i f} k _ {x} < 0. \tag {7}
+$$
+
+Benefits of this neural representation are shown on 2-dimensional signals in the Supp. C.
+
+The neural representation is queried for a set of $L^2$ 3D-coordinates $[k_x, k_y, k_z]$ , thereby producing a discretized slice $\mathcal{S}_i[\hat{V}_{\theta}]\in \mathbb{C}^{L\times L}$ . The rest of the image
+
+formation model (6) is simulated by element-wise multiplying $S_{i}[\hat{V}_{\theta}]$ by the CTF $C_i$ and a translation matrix,
+
+$$
+\hat {X} _ {i} = \hat {T} _ {\mathbf {t} _ {i}} \odot C _ {i} \odot \mathcal {S} _ {i} [ \hat {V} _ {\theta} ], \tag {8}
+$$
+
+where $\hat{T}_{\mathbf{t}_i}$ is defined by
+
+$$
+\hat {T} _ {\mathbf {t} _ {i}} (\mathbf {k}) = \exp (- 2 j \pi \mathbf {k} \cdot \mathbf {t} _ {i}). \tag {9}
+$$
+
+The parameters of the CTF are provided by external CTF estimation softwares such as CTFFIND [40]. The whole encoder-decoder pipeline can be seen as a function that we call $\Gamma_{\xi, \theta}$ , such that $\hat{X}_i = \Gamma_{\xi, \theta}(Y_i)$ .
+
+# 3.5 Symmetric Loss
+
+In the image formation model of Eq. (3), the additive noise $\eta_{i}$ is assumed to be Gaussian and uncorrelated (white Gaussian noise) [53,44], which means that its Fourier transform $\hat{\eta}_i$ follows the same kind of distribution. Therefore, maximum likelihood estimation on a batch $\mathcal{B}$ amounts to the minimization of the L2-loss.
+
+Nonetheless, we empirically observed that using this loss often led the model to get stuck in local minima where the estimated volume showed spurious planar symmetries (see Sec. 4.3). We hypothesize that this behaviour is linked to the fundamental ambiguity contained in the image formation model in which, given unknown poses, one cannot distinguish two "mirrored" versions of the same volume [42]. We discuss this hypothesis in more detail in Supp. D. To solve this problem, we designed a loss that we call "symmetric loss" defined as
+
+$$
+\mathcal {L} _ {\mathrm {s y m}} = \sum_ {i \in \mathcal {B}} \min \left\{\| \hat {Y} _ {i} - \Gamma_ {\xi , \theta} (Y _ {i}) \| ^ {2}, \| \mathcal {R} _ {\pi} [ \hat {Y} _ {i} ] - \Gamma_ {\xi , \theta} (\mathcal {R} _ {\pi} [ Y _ {i} ]) \| ^ {2} \right\} \tag {10}
+$$
+
+where $\mathcal{R}_{\pi}$ applies an in-plane rotation of $\pi$ on $L\times L$ images. Using the symmetric loss, the model can be supervised on a set of images $Y_{i}$ in which the predicted in-plane rotation (embedded in the predicted matrix $R_{i}$ ) can always fall in $[- \pi /2,\pi /2]$ instead of $[- \pi ,\pi ]$ . As shown in Sec. 4.3 and explained in Supp. D, this prevents cryoAI from getting stuck in spuriously symmetrical states.
+
+# 4 Results
+
+We qualitatively and quantitatively evaluate cryoAI for ab initio reconstruction of both simulated and experimental datasets. We first compare cryoAI to the state-of-the-art method cryoSPARC [37] in terms of runtime on a simulated dataset of the 80S ribosome with low levels of noise. We then compare our method with baseline methods in terms of resolution and pose accuracy on simulated datasets with and without noise (spike, spliceosome). Next, we show that cryoAI can perform ab initio reconstruction on an experimental cryo-EM dataset (80S), which is the first time for a method estimating poses in an amortized fashion. Finally, we highlight the importance of a tailored neural representation in the decoder and the role of the symmetric loss in an ablation study.
+
+
+Fig. 3. (Left) Time to reach $10\AA$ of resolution with cryoAI (range and average over 5 runs per datapoint) and cryoSPARC vs. number of images in the simulated 80S dataset. (Right) Estimated volume at initialization and after $35\mathrm{min}$ of running cryoAI vs. cryoSPARC after convergence, with 9M images.
+
+# 4.1 Reconstruction on Simulated Datasets
+
+Experimental Setup. We synthesize three datasets from deposited Protein Data Bank (PDB) structures of the Plasmodium falciparum 80S ribosome (PDB: 3J79 and 3J7A) [56], the SARS-CoV-2 spike protein (PDB: 6VYB) [54] and the pre-catalytic spliceosome (PDB: 5NRL) [34]. First, a 3D grid map, the ground-truth volume, is generated in ChimeraX [15] from each atomic model using the steps described in Supp. A. Then a dataset is generated from the ground-truth volume using the image formation model described in Sec. 3.1. Images are sampled at $L = 128$ . Rotations $R_{i}$ are randomly generated following a uniform distribution over $SO(3)$ and random translations $\mathbf{t}_{i}$ are generated following a zero-mean Gaussian distribution $(\sigma = 20\AA)$ . The defocus parameters of the CTFs are generated with a log-normal distribution. We build noise-free (ideal) and noisy versions of each dataset (SNR = 0dB for 80S, SNR = -10dB for the others, see Supp. E for details). We compare cryoAI with three baselines: the state-of-the-art software cryoSPARC v3.2.0 [37] with default settings, the neural network-based method cryoDRGN2 [61] and the autoencoder-based method cryoPoseNet [30] (with the image formation model in real space in the decoder, see Supp. A). We quantify the accuracy of the reconstructed volume by computing the Fourier Shell Correlations (FSC) between the reconstruction and the ground truth and reporting the resolution at the 0.5 cutoff. All experiments are run on a single Tesla V100 GPU with 8 CPUs.
+
+Convergence Time. We compare cryoAI with cryoSPARC in terms of runtime for datasets of increasing size in Fig. 3. We use the simulated 80S dataset and define the running time as the time needed to reach a resolution of $10\AA$ (2.65 pixels), which is a sufficiently accurate resolution to perform refinement with cryoSPARC (see workflow in Supp. A). With default parameters, cryoSPARC's ab initio reconstruction must process all images in the dataset. We show the time required by cryoSPARC for importing data and for the refine-
+
+Table 1. Accuracy of pose and volume estimation for simulated data. Resolution (Res.) is reported using the FSC = 0.5 criterion, in pixels $(\downarrow)$ . Rotation (Rot.) error is the median square Frobenius norm between predicted and ground truth matrices $R_{i}(\downarrow)$ . Translation (Trans.) error is the mean square L2-norm, in pixels $(\downarrow)$ .
+
+| Dataset | cryoPoseNet | cryoSPARC | cryoDRGN2 | cryoAI |
| Spliceosome (ideal) | Res. | 2.78 | 2.13 | — | 2.13 |
| Rot. | 0.004 | 0.0002 | — | 0.0004 |
| Trans. | — | 0.006 | — | 0.001 |
| Spliceosome (noisy) | Res. | 3.15 | 2.61 | — | 2.61 |
| Rot. | 0.01 | 0.002 | — | 0.007 |
| Trans. | — | 0.007 | — | 0.01 |
| Spike (ideal) | Res. | 16.0 | 2.33 | — | 2.29 |
| Rot. | 5 | 0.0003 | 0.0001 | 0.0003 |
| Trans. | — | 0.007 | — | 0.001 |
| Spike (noisy) | Res. | 16.0 | 3.56 | 2.03 | 2.91 |
| Rot. | 6 | 0.02 | 0.01 | 0.01 |
| Trans. | — | 0.008 | — | 0.003 |
+
+ment step. CryoAI processes images batch-wise and does not statically associates variables to each image, making the convergence time (for reaching the specified resolution) independent from the size of the dataset. By contrast, the computation time of cryoSPARC increases with the number of images and can reach 5 hours with a dataset of 9M particles. We additionally show in Supp F the time required to estimate all the poses of the dataset with cryoAI's encoder.
+
+Accuracy. We compare cryoAI with baseline methods on the spike and spliceosome datasets in Table 1. We compare the reconstructed variables (volume and poses) with their ground truth values (from simulation). Results of cryoDRGN2 are reported from available data in [59]. Images were centered for cryoPoseNet since the method does not predict $\mathbf{t}_i$ . A "tight" adaptive mask was used with cryoSPARC. The performance of cryoAI is comparable with the baselines. The spliceosome and the noise-free spike protein are reconstructed with state-of-the-art accuracy. In the noisy spike dataset, the accuracy of cryoAI and cryoSPARC decreases, which may be due to the pseudo-symmetries shown by the molecule (visual reconstruction in Supp. F). CryoPoseNet gets stuck for at least 24 hours in a state where the resolution is very poor on both spike datasets.
+
+# 4.2 Reconstruction on Experimental Datasets
+
+Experimental Setup. We use the publicly available 80S experimental dataset EMPIAR-10028 [56,58,19] containing 105,247 images of length $L = 360$ (1.34 Å per pixel), downsampled to $L = 256$ . The dataset is evenly split in two, each method runs independent reconstructions on each half and the FSC are measured between the two reconstructions. We compare cryoAI with cryoPoseNet and cryoSPARC. The dataset fed to cryoAI and cryoPoseNet is masked with
+
+
+Fig.4. (Top left) Volume reconstruction on a noise-free simulated dataset of the spliceosome ( $L = 128$ , pixel size $= 4.25 \, \text{\AA}$ ). (Bottom left) Volume reconstruction for the experimental 80S dataset ( $L = 128$ , pixel size $= 3.77 \, \text{\AA}$ ). (Right) Fourier Shell Correlations, reconstruction-to-ground-truth (top) or reconstruction-to-reconstruction (bottom). A resolution of 2.0 pixels corresponds to the Nyquist frequency. CryoAI can be refined using the software cryoSPARC.
+
+a circular mask of radius 84 pixels, while cryoSPARC adaptively updates a "tight" mask. CryoAI and cryoPoseNet reconstruct a volume of size $128^{3}$ . For cryoSPARC, both the ab initio volume and the volume subsequently homogeneously refined from it were downsampled to the same size $128^{3}$ . We also demonstrate the possibility of refining cryoAI's output with the software cryoSPARC. Finally, we report the results published for cryoDRGN2 [61] that were obtained on a filtered version of the same dataset [58] downsampled to $L = 128$ prior reconstruction.
+
+Results. We report quantitative and qualitative results in Fig. 4. CryoAI is the first amortized method to demonstrate proper volume reconstruction on an experimental dataset, although techniques predicting poses with an orientation-matching step (like cryoDRGN2) or followed by an EM-based refinement step (like cryoSPARC) can reach slightly higher resolutions. State-of-the-art results can be obtained with cryoSPARC's refinement, initialized from either cryoSPARC's or cryoAI's ab initio. Since simulated datasets were built using the same image formation model as the one cryoAI uses in its decoder, the gap in performance between the experimental and simulated datasets suggests that improvements could potentially be achieved with a more accurate physics model.
+
+Ablation Study on Symmetrized Loss
+
+| Method/Loss | Time | Rot. Error |
| cryoPoseNet | L2 | 4:35 h | 0.01 |
| Sym. | 0:30 h | 0.01 |
| cryoAI | L2 | 1:35 h | 0.005 |
| Sym. | 0:09 h | 0.004 |
+
+
+Fig. 5. (Top left) Ablation study on the symmetric loss with cryoAI and cryoPoseNet with simulated noise-free adenylate kinase ( $L = 64$ ). We report the minimal convergence time out of 5 runs. CryoPoseNet is always slower and achieves worse results. The symmetric loss always accelerates convergence. (Bottom left) Volume reconstruction when using a L2 loss vs. the symmetric loss. The latter prevents the model from getting stuck in a symmetrical local minimum. (Right) Loss and resolution (in pixels, $\mathrm{FSC} = 0.143$ cutoff) vs. number of iterations with a FourierNet, a SIREN [48] and an MLP with ReLU activation functions and positional encoding (32 images per batch).
+
+
+Ablation Study on Neural Representation
+
+# 4.3 Ablation Study
+
+Importance of Symmetric Loss. The purpose of the symmetric loss is to prevent the model from getting stuck in local minima where the volume shows incorrect planar symmetries. Ullrich et al. showed in [50] that optimizing the poses using a gradient-based method often leads the model to fall in sub-optimal minima, due to the high non-convexity of the optimization problem. In [61], Zhong et al. implemented an autoencoder-based method (dubbed PoseVAE), and compared it to cryoDRGN2. The method is unable to properly reconstruct a synthetic hand, and a spurious planar symmetry appears in their reconstruction. We use a noisy dataset $(L = 128)$ generated from a structure of Adenylate kinase (PDB 4AKE) [28]. We show in Fig. 5 that our method presents the same kind of artifact when using a L2 loss and validate that the symmetric loss prevents these artifacts. In Fig. 5, we compare our method to cryoPoseNet with and without the symmetric loss on a simulated ideal dataset of the same molecule $(L = 64)$ . Both methods use an autoencoder-based architecture and both converge significantly faster with the symmetric loss. With the same loss, cryoAI is always faster than cryoPoseNet since our method operates in Fourier space and avoids the approximation of integrals using the FST.
+
+Comparison of Neural Representations. We replaced FourierNet with other neural representations in the decoder and compared the convergence rate of these models on the noisy Adenylate kinase dataset $(\mathrm{L} = 128)$ . In Fig. 5, we compare our architecture with a multi-layer perceptron (MLP) with sinusoidal activation functions (i.e., a SIREN [48]) and an MLP with ReLU activation function and positional encoding, as used by cryoDRGN2 [61]. We keep approximately $300\mathrm{k}$ differentiable parameters in all representations. FourierNet significantly outperforms the two other architectures in terms of convergence speed.
+
+# 5 Discussion
+
+The amount of collected cryo-EM data is rapidly growing [29], which increases the need for efficient ab initio reconstruction methods. CryoAI proposes a framework of amortized inference to meet this need by having a complexity that does not grow with the size of the dataset. Since CryoAI jointly estimates volume and poses, it can be followed by reconstruction methods that address conformational heterogeneities, such as the ones available in cryoSPARC [37], RELION [44], or cryoDRGN [59]. The ever increasing size of cryo-EM datasets is necessary to provide sufficient sampling of conformational heterogeneities with increasing accuracy, in particular when imaging molecules that display complex dynamics. However, existing methods that tackle the more complex inference task of heterogeneous reconstruction also see their runtime suffer as datasets grow bigger, again showing the need for new developments that leverage amortized inference.
+
+Future work on cryoAI includes adding features to the image formation model implemented in the decoder. CTFs, for example, are currently only characterized by three parameters (two defoci parameters and an astigmatism angle) but could be readily enhanced to account for higher-order effects (see e.g. [64]). A richer noise model, currently assumed to be Gaussian and white, could also improve the performance of the algorithm. In order to tackle the case of very noisy experimental datasets, adaptive masking techniques, such as those used by cryoSPARC, could be beneficial. In terms of hardware development, cryoAI would benefit from being able to run on more than a single GPU using data parallelism and/or model parallelism, thereby improving both runtime and efficiency. CryoAI, as described here, belongs to the class of homogeneous reconstruction methods; future developments should explore its performance in an heterogeneous reconstruction setting, where conformational heterogeneity is baked in the generative model and the encoder is enhanced to predict descriptions of conformational states in low-dimensional latent space along with the poses.
+
+Acknowledgment. We thank Wah Chiu for numerous discussions that helped shape this project. This work was supported by the U.S. Department of Energy, under DOE Contract No. DE-AC02-76SF00515. N.M. acknowledges support from the National Institutes of Health (NIH), grant No. 1R01GM144965-01. We acknowledge the use of the computational resources at the SLAC Shared Scientific Data Facility (SDF).
+
+# References
+
+1. Akçakaya, M., Yaman, B., Chung, H., Ye, J.C.: Unsupervised deep learning methods for biological image reconstruction and enhancement: An overview from a signal processing perspective. IEEE Signal Processing Magazine 39, 28-44 (2022)
+2. Atzmon, M., Lipman, Y.: Sal: Sign agnostic learning of shapes from raw data. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2565-2574 (2020)
+3. Baker, T.S., Cheng, R.H.: A model-based approach for determining orientations of biological macromolecules imaged by cryoelectron microscopy. Journal of Structural Biology 116, 120-130 (1996)
+4. Baldwin, P.R., Tan, Y.Z., Eng, E.T., Rice, W.J., Noble, A.J., Negro, C.J., Cianfrocco, M.A., Potter, C.S., Carragher, B.: Big data in cryoEM: automated collection, processing and accessibility of em data. Current Opinion in Microbiology 43, 1-8 (2018)
+5. Bendory, T., Bartesaghi, A., Singer, A.: Single-particle cryo-electron microscopy: Mathematical theory, computational challenges, and opportunities. IEEE signal processing magazine 37, 58-76 (2020)
+6. Bepler, T., Kelley, K., Noble, A.J., Berger, B.: Topaz-denoise: general deep denoising models for cryoEM and cryoET. Nature communications 11, 1-12 (2020)
+7. Bracewell, R.N.: Strip integration in radio astronomy. Australian Journal of Physics 9, 198-217 (1956)
+8. Candes, E., Romberg, J., Tao, T.: Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information. IEEE Transactions on Information Theory 52, 489-509 (2006)
+9. Chen, M., Ludtke, S.J.: Deep learning-based mixed-dimensional Gaussian mixture model for characterizing variability in cryo-EM. Nature Methods 18, 930–936 (2021)
+0. Dempster, A.P., Laird, N.M., Rubin, D.B.: Maximum Likelihood from Incomplete Data Via the EM Algorithm. Journal of the Royal Statistical Society: Series B (Methodological) 39, 1-22 (1977)
+1. Donnat, C., Levy, A., Poitevin, F., Miolane, N.: Deep Generative Modeling for Volume Reconstruction in Cryo-Electron Microscopy. arXiv: 2201.02867 (2022)
+2. Donoho, D.: Compressed sensing. IEEE Transactions on Information Theory 52, 1289-1306 (2006)
+3. Genova, K., Cole, F., Vlasic, D., Sarna, A., Freeman, W.T., Funkhouser, T.: Learning shape templates with structured implicit functions. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 7154-7164 (2019)
+4. Gershman, S., Goodman, N.: Amortized inference in probabilistic reasoning. In: Proceedings of the annual meeting of the cognitive science society. vol. 36 (2014)
+5. Goddard, T.D., Huang, C.C., Meng, E.C., Pettersen, E.F., Couch, G.S., Morris, J.H., Ferrin, T.E.: UCSf chimerax: Meeting modern challenges in visualization and analysis. Protein Science 27, 14-25 (2018)
+6. Greenberg, I., Shkolnisky, Y.: Common lines modeling for reference free ab-initio reconstruction in cryo-EM. Journal of Structural Biology 200, 106-117 (2017)
+7. Gupta, H., McCann, M.T., Donati, L., Unser, M.: CryoGAN: A New Reconstruction Paradigm for Single-Particle Cryo-EM Via Deep Adversarial Learning. IEEE Transactions on Computational Imaging 7, 759-774 (2021)
+8. Hertle, A.: On the Problem of Well-Posedness for the Radon Transform. In: Herman, G.T., Natterer, F. (eds.) Mathematical Aspects of Computerized Tomography. pp. 36-44. Springer (1981)
+
+19. Iudin, A., Korir, P., Salavert-Torres, J., Kleywegt, G., Patwardhan., A.: Empiar: A public archive for raw electron microscopy image data. Nature Methods 13, 387-388 (2016)
+20. Kingma, D.P., Welling, M.: An introduction to variational autoencoders. arXiv preprint arXiv:1906.02691 (2019)
+21. Kuhlbrandt, W.: The resolution revolution. Science 343, 1443-1444 (2014)
+22. Lawler, E.L., Wood, D.E.: Branch-and-bound methods: A survey. Operations research 14, 699-719 (1966)
+23. Lian, R., Huang, B., Wang, L., Liu, Q., Lin, Y., Ling, H.: End-to-end orientation estimation from 2D cryo-EM images. Acta Crystallographica Section D: Structural Biology 78, 174-186 (2022)
+24. Mallick, S., Agarwal, S., Kriegman, D., Belongie, S., Carragher, B., Potter, C.: Structure and View Estimation for Tomographic Reconstruction: A Bayesian Approach. In: 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06). vol. 2, pp. 2253-2260 (2006)
+25. Michalkiewicz, M., Pontes, J.K., Jack, D., Baktashmotlagh, M., Eriksson, A.: Implicit surface representations as layers in neural networks. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4743-4752 (2019)
+26. Mildenhall, B., Srinivasan, P.P., Tancik, M., Barron, J.T., Ramamoorthi, R., Ng, R.: Nerf: Representing scenes as neural radiance fields for view synthesis. In: European conference on computer vision. pp. 405-421. Springer (2020)
+27. Miolane, N., Poitevin, F., Li, Y.T., Holmes, S.: Estimation of Orientation and Camera Parameters from Cryo-Electron Microscopy Images with Variational Autoencoders and Generative Adversarial Networks. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). pp. 4174-4183. IEEE (2020)
+28. Müller, C., Schlauderer, G., Reinstein, J., Schulz, G.E.: Adenylate kinase motions during catalysis: an energetic counterweight balancing substrate binding. Structure 4, 147-156 (1996)
+29. Namba, K., Makino, F.: Recent progress and future perspective of electron cryomicroscopy for structural life sciences. Microscopy 71, i3-i14 (2022)
+30. Nashed, Y.S.G., Poitevin, F., Gupta, H., Woollard, G., Kagan, M., Yoon, C.H., Ratner, D.: CryoPoseNet: End-to-End Simultaneous Learning of Single-Particle Orientation and 3D Map Reconstruction From Cryo-Electron Microscopy Data. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops. pp. 4066-4076 (2021)
+31. Nogales, E.: The development of cryo-em into a mainstream structural biology technique. Nature Methods 13, 24-27 (2016)
+32. Park, J.J., Florence, P., Straub, J., Newcombe, R., Lovegrove, S.: Deepsdf: Learning continuous signed distance functions for shape representation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 165-174 (2019)
+33. Penczek, P.A., Grassucci, R.A., Frank, J.: The ribosome at improved resolution: new techniques for merging and orientation refinement in 3D cryo-electron microscopy of biological particles. Ultramicroscopy 53, 251-270 (1994)
+34. Plaschka, C., Lin, P.C., Nagai, K.: Structure of a pre-catalytic spliceosome. Nature 546, 617-621 (2017)
+35. Pragier, G., Shkolnisky, Y.: A common lines approach for ab-initio modeling of cyclically-symmetric molecules. Inverse Problems 35, 124005 (2019)
+36. Punjani, A., Fleet, D.J.: 3d flexible refinement: structure and motion of flexible proteins from cryo-em. BioRxiv (2021)
+
+37. Punjani, A., Rubinstein, J.L., Fleet, D.J., Brubaker, M.A.: cryoSPARC: algorithms for rapid unsupervised cryo-EM structure determination. Nature Methods 14, 290–296 (2017)
+38. Ravi, N., Reizenstein, J., Novotny, D., Gordon, T., Lo, W.Y., Johnson, J., Gkioxari, G.: Accelerating 3D Deep Learning with PyTorch3D. arXiv: 2007.08501 (2020)
+39. Renaud, J.P., Chari, A., Ciferri, C., ti Liu, W., Remigy, H.W., Stark, H., Wiesmann, C.: Cryo-em in drug discovery: achievements, limitations and prospects. Nature Reviews Drug Discovery 17, 471-492 (2018)
+40. Rohou, A., Grigorieff, N.: Ctffind4: Fast and accurate defocus estimation from electron micrographs. Journal of structural biology 192, 216-221 (2015)
+41. Rosenbaum, D., Garnelo, M., Zielinski, M., Beattie, C., Clancy, E., Huber, A., Kohli, P., Senior, A.W., Jumper, J., Doersch, C., Eslami, S.M.A., Ronneberger, O., Adler, J.: Inferring a Continuous Distribution of Atom Coordinates from Cryo-EM Images using VAEs. arXiv:2106.14108 (Jun 2021)
+42. Rosenthal, P.B., Henderson, R.: Optimal determination of particle orientation, absolute hand, and contrast loss in single-particle electron cryomicroscopy. Journal of molecular biology 333, 721-745 (2003)
+43. Rudin, L.I., Osher, S., Fatemi, E.: Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena 60, 259-268 (1992)
+44. Scheres, S.H.: RELION: Implementation of a Bayesian approach to cryo-EM structure determination. Journal of Structural Biology 180, 519-530 (2012)
+45. Sigworth, F.J.: A maximum-likelihood approach to single-particle image refinement. Journal of Structural Biology 122, 328-339 (1998)
+46. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
+47. Singer, A., Coifman, R.R., Sigworth, F.J., Chester, D.W., Shkolnisky, Y.: Detecting consistent common lines in cryo-EM by voting. Journal of Structural Biology 169, 312–322 (2010)
+48. Sitzmann, V., Martel, J., Bergman, A., Lindell, D., Wetzstein, G.: Implicit neural representations with periodic activation functions. Advances in Neural Information Processing Systems 33, 7462-7473 (2020)
+49. Sitzmann, V., Zollhöfer, M., Wetzstein, G.: Scene representation networks: Continuous 3d-structure-aware neural scene representations. Advances in Neural Information Processing Systems 32 (2019)
+50. Ullrich, K., Berg, R.v.d., Brubaker, M., Fleet, D., Welling, M.: Differentiable probabilistic models of scientific imaging with the fourier slice theorem. arXiv preprint arXiv:1906.07582 (2019)
+51. Vainshtein, B., Goncharov, A.: Determination of the spatial orientation of arbitrarily arranged identical particles of unknown structure from their projections. In: Soviet Physics Doklady. vol. 31, p. 278 (1986)
+52. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017)
+53. Vulović, M., Ravelli, R.B.G., van Vliet, L.J., Koster, A.J., Lazić, I., Lücken, U., Rullgård, H., Öktem, O., Rieger, B.: Image formation modeling in cryo-electron microscopy. Journal of Structural Biology 183, 19-32 (2013)
+54. Walls, A.C., Park, Y.J., Tortorici, M.A., Wall, A., McGuire, A.T., Veesler, D.: Structure, function, and antigenicity of the sars-cov-2 spike glycoprotein. Cell 181, 281-292 (2020)
+
+55. Wang, L., Singer, A., Wen, Z.: Orientation Determination of Cryo-EM Images Using Least Unsquared Deviations. SIAM Journal on Imaging Sciences 6, 2450-2483 (2013)
+56. Wong, W., Bai, X.c., Brown, A., Fernandez, I.S., Hanssen, E., Condron, M., Tan, Y.H., Baum, J., Scheres, S.H.: Cryo-em structure of the plasmodium falciparum 80s ribosome bound to the anti-protozoan drug emetine. Elife 3, e03080 (2014)
+57. Zehni, M., Donati, L., Soubies, E., Zhao, Z.J., Unser, M.: Joint Angular Refinement and Reconstruction for Single-Particle Cryo-EM. IEEE Transactions on Image Processing 29, 6151-6163 (2020)
+58. Zhong, E.: cryodrgn-empiar (2022), https://github.com/zhongc/cryodrgn_ empiar
+59. Zhong, E.D., Bepler, T., Berger, B., Davis, J.H.: CryoDRGN: reconstruction of heterogeneous cryo-EM structures using neural networks. Nature Methods 18, 176-185 (2021)
+60. Zhong, E.D., Bepler, T., Davis, J.H., Berger, B.: Reconstructing continuous distributions of 3D protein structure from cryo-EM images. arXiv:1909.05215 (2019)
+61. Zhong, E.D., Lerer, A., Davis, J.H., Berger, B.: CryoDRGN2: Ab initio neural reconstruction of 3d protein structures from real cryo-em images. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4066-4075 (2021)
+62. Zhong, E.D., Lerer, A., Davis, J.H., Berger, B.: Exploring generative atomic models in cryo-EM reconstruction. arXiv:2107.01331 (2021)
+63. Zhou, Y., Barnes, C., Lu, J., Yang, J., Li, H.: On the Continuity of Rotation Representations in Neural Networks. arXiv: 1812.07035 (2020)
+64. Zivanov, J., Nakane, T., Forsberg, B.O., Kimanius, D., Hagen, W.J., Lindahl, E., Scheres, S.H.: New tools for automated high-resolution cryo-em structure determination in relation-3. elife 7, e42166 (2018)
\ No newline at end of file
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/images.zip b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..871dc69adae79179008cdce24edece54052c45b1
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:82e8cb6907af7aad97ae978da7584ca7d275d70809bdce1d1e3649c11ee971cc
+size 373626
diff --git a/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/layout.json b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2acdcf98cc0a0899faed41e05e633f2e939274a6
--- /dev/null
+++ b/cryoaiamortizedinferenceofposesforabinitioreconstructionof3dmolecularvolumesfromrealcryoemimages/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9596172bc13578f411f3702eece7dfe52b83d20446bad8b2e9682f35abf16fb
+size 468061
diff --git a/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_content_list.json b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..fa9bd8750ff7963f957dfc19c35770c3bcebfccd
--- /dev/null
+++ b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c59959267d59189d91719a1ef9961020c5eaf2e7333eaf4808c0f6149e17a44
+size 76731
diff --git a/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_model.json b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c112039aa1ac80d6ff03fb98556f58d57de702a
--- /dev/null
+++ b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f0100386a9fce0d70b7f9a5d5dc4067ae944f8e6ffe119b3a553cd7ad47fd79
+size 95979
diff --git a/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_origin.pdf b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..daf9c92d1a16d37fcc063207092a1a396c26c2de
--- /dev/null
+++ b/customstructurepreservationinfaceaging/4ed56513-b230-4cd2-95ab-d3bcccef0dc7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e62610f4326f01412457c23fd52e2e7760fe52482ac28a9fd1f6cc3198584b91
+size 3905205
diff --git a/customstructurepreservationinfaceaging/full.md b/customstructurepreservationinfaceaging/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a1e609c679db2713dd4674d4f99bc6240ebbf2a8
--- /dev/null
+++ b/customstructurepreservationinfaceaging/full.md
@@ -0,0 +1,273 @@
+# Custom Structure Preservation in Face Aging
+
+Guillermo Gomez-Trenado1, Stéphane Lathuilière2, Pablo Mesejo1, andÓscar Cordón1
+
+$^{1}$ DaSCI research institute, DECSAI, University of Granada, Granada, Spain {guillermogomez,pmesejo,ocordon}@ugr.es
+$^{2}$ LTCI, Telecom-Paris, Intitute Polytechnique de Paris, Palaiseau, France stephane.lathuiliere@telecom-paris.fr
+
+Abstract. In this work, we propose a novel architecture for face age editing that can produce structural modifications while maintaining relevant details present in the original image. We disentangle the style and content of the input image and propose a new decoder network that adopts a style-based strategy to combine the style and content representations of the input image while conditioning the output on the target age. We go beyond existing aging methods allowing users to adjust the degree of structure preservation in the input image during inference. To this purpose, we introduce a masking mechanism, the CUstom Structure Preservation module, that distinguishes relevant regions in the input image from those that should be discarded. CUSP requires no additional supervision. Finally, our quantitative and qualitative analysis which include a user study, show that our method outperforms prior art and demonstrates the effectiveness of our strategy regarding image editing and adjustable structure preservation.
+
+Keywords: Face aging, Image editing, Style-base architecture
+
+# 1 Introduction
+
+Face age editing [7, 17, 39], or aging, consists in automatically modifying an input face image to alter the age of the depicted person while preserving identity. Over the last few years, this problem has attracted a growing interest because of its numerous applications. In particular, it is used in the movie production industry to edit actors' faces or in forensic facial approximation to reconstruct the faces of missing people. The advances in deep learning methods unlock the development of fully automatic edition algorithms that avoid hours of makeup and post-production retouching.
+
+Recent deep learning approaches adopt an encoder-decoder architecture [3, 8, 23, 26, 39, 40, 43, 45]. The image is encoded in a latent space that can be modified depending on the target age and fed to a decoder that generates the output image. The overall network is usually trained using a combination of losses that assess image quality, identity preservation, and age matching. However, despite the success of all these approaches, face editing remains challenging, and current methods usually fail when
+
+
+Fig. 1: The user can choose the degree of structure preservation at inference time. Facial morphology transformations are more profound as we move to the right (lower structure preservation).
+
+faced with sizeable differences between the age of the person displayed in the input image and the target age. Indeed, most approaches [3, 8, 39, 40, 43, 45] only superficially modify the skin's texture while the face's shape is kept unchanged. These approaches fail with significant age gaps since face shape can change significantly during a lifetime. Few methods try to go beyond some limited age gaps, but they either consider only a tightly cropped face region [17, 39] or require specific pre-processing involving an image segmentation step [26].
+
+This work proposes a novel framework that allows profound structural changes in facial transformations. This framework achieves a realistic image transformation with age gaps that imply changes in head shape or hair growth. In addition, we argue that the face editing task is an ill-posed problem because every person gets older in a different and non-deterministic way: some people drastically change, while others are easily recognizable in old photographs. In this sense, we propose a methodology that allows the user to adjust, at inference time, the degree of structure preservation. Thus, the user can provide an image and obtain different transformations where the structure (i.e., face shape or hair growth) is preserved at different levels. Fig. 1 shows some qualitative results obtained with our method. Furthermore, the user can choose different degrees of structure preservation: with high preservation, the model only changes the texture, while with lower preservation, the shape of the face is also modified.
+
+The contributions of this paper can be summarized as follows:
+
+- We propose a novel architecture for face age editing that can produce structural modifications in the input image while maintaining relevant details present in the original image. We take advantage of recent advances in image-to-image (I2I) translation [10, 20] and unconditional image generation [12] to design our architecture. We disentangle the style and content of the input image, and we propose a new decoder network that adopts a style-based strategy to combine the style and content representations of the input image while conditioning the output on the target age.
+- We go beyond existing aging methods allowing the user to adjust the degree of structure preservation in the input image at inference time. To this aim, we intro-
+
+duce a masking mechanism, through a so-called CCustom Structure Preservation (CUSP) module, that identifies the relevant regions in the input image that should be preserved and those where details are irrelevant to the task. Importantly, our mechanism for adjustable structural preservation does not require additional training supervision.
+
+- Experimentally, we show that our method outperforms existing approaches in three publicly available high-resolution datasets and demonstrate the effectiveness of our mechanism for adjusting structure preservation.3
+
+# 2 Related Work
+
+Most recent approaches for face aging adopt a similar strategy based on an encoder-decoder architecture [3, 8, 23, 26, 39, 40, 43, 45]. In these methods, the input image is projected onto a latent space where content is manipulated before decoding the output image. Some methods [40, 2] add an identity term to the total loss to better ensure the preservation of the identity during the translation process. These methods principally differ in the choice of the network architecture and the manner the latent representation is manipulated. For instance, Wang et al. [39] introduce a recurrent neural network to iteratively alter the image, while in [43], the latent image representation is modified using a simple affine transformation. Re-AgingGAN [23] employs an age modulator that outputs transformations that are applied then to the decoder, and Or-El et al. [26] adopt a multi-domain translation formulation, showing that segmentation information can be leveraged to improve aging. In our work, we adopt an encoder-decoder framework similar to [8, 43]. However, our approach goes beyond existing methods that generate a single image for a given image-target age pair. Indeed, we offer the user the possibility to adjust the degree of structure preservation during translation, and, in this way, we can output a set of plausible resulting facial images.
+
+Our method also leverages recent advances from the I2I translation research area. I2I translation consists in learning a mapping between two visual domains. In the pioneering work of Isola et al. [11], an encoder-decoder network is trained using a dataset composed of image pairs from the two domains. Later, many works addressed I2I translation in an unpaired setting, assuming two independent sets of images of each domain [6, 21, 46]. These works, of which cycleGAN [46] is a paradigmatic example, mainly focus on introducing regularization mechanisms when training the I2I translation models. Another research direction is designing more advanced architectures to improve image quality or obtain several possible outputs for a given input [10, 20, 47]. Disentangling style and content information has led to both higher image quality and diversity [10, 28]. We adopt a similar strategy in order to allow custom structure preservation. Thanks to this strategy, our CUPS module can act on the spatial information passing through the content branch while preserving style information.
+
+Style-based architectures recently attracted much attention for the problem of unconditional image generation. In particular, StyleGAN2 [12] is now used in many face manipulation tasks [30, 42]. In the case of face aging, [2] uses a pretrained StyleGAN2 model [12] equipped with a pSp encoder [30], and an age classifier [32] to tailor an age editing model with unlabeled data. In StyleGAN2, a network maps a Gaussian latent space onto style vectors; these vectors are later combined via a convolutional network to produce the output image. Finally, the synthesis network aggregates the style vectors through modulation operations. We take inspiration from the StyleGAN2 generator to design a novel decoder that combines the input style and the target age with the content representation via weight demodulation.
+
+Regarding the more general image editing problem, our method shares similarities with several approaches employing masking mechanisms or attention maps to preserve relevant parts in the input image [1, 18, 29, 38]. For instance, mask consistency is employed in [18] to improve multi-domain translations. As in our approach, masks are estimated using the guided backpropagation (GB) algorithm [36]. In the case of facial images, a mask is employed in GANimation [29] to different regions that should be preserved and those that should be modified to change the facial expression. In GANimation, masks are predicted by the main network, while we employ an auxiliary network and GB [36] to obtain the mask.
+
+# 3 Proposed Method
+
+In this work, we address the face age editing problem. Therefore, our goal is to train a network able to transform an input image $\mathbf{X}$ , such that the person depicted looks like being of the target age $a_{t}$ . At training time, we assume that we have at our disposal a dataset composed of $I$ face images of resolution $H\times W$ , such that $\mathbf{X}_i\in \mathbb{R}^{H\times W\times 3}, i = 1,\dots,I$ with their corresponding age label $a_{i}\in \{1,\dots N\}$ . Note that the age labels are automatically obtained using a pre-trained age classifier. Similar to previous approaches [43, 45], we employ the DEX classifier [33].
+
+One of the main difficulties lies in modifying the relevant details in the input image while preserving non-age-related regions. To this aim, we introduce a style-based architecture detailed in Sec.3.1. In contrast to previous works, the CUSP module allows the user to indicate the desired level of structure preservation through two parameters: $\sigma_{m} > 0$ and $\sigma_{g} > 0$ . These parameters act locally and globally, respectively, as detailed later. The proposed CUSP module is described in Sec. 3.2. Finally, we present the whole training procedure in Sec. 3.3.
+
+# 3.1 Style-based Encoder-decoder
+
+As illustrated in Fig. 2, our architecture employs five different networks: (1) A style encoder $E_{s}$ extracts a style representation $s_i$ of the input image $\mathbf{X}_i$ . $E_{s}$ discards any spatial information via global-average-pooling at the last layer. The use of a style encoder allows global information to be used at any location in the decoder. (2) A content
+
+
+Fig. 2: Illustration of the proposed approach. A style encoder $E_{s}$ extracts a style representation of the input image $\mathbf{X}_i$ . A content encoder $E_{c}$ encodes spatial information. Target age $a_{t}$ is embedded using a multi-layer perceptron $E_{a}$ . Our generator $G$ outputs the image $\hat{\mathbf{X}}_i$ by combining the input style and content representations conditioned on the target age. Our CUSP module predicts a blurring mask $\mathbf{M}$ applied to the skip connections to allow the user to choose a CUstom level of Structure Preservation.
+
+encoder $E_{c}$ outputs a tensor $\mathbf{c}$ describing the content of the input image. Contrary to $E_{s}$ , the content encoder preserves spatial and local information. In our case, the use of separated style and content encoders is justified by the fact that our CUSP module should not affect the image style $s_{i}$ but only the structure of the image. (3) An 8-layers fully connected network, $E_{a}$ , embeds the target age $a_{t}$ : $\tilde{a}_{t} = E_{a}(a_{t})$ . (4) An image generator $G$ estimates the output image $\hat{\mathbf{X}}_i$ by combining the style and content representations with the target age embedding $\tilde{a}_{t}$ . (5) Finally, our CUSP module allows the user to choose the level of structure preservation. This module predicts a mask $\mathbf{M}$ used to act on the skip connections between the content encoder and the decoder. More precisely, we blur the regions indicated by the mask $\mathbf{M}$ to propagate only the non-age-related structural information to the decoder.
+
+Our image generator $G$ is designed to combine the outputs of the style and content encoders with the target age embedding. Its architecture is inspired by StyleGAN2 [16], which achieves state-of-the-art performance in unconditional image generation. However, we provide several modifications to tailor the architecture to the aging task. $G$ comprises a sequence of elementary blocks (see Supplementary Materials for illustration). Differently from StyleGAN2, each block takes three inputs: the former block output feature map, the style encoding $s_i$ , and the class embedding $\tilde{a}_t$ . Each block is composed of two sub-blocks. In the first one, we use the style vector $s_t$ to modulate the convolution operations as in [16]. In the second one, the age embedding is used for modulation. Up-sampling is applied to the input of the first sub-block. Similarly to [16], random noise is summed to the feature maps between each sub-block, while scaling and bias parameters (i.e., $w$ and $b$ ) are learned for each sub-block.
+
+Note that all blocks are combined following the input skips architecture of StyleGAN2, where a layer named tRGB is introduced. Such layer predicts intermediate images at every resolution scaled and added to generate the final image. tRGB is also
+
+conditioned on the age embedding. A single skip connection is introduced before the last block, contrarily to U-Net [31] that includes them in every layer.
+
+# 3.2 CUSP Module
+
+Skip connections (SC) [31] are efficient tools to provide high-frequency information to the decoder allowing accurate reconstruction [11]. High frequencies carry accurate spatial information that favors pixel-to-pixel alignment between inputs and outputs, as, for instance, needed in segmentation. However, previous works [35] show they are not suited for tasks where the input and output images are not pixel-to-pixel aligned. For example, input and output images are aligned when the age gap is small in the aging task. However, this assumption does not hold in every image region with significant gaps. This misalignment is particularly predominant in areas other than the background since facial morphology or hairstyle may change.
+
+Therefore, we propose to control the amount of structural information that flows through the SC. This control is obtained by blurring the feature maps going through them. Nevertheless, every region should not be treated in the same way. For instance, depending on the task, the user may prefer to preserve the background while blurring the foreground to loosen conditioning on the input image in this region. Therefore, we propose a specific mechanism to identify relevant image regions for the translation.
+
+Mask Estimation. We employ an additional classification network $C$ , pretrained to recognize the age of the person depicted on an image. We use the DEX classifier [33] again. Since DEX is pretrained on $224 \times 224$ , the input image is rescaled to this resolution. Then, we apply the GB algorithm [36] to obtain a tensor $\mathbf{B} \in \mathbb{R}^{224 \times 224 \times 3}$ , where locations with higher norm correspond to regions predominantly used by the classifier. In other words, $\mathbf{B}$ pinpoints relevant regions for the age classification task. GB points out the key areas to recognize the age and should, therefore, be modified by the aging network. Importantly, GB is usually used to visualize the regions that influence one specific network output (i.e., one specific class) [36]. In our case, we apply GB to the sum of the classification layer before softmax normalization to obtain class-independent masks. We select GB [36] over other approaches [34, 25, 37] since it is a fast, simple, and strongly supported method for visualization.
+
+We need to transform $\mathbf{B}$ to obtain a mask $\mathbf{M} \in [0,1]^{224 \times 224}$ . We proceed in several steps. First, we average $\mathbf{B}$ over the RGB channels, take the absolute value, and apply Gaussian blur to get smoother maps. In this way, we obtain a tensor $\tilde{\mathbf{B}} \in \mathbb{R}_{>0}^{224 \times 224}$ that indicates relevant regions. To obtain values in $[0,1]$ , we need to normalize $\tilde{\mathbf{B}}$ . Our preliminary experiments showed that after normalizing by twice the variance $\sigma$ of $\tilde{\mathbf{B}}$ (over the locations), relevant areas for the aging task are close to 1 or above. We apply clipping to bring all those important regions to 1. Formally the mask values are computed as follows:
+
+$$
+\mathbf {M} = \min \left(\frac {\tilde {\mathbf {B}}}{2 \times \sigma}, 1\right) \tag {1}
+$$
+
+where $\min$ denotes the element-wise minimum. Next, we detail how this mask is employed in our encoder-decoder architecture.
+
+Skip connection blurring. Assuming a feature map $\mathbf{F}_c \in \mathbb{R}^{H' \times W' \times C}$ provided by the content encoder $E_c$ , we resize $\mathbf{M}$ to the dimension of $\mathbf{F}_c$ obtaining a mask $\tilde{\mathbf{M}} \in [0,1]^{H' \times W'}$ . We then blur $\mathbf{F}_c$ using two different Gaussian kernels with variance $\sigma_m > 0$ and $\sigma_g > 0$ . The variance $\sigma_m$ is applied in the region indicated by $\mathbf{M}$ , while $\sigma_g$ is used over the whole feature map. The motivation for this choice is that the user can choose to alter structure preservation locally, globally, or both. At training time, $\sigma_m$ and $\sigma_g$ are sampled randomly to force the generator $G$ to perform well for any blur parameter. At test time, both values might be provided by the user. Formally, the blurred feature map is computed as follows:
+
+$$
+\tilde {\mathbf {F}} _ {c} = \tilde {\mathbf {M}} \circ \left(\mathbf {F} _ {c} * \mathbf {k} _ {m}\right) + (1 - \tilde {\mathbf {M}}) \circ \left(\mathbf {F} _ {c} * \mathbf {k} _ {g}\right) \tag {2}
+$$
+
+where $*$ denotes the convolution operation, $\circ$ is the Hadamard product, and $\mathbf{k}_m$ and $\mathbf{k}_g$ are the Gaussian kernels of variances $\sigma_m$ and $\sigma_g$ .
+
+# 3.3 Overall Training Procedure
+
+Training facial age editing models is particularly challenging since paired images are unavailable. Therefore, similarly to [23, 26, 43], our training strategy is either focused on reconstruction (when the target age matches the input age) or I2I translation (when the target age is different). Also, similar to [23, 26, 43], training is performed using a set of complementary losses described below.
+
+Reconstruction loss $(\mathcal{L}_r)$ . When the target age $a_{t}$ is equal to the image age $a_{i}$ , we expect to reconstruct the input image. We, therefore, adopt an L1 reconstruction loss:
+
+$$
+\mathcal {L} _ {r} = \left\| T \left(\mathbf {X} _ {i}, a _ {i}\right) - \mathbf {X} _ {i} \right\| _ {1} \tag {3}
+$$
+
+where $T$ denotes the whole aging network, which output is the scaled addition of every $tRGB$ block.
+
+Age fidelity losses $(\mathcal{L}_D,\mathcal{L}_C)$ . Following [5], we use a conditional discriminator $D$ to assess that generated images correspond to the target age $a_{t}$ . More precisely, we employ the discriminator architecture of StyleGAN2 equipped with a multiclass prediction head, together with the training loss $\mathcal{L}_D$ defined in [24].
+
+We employ a loss $\mathcal{L}_C$ that assesses age matching using the same pretrained classifier $C$ used in the CUSP module to complement the adversarial loss. Furthermore, $\mathcal{L}_C$ is implemented using the Mean-Variance loss [27], a classification loss tailored for age estimation.
+
+Cycle-Consistency loss $(\mathcal{L}_{cy})$ . Following [46], we adopt a cycle consistency $\mathcal{L}_{cy}$ to force the network to preserve details that are not specific to the age (e.g., background or face identity). $\mathcal{L}_{cy}$ is given by:
+
+$$
+\mathcal {L} _ {c y} = \left\| \mathbf {X} _ {i} - T \left(T \left(\mathbf {X} _ {i}, a _ {t}\right), a _ {i}\right) \right\| _ {1} \tag {4}
+$$
+
+Full objective. Finally, the total cost function can be written
+
+$$
+\min _ {M} \max _ {D} \lambda_ {r} \mathcal {L} _ {r} + \lambda_ {C} \mathcal {L} _ {C} + \lambda_ {D} \mathcal {L} _ {D} + \lambda_ {c y} \mathcal {L} _ {c y} \tag {5}
+$$
+
+where $\lambda_r, \lambda_C, \lambda_D$ , and $\lambda_{cy}$ are constant weights.
+
+# 4 Experiments
+
+# 4.1 Evaluation protocol and implementation
+
+Every paper employs different metrics, datasets, and tasks in the aging literature. Therefore, we include a large set of metrics, datasets, and tasks in our experiments to allow comparison with most existing methods.
+
+Datasets. In this paper, we employ three widely-used, publicly available high-resolution datasets for face aging and analysis:
+
+- $FFHQ - RR$ : Initially proposed in [43], this aging dataset based on FFHQ [15] comprises of 48K images depicting people from 20 to 69 years old. Because of this Restricted age Range, we refer to this dataset as $FFHQ - RR$ . Images are downsampled to $224 \times 224$ .
+
+- $FFHQ$ -LS: Tis aging dataset, introduced in [26], is composed of the 70K images from FFHQ [15], manually labeled in 10 age clusters that try to capture both geometric and appearance changes throughout a person's life: 0-2, 3-6, 7-9, 10-14, 15-19, 20-29, 30-39, 40-49, 50-69 and $70+$ years old. Consequently, this dataset is referred to as $FFHQ$ -LS because of its LifeSpan age range. The resolution of these images is $256 \times 256$ pixels.
+
+- CelebA-HQ [13, 22]: It consists of $30\mathrm{K}$ images at $1024\times 1024$ resolution, which we downsample to $224\times 224$ pixels. The only age-related label in the dataset is young, which can be either true or false.
+
+The use of $FFHQ-RR$ and $FFHQ-LS$ may seem redundant since they are both based on the FFHQ dataset, but we perform distinct experiments on both datasets to allow comparison with existing state-of-the-art methods (which report results on at least one of them).
+
+Tasks. We employ two tasks to evaluate the performance:
+
+- Young $\rightarrow$ Old: as in [43], we sample 1000 images belonging to the "young" category and translate them to a target age of 60. This task is only performed on CelebA-HQ.
+
+- Age group comparison: similarly to [23], we consider different age groups: (20-29), (30-39), (40-49), and (50-69) on $FHHQ$ -RR and additionally (0-2), (3-6), (7,9), (15,19) on $FFHQ$ -LS. We again sample the first 1000 test images and translate every one of them into the central age of each of the four different age groups (25, 35, 45, and 55, respectively).
+
+Metrics. We choose metrics to evaluate the two main aspects of the aging task. Firstly, the translated/generated images must preserve the content of the input image in terms of identity, facial expression, and background. Secondly, the age translation might be
+
+
+Fig. 3: Comparison with State-of-the-art on CelebA-HQ for the Young $\rightarrow$ Old task employing a target age of 60 years old.
+
+accurate. In particular, we adopt the following metrics:
+
+- LPIPS [44] measures the perceptual similarity when the target age coincides with the input image age.
+- Age Mean Absolute Error (MAE). We employ a pretrained and independent age estimation network to compare the predicted age with the target age given an input image. As we already use the DEX pretrained classifier [33] at training time, we utilize Face++ API4. Experiments show that DEX is more biased towards younger age predictions than Face++. Therefore, reporting the MAE to the input target age $a_{t}$ would be biased. To compensate for this DEX-Face++ misalignment, we estimate the age of the original images with Face++. and compute the mean for each group. We then report the distance between the mean group predicted age and the transformed image predicted age.
+- Kernel-Inception Distance [4] (KID) assesses that the generated images are similar to real ones for similar ages. While FID [9] is adopted in [23], we adopted KID as it is better suited for smaller datasets. We report the KID between original and generated images within the same age groups.
+- Gender, Smile, and Face expression preservation and Blurriness: Face++ provides these metrics to evaluate input image preservation and quality. Gender, Smile, and Face expression preservation are reported in percentages as in [43].
+
+Implementation details. We use the same training settings as StyleGAN2-ADA [14] with $\lambda_r = 10$ , $\lambda_C = 0.06$ , $\lambda_D = 1$ , $\lambda_{cy} = 10$ . The optimizer used is Adam with lr = 0.0025 and $\beta_1 = 0$ , $\beta_2 = 0.99$ . FFHQ-RR and CelebA-HQ models are trained for 65 epochs with a batch size of 18. FFHQ-LS is trained for 140 epochs with a batch size of 16. All experiments are run on a single Nvidia A100 GPU.
+
+# 4.2 Comparison with State-of-the-Art
+
+From our literature review (Sec. 2), we identify HRFAE [43] and LATS [26] as the two main competing methods. Indeed, Re-aging GAN [23] cannot be included in the
+
+
+Fig.4: Qualitative comparison with HRFAE. The images corresponding to the input ages are highlighted with red frames.
+
+
+Fig. 5: LATS comparison for different age targets. The images corresponding to the input ages are highlighted with red frames.
+
+Table 1: User study on four different aspects of image aging comparing CUSP.
+
+ | Age accuracy | Identity preservation | Overall quality | Natural progression |
| 20-29 | 50-69 | Added | 20-29 | 50-69 | Added | 20-29 | 50-69 | Added | - |
| CUSP | 60.2 | 72.9 | 66.6 | 50.8 | 63.7 | 57.3 | 55.8 | 67.7 | 61.8 | 60.6 |
| HRFAE [43] | 17.5 | 15.6 | 16.6 | 24.4 | 24.0 | 24.2 | 21.7 | 20.6 | 21.1 | 24.9 |
| LATS [26] | 22.3 | 11.5 | 16.9 | 24.8 | 12.3 | 18.5 | 22.5 | 11.7 | 17.1 | 14.5 |
+
+comparison since neither the code nor the age classifier used for evaluation is publicly available. Since HRFAE and LATS report experiments on different datasets and follow different protocols, we perform experiments using the two tasks previously described. First, we follow HRFAE [43], which employs the Young $\rightarrow$ Old task on CelebA-HQ. In this case, the performance of FaderNet [19], PAG-GAN [41], IPC-GAN [40], and HRFAE (on $1024\times 1024$ resolution images) is reported in [43] and is included in our experimental comparison. Second, we employ the age group comparison task to allow better comparison with LATS [26] on the most challenging FFHQ-LS dataset. Indeed, since no automatic quantitative evaluation is reported on the FFHQ-LS in [26], we chose the age group comparison task that provides richer analysis than the Young $\rightarrow$ Old task.
+
+User study. We conducted a study on 80 different users comparing CUPSP with HRFAE [43] and LATS [26]) on the young-to-old and old-to-young tasks on FFHQ-RR. Similarly to [26], we asked about user preferences regarding identity preservation, target age accuracy, realism, the naturalness of the age transition, and overall preference.
+
+As seen in Table 1, CUSP outperforms HRFAE [43] and LATS [26] in every single category by a large margin (CUSP was selected globally in $62\%$ of cases, compared to $22\%$ and $17\%$ , respectively). Furthermore, CUSP's results depict people of the target age with greater accuracy while maintaining the source image identity. On top of that, it outputs higher quality images, and the progression seems more natural and realistic.
+
+Qualitative comparison. In Fig. 3, we show a qualitative comparison with the state-of-the-art evaluated on the celebA-HQ dataset, where we transform the input image to the age of 60 years old. First, we observe that Fader, PAGGAN, and IPCGAN generate im
+
+Table 2: Quantitative comparison on CelebA-HQ for the Young $\rightarrow$ Old task employing a target age of 60. CUSP HP (High preservation) is run with $\sigma_{m} = \sigma_{g} = 1.8$ .
+
+| Method | Predicted Age | Blur | Gender | Smiling | Neutral | Happy |
| Real images | 68.23 ± 6.54 | 2.40 | - | - | - | - |
| FaderNet | 44.34 ± 11.40 | 9.15 | 97.60 | 95.20 | 90.60 | 92.40 |
| PAGGAN | 49.07 ± 11.22 | 3.68 | 95.10 | 93.10 | 90.20 | 91.70 |
| IPCGAN | 49.72 ± 10.95 | 9.73 | 96.70 | 93.60 | 89.50 | 91.10 |
| HRFAE | 54.77 ± 8.40 | 2.15 | 97.10 | 96.30 | 91.30 | 92.70 |
| HRFAE-224 | 51.87 ± 9.59 | 5.49 | 97.30 | 95.50 | 88.30 | 92.50 |
| LATS | 55.33 ± 9.33 | 4.77 | 96.55 | 92.70 | 83.77 | 88.64 |
| CUSP HP | 67.76 ± 5.38 | 2.53 | 93.20 | 88.70 | 79.80 | 84.60 |
+
+Table 3: Quantitative comparison with LATS on the FFHQ-LS dataset for the age group comparison task. CUSP CP (Custom preservation) and LP (Low preservation) are run with $(\sigma_{m},\sigma_{g}) = (8,4.5)$ and $(\sigma_{m},\sigma_{g}) = (8,8)$ respectively.
+
+| Age MAE | Gender Preservation (%) | | |
| 0-2 | 3-6 | 7-9 | 15-19 | 30-39 | 50-69 | Mean | 0-2 | 3-6 | 7-9 | 15-19 | 30-39 | 50-69 | Mean |
| LATS | 7.68 | 8.91 | 6.59 | 5.19 | 8.23 | 5.73 | 7.05 | 72.2 | 70.6 | 74.2 | 93.7 | 93.9 | 93.9 | 83.1 |
| CUSP CP | 6.89 | 8.26 | 7.67 | 6.70 | 10.67 | 10.86 | 8.51 | 74.5 | 69.3 | 78.1 | 88.3 | 92.1 | 85.9 | 81.4 |
| CUSP LP | 6.49 | 9.29 | 5.59 | 4.99 | 8.36 | 5.74 | 6.74 | 69.0 | 76.0 | 78.1 | 87.4 | 86.1 | 80.1 | 79.4 |
+
+ages with important artifacts. On the contrary, HRFAE, LATS, and our approach generate consistent images with only minor artifacts. However, only CUSP produces images that correspond to the correct target age. Other methods generate images where people look younger than expected since they are unable to make suitable structural changes. Furthermore, LATS operates only in the foreground, requiring a previous masking procedure; for this reason, in Fig. 3, the outputs related to LATS display a constant gray background. In addition, CUSP can preserve identity and non-age-related details.
+
+We also perform a qualitative comparison with the two main competitors: HRFAE on $FFHQ-RR$ in Fig. 4 and with LATS on $FFHQ-LS$ in Fig. 5. We show that CUSP achieves more profound facial structure modifications (e.g., thin face shapes that grow wider and wrinkled skin) and hair color transformation. The age progression is smooth. Close ages produce almost identical pictures, but global age progression seems realistic and natural. Regarding LATS (Fig. 5), we see that we obtain similar performance while our method has four major advantages: (1) it operates directly on the entire image and deals with backgrounds and clothing; (2) it does not require an externally trained image segmentation network; (3) CUSP employs a single network while LATS uses a separate network for each gender; and (4) it offers user control as shown in our ablation study (see Sec. 4.3).
+
+Quantitative comparison. In Table 2, we report a quantitative comparison evaluated on the CelebA-HQ dataset employing the Young $\rightarrow$ Old task. Every model has been trained
+
+on $FFHQ-RR$ . Regarding HRFAE, we report the performance obtained with models trained and tested at $224 \times 224$ and $1024 \times 1024$ resolutions (referred to as HRFAE-224 and HRFAE, respectively). We used the available code for LATS to train a model on this dataset. We also report (first row) the mean age predicted by the Face++ classifier when feeding the images of the age class 60 according to the DEX classifier used at training time. We observe an 8.23-year discrepancy. In other words, to generate images that look similar to those labeled as 60 at training time, we need to predict images that the Face++ classifier will perceive on average as 68.23 years old. These experiments confirm that CUSP outperforms other methods, being the only method that substantially modifies the image to adjust the person's target age.
+
+In addition, CUSP ranks second in terms of Blur, quantifying the good quality of our images. For instance, the performance of HRFAE-224 worsens the predicted age with respect to its $1024 \times 1024$ counterpart and deteriorates noticeably in the Blur metric, suggesting a severe drop in the generated image quality. Interestingly, the more profound and realistic transformations yielded by CUSP and LATS imply slightly worse scores according to the preservation metrics. Indeed, preservation metrics suffer from the increased ability to make structural changes to pictures. However, this drop in quantitative fidelity is not manifested in the user study or qualitative results (Figs. 5 and 4). Two hypotheses can explain this discrepancy between qualitative and quantitative results. First, several biases can impact the results (e.g., sports clothing is replaced for formal clothes at higher ages, and glasses appear in older targets as well). In addition, there may also be some expression-related biases in different age groups. Second, the CUSP module more frequently targets the image's mouth and eye areas. Those areas are the most related to facial expression detection, and their blurring might negatively affect facial expression preservation.
+
+We report in Table 3 a comparison with LATS, both trained and evaluated on the $FFHQ$ -LS dataset. The results support the qualitative analysis performed regarding Figs. 4 and 5. Our proposed method is on par with LATS performance concerning the aging task and achieves those results while preserving numerous image details. CUSP with low preservation even outperforms LATS in terms of Mean Age-MAE. We also notice that our approach obtains similar performance in terms of gender preservation while employing a single model and not using gender annotations as in [26].
+
+# 4.3 Ablation study
+
+Architecture ablation. We consider four variants of our approach where we ablate the skip connections and the style encoder5. In (i), the style encoder is not used; an Average Pooling layer replaces $E_{s}$ on top of the output from $E_{c}$ . (ii) employs a style encoder but no skip connections, while (iii) employs skip connections in every layer. Finally, (iv) follows the proposed architecture employing skip connections in the second-to-last layer only. In order to make an unbiased evaluation of the architecture and not the masking operation performed by CUSP, we report the performance of CUSP with high preservation $(\sigma_{m},\sigma_{g}) = (7.1,0.0)$ , as (ii) applies no masking.
+
+Table 4: Ablation study: impact of the skip connections (SC.) and the style en- Table 5: Ablation study: impact of the coder. masking strategy used in CUSP.
+
+ | LPIPS | Age MAE | Mean KID |
| (i) No style encoder | 0.84 | 6.21 | 0.0163 |
| (ii) No SC. | 1.70 | 6.17 | 0.0109 |
| (iii) SC. at every layer | 1.85 | 6.34 | 0.0175 |
| (iv) Full | 0.78 | 6.29 | 0.0089 |
| Top-class GB | 1.25 | 6.19 | 0.0145 |
| Class-indep. (Ours) | 0.78 | 6.29 | 0.0089 |
+
+Results shown in Table 4 suggest that a separate style encoder, as in our Full model $(iv)$ , yields better reconstruction (lower LPIPS) and similar aging performance (Age MAE and Mean KID) than using a single encoder for both content and style as in $(i)$ . Regarding skip connections, not using them leads to an important reconstruction error (see high LPIPS) since the network cannot reconstruct the image details. However, skip connections in every layer also results in low reconstruction performance. We hypothesize that the model faces optimization issues. More specifically, adding skip connections on every layer dramatically increases the decoder's complexity (approximately doubling its number of parameters), making the network slower and harder to train.
+
+
+Fig. 6: Impact of the kernel value: images obtained with High, Low, and Custom structure preservation (LP, HP, and CP). HP: $(\sigma_{m},\sigma_{g}) = (0,0)$ ; CP: $(\sigma_{m},\sigma_{g}) = (9,0)$ ; HP: $(\sigma_{m},\sigma_{g}) = (9,9)$ . The second column shows the mask estimated by CUSP.
+
+
+Fig.7: CUSP parameters and impact on Age MAE (left) and LPIPS $\times 10$ (right).
+
+CUSP module analysis. In Fig. 6, we qualitatively evaluate the impact of the kernel values used in CUSP. We compare images obtained with Low, Custom, and High structure preservation (referred to as LP, CP, and HP), where we use kernel values ranging from $\sigma = 0$ to $\sigma = 9$ . We also display the mask $\mathbf{M}$ estimated by the CUSP module. We observe that when the user provides low kernel values (i.e., higher preservation), the shape of the face is kept, while with higher kernel values, the network has the freedom to change its shape. The impact is clearly visible on the neck and chin of the women in the second and last row.
+
+The visualization of the mask shows that our approach identifies those regions that change with age (chin, mouth, and forehead). We also quantitatively measure the impact of each kernel parameter. In Fig. 7, we report the Age MAE and LIPPS while changing the local and global blur parameters. By increasing the local blur, we can see that CUSP achieves a significantly lower age error while keeping a small reconstruction error. On the contrary, using global blur to improve the age performance (i.e., reduce the age MAE) implies a substantial increase in the LIPPS metric, reflecting some loss of details. Overall, these experiments demonstrate the conflicting nature of aging and reconstruction performances. These observations further justify our motivation to offer the user the possibility of controlling this trade-off, thereby demonstrating the value of CUSP and its masking strategy. The ability to modify both $\sigma_{m}$ and $\sigma_{g}$ with different values allows us to achieve the same age-accurate transformation results while minimizing the reconstruction performance drop.
+
+We complete this analysis with an ablation study regarding the GB-based computation of the CUSP masks. More precisely, two strategies are compared: in Top-1 class, we apply GB on the most-activated class, while in class-independent, we adopt the proposed strategy of taking the sum of the classification layer before softmax. Results reported in Tab. 5 demonstrate that the class-independent strategy performs best. Indeed, using every class output from the age classifier might benefit the masking, as every age-related feature is relevant for the translation, not only those involving its current age.
+
+# 5 Conclusions
+
+We present a novel architecture for face age editing that can produce structural facial modifications while preserving relevant details in the original image. Our proposal has two main contributions. First, we propose a style-based strategy to combine the style and content representations of the input image while conditioning the output on the target age. Second, we present a Custom Structure Preservation (CUSP) module that allows users to adjust the degree of structure preservation in the input image at inference time. We validate our approach by comparing six state-of-the-art solutions and employing three datasets. Our results suggest that our method generates more natural-looking, age-accurate transformed images and allows more profound facial changes while adequately preserving identity and modifying only age-related aspects. An extensive user study further confirmed this analysis. We plan to extend CUSP to other image editing tasks in future works.
+
+# References
+
+1. Ak, K.E., Lim, J.H., Tham, J.Y., Kassim, A.A.: Attribute manipulation generative adversarial networks for fashion images. In: IEEE/CVF ICCV (2019)
+2. Alaluf, Y., Patashnik, O., Cohen-Or, D.: Only a matter of style: Age transformation using a style-based regression model. ACM Trans. Graph. 40(4) (2021)
+3. Antipov, G., Baccouche, M., Dugelay, J.L.: Face aging with conditional generative adversarial networks. In: IEEE ICIP (2017)
+4. Binkowski, M., Sutherland, D.J., Arbel, M., Gretton, A.: Demystifying mmd gans. arXiv preprint arXiv:1801.01401 (2018)
+5. Choi, Y., Choi, M., Kim, M., Ha, J.W., Kim, S., Choo, J.: Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In: IEEE/CVF CVPR (2018)
+6. Fu, H., Gong, M., Wang, C., Batmanghelich, K., Zhang, K., Tao, D.: Geometry-consistent generative adversarial networks for one-sided unsupervised domain mapping. In: IEEE/CVF CVPR (2019)
+7. Fu, Y., Guo, G., Huang, T.S.: Age synthesis and estimation via faces: A survey. IEEE T-PAMI (2010)
+8. He, Z., Kan, M., Shan, S., Chen, X.: S2gan: Share aging factors across ages and share aging trends among individuals. IEEE/CVF ICCV (2019)
+9. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. Neurips 30 (2017)
+0. Huang, X., Liu, M.Y., Belongie, S., Kautz, J.: Multimodal unsupervised image-to-image translation. In: IEEE/CVF ECCV (2018)
+1. Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: IEEE/CVF CVPR (2017)
+2. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of stylegan. In: IEEE Conf. Comput. Vis. Pattern Recog. (2020)
+3. Karras, T., Aila, T., Laine, S., Lehtinen, J.: Progressive growing of gans for improved quality, stability, and variation. ICLR (2017)
+4. Karras, T., Aittala, M., Hellsten, J., Laine, S., Lehtinen, J., Aila, T.: Training generative adversarial networks with limited data. arXiv preprint arXiv:2006.06676 (2020)
+5. Karras, T., Laine, S., Aila, T.: A style-based generator architecture for generative adversarial networks. In: IEEE/CVF CVPR (2019)
+6. Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., Aila, T.: Analyzing and improving the image quality of stylegan. In: IEEE/CVF CVPR (2020)
+7. Kemelmacher-Shlizerman, I., Suwajanakorn, S., Seitz, S.M.: Illumination-aware age progression. In: IEEE/CVF CVPR (2014)
+8. Kim, D., Khan, M.A., Choo, J.: Not just compete, but collaborate: Local image-to-image translation via cooperative mask prediction. In: IEEE/CVF CVPR (2021)
+9. Lample, G., Zeghidour, N., Usunier, N., Bordes, A., DENOYER, L., et al.: Fader networks: Manipulating images by sliding attributes. In: Neurips (2017)
+20. Lee, H.Y., Tseng, H.Y., Huang, J.B., Singh, M., Yang, M.H.: Diverse image-to-image translation via disentangled representations. In: IEEE/CVF ECCV (2018)
+21. Liu, M.Y., Breuel, T., Kautz, J.: Unsupervised image-to-image translation networks. In: Neurips (2017)
+22. Liu, Z., Luo, P., Wang, X., Tang, X.: Deep learning face attributes in the wild. In: IEEE/CVF ICCV (2015)
+23. Makhmudkhujaev, F., Hong, S., Park, I.K.: Re-aging gan: Toward personalized face age transformation. In: IEEE/CVF ICCV (2021)
+
+24. Miyato, T., Koyama, M.: cgans with projection discriminator. arXiv preprint arXiv:1802.05637 (2018)
+25. Muhammad, M.B., Yeasin, M.: Eigen-cam: Class activation map using principal components. In: 2020 International Joint Conference on Neural Networks (IJCNN). pp. 1-7. IEEE (2020)
+26. Or-El, R., Sengupta, S., Fried, O., Shechtman, E., Kemelmacher-Shlizerman, I.: Lifespan age transformation synthesis. In: IEEE/CVF ECCV (2020)
+27. Pan, H., Han, H., Shan, S., Chen, X.: Mean-variance loss for deep age estimation from a face. In: IEEE/CVF CVPR (2018)
+28. Park, T., Zhu, J.Y., Wang, O., Lu, J., Shechtman, E., Efros, A., Zhang, R.: Swapping autoencoder for deep image manipulation. Advances in Neural Information Processing Systems 33, 7198-7211 (2020)
+29. Pumarola, A., Agudo, A., Martinez, A.M., Sanfeliu, A., Moreno-Noguer, F.: Ganimation: Anatomically-aware facial animation from a single image. In: IEEE/CVF ECCV (2018)
+30. Richardson, E., Alaluf, Y., Patashnik, O., Nitzan, Y., Azar, Y., Shapiro, S., Cohen-Or, D.: Encoding in style: a StyleGAN encoder for image-to-image translation. In: IEEE Conf. Comput. Vis. Pattern Recog. (2021)
+31. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: MICCAI. Springer (2015)
+32. Rothe, R., Timofte, R., Gool, L.V.: Deep expectation of real and apparent age from a single image without facial landmarks. International Journal of Computer Vision 126(2-4), 144-157 (2018)
+33. Rothe, R., Timofte, R., Van Gool, L.: Dex: Deep expectation of apparent age from a single image. In: IEEE/CVF ICCV-W (2015)
+34. Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Grad-cam: Visual explanations from deep networks via gradient-based localization. In: IEEE/CVF ICCV (2017)
+35. Siarohin, A., Sangineto, E., Lathuiliere, S., Sebe, N.: Deformable gans for pose-based human image generation. In: IEEE/CVF CVPR (2018)
+36. Springenberg, J.T., Dosovitskiy, A., Brox, T., Riedmiller, M.A.: Striving for simplicity: The all convolutional net. In: 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Workshop Track Proceedings (2015)
+37. Srinivas, S., Fleuret, F.: Full-gradient representation for neural network visualization. Advances in neural information processing systems 32 (2019)
+38. Tang, H., Xu, D., Sebe, N., Yan, Y.: Attention-guided generative adversarial networks for unsupervised image-to-image translation. In: IJCNN (2019)
+39. Wang, W., Cui, Z., Yan, Y., Feng, J., Yan, S., Shu, X., Sebe, N.: Recurrent face aging. In: IEEE/CVF CVPR (2016)
+40. Wang, Z., Tang, X., Luo, W., Gao, S.: Face aging with identity-preserved conditional generative adversarial networks. In: IEEE/CVF CVPR (2018)
+41. Yang, H., Huang, D., Wang, Y., Jain, A.K.: Learning face age progression: A pyramid architecture of gans. In: IEEE/CVF CVPR (2018)
+42. Yao, X., Newson, A., Gousseau, Y., Hellier, P.: A latent transformer for disentangled face editing in images and videos. In: IEEE/CVF ICCV (2021)
+43. Yao, X., Puy, G., Newson, A., Gousseau, Y., Hellier, P.: High resolution face age editing. In: IEEE ICPR (2021)
+44. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR (2018)
+45. Zhang, Z., Song, Y., Qi, H.: Age progression/regression by conditional adversarial autoencoder. In: IEEE/CVF CVPR (2017)
+
+46. Zhu, J.Y., Park, T., Isola, P., Efros, A.A.: Unpaired image-to-image translation using cycle-consistent adversarial networks. In: IEEE/CVF ICCV (2017)
+47. Zhu, J.Y., Zhang, R., Pathak, D., Darrell, T., Efros, A.A., Wang, O., Shechtman, E.: Multimodal image-to-image translation by enforcing bi-cycle consistency. In: Neurips (2017)
\ No newline at end of file
diff --git a/customstructurepreservationinfaceaging/images.zip b/customstructurepreservationinfaceaging/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6f2bd1f56a95a528581d592f10d724f6ff080654
--- /dev/null
+++ b/customstructurepreservationinfaceaging/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a661904696ea3ecdfc6e019d3419266e0c2fdae6423dd101e208f4974b458e62
+size 446006
diff --git a/customstructurepreservationinfaceaging/layout.json b/customstructurepreservationinfaceaging/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c0e66a0f1e250c588d0a2fbf313d8fe92d62542a
--- /dev/null
+++ b/customstructurepreservationinfaceaging/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ffd875ee4f544993a104cdc09fe591a51c2b43e7337c0161ff422a0b69d9a2bb
+size 431561
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_content_list.json b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a843ce66929e493b507dfcf1670fa8b37aa3020d
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:552f0b50a984b818898eeba9e9c074e826deb5d43af9e00a78071b0148e68666
+size 79815
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_model.json b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..496d4ad8c28cd49834bc73a966fce02ca1f53c6c
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2c792a03c42d190091a9f001424f1bee6711fcb7e64e1c752ac9ddbe8787fb00
+size 97875
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_origin.pdf b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7fd102b6450b94c2c3e377898dc6bca9e97f249d
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/c6ef55fd-99ba-4de8-b989-d3224f6fc13e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c3b90116a3cf9fa32c1e19cff6c145e86b3e62da197364052dd5771af0cf7dcb
+size 4218502
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/full.md b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..58e2b8b936b8b6c8d8dc1c779ff6c81d9ad55fcc
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/full.md
@@ -0,0 +1,282 @@
+# CycDA: Unsupervised Cycle Domain Adaptation to Learn from Image to Video
+
+Wei Lin $^{1,5}$ , Anna Kukleva $^{2}$ , Kunyang Sun $^{1,3}$ , Horst Possegger $^{1}$ , Hilde Kuehne $^{4}$ , and Horst Bischof $^{1}$
+
+1 Institute of Computer Graphics and Vision, Graz University of Technology, Austria {wei.lin, possegger, bischof}@icg.tugraz.at
+
+2 Max-Planck-Institute for Informatics, Germany akukleva@mpi-inf.mpg.de
+
+3 Southeast University, China sunnyky@seu.edu.cn
+
+4 Goethe University Frankfurt, Germany kuehne@uni-frankfurt.de
+
+$^{5}$ Christian Doppler Laboratory for Semantic 3D Computer Vision
+
+Abstract Although action recognition has achieved impressive results over recent years, both collection and annotation of video training data are still time-consuming and cost intensive. Therefore, image-to-video adaptation has been proposed to exploit labeling-free web image source for adapting on unlabeled target videos. This poses two major challenges: (1) spatial domain shift between web images and video frames; (2) modality gap between image and video data. To address these challenges, we propose Cycle Domain Adaptation (CycDA), a cycle-based approach for unsupervised image-to-video domain adaptation. We leverage the joint spatial information in images and videos on the one hand and, on the other hand, train an independent spatio-temporal model to bridge the modality gap. We alternate between the spatial and spatiotemporal learning with knowledge transfer between the two in each cycle. We evaluate our approach on benchmark datasets for image-to-video as well as for mixed-source domain adaptation achieving state-of-the-art results and demonstrating the benefits of our cyclic adaptation.
+
+Keywords: Image-to-video adaptation, unsupervised domain adaptation, action recognition
+
+# 1 Introduction
+
+The task of action recognition has seen tremendous success in recent years with top-performing approaches typically requiring large-scale labeled video datasets [10,39,40], which can be impractical in terms of both data collection and annotation effort. In the meanwhile, webly-supervised learning has been explored to leverage the large amount of easily accessible web data as a labeling-free data source for video recognition [12,16,24,38,41,47].
+
+In this work, we address the problem of image-to-video adaptation with webly-labeled images as the source domain and unlabeled videos as the target domain to allow for action classification without video annotation. This setting
+
+provides two major challenges: (1) the spatial domain shift between web images and video frames, based on difference in image styles, camera perspectives and semantic drifts; (2) the modality gap between spatial images and spatio-temporal videos. Specifically, this modality gap restrains that merely spatial knowledge can be transferred from source to target domain. Previous works on action recognition with web supervision either learn from web data directly [11,13] or perform joint training by combining the web source with annotated target data [9,29]. To specifically address the domain shift between web images and target videos, some approaches perform class-agnostic domain-invariant feature learning either within [19] or across modalities [44,43,27], in the absence of ensuring domain-invariance on the category-level.
+
+In this context, we propose Cycle Domain Adaptation (CycDA), i.e. alternating knowledge transfer between a spatial model and a spatio-temporal model. Compared to other works, we address the two challenges at hand, domain-alignment and closing the modality gap in separate stages, cycling between both of them. An overview of the CycDA is given in Fig. 1. With the category knowledge from the spatio-temporal model, we achieve enhanced category-level domain invariance on the spatial model. With updated knowledge transferred from the spatial model, we attain better spatio-temporal learning. In this manner, we can better tackle each challenge for the corresponding model, with the updated knowledge transferred from the other.
+
+More specifically, we propose a four stage framework to address the domain shift between images and videos on different levels. In stage 1, we enforce class-agnostic domain alignment on the spatial model between images and video frames. In stage 2, we use supervision from the spatial model to learn a spatiotemporal video model, bridging the gap between the two modalities. Stage 3 then focuses on class-aware domain alignment on the spatial model, given pseudo labels computed by the video model trained on stage 2. In stage 4, we update the video model with the improved pseudo labels from the spatial model of stage 3.
+
+We first evaluate our approach on several challenging settings for web image based action recognition, where a single cycle already outperforms baselines and state-of-the-arts. Second, we show how CycDA can be flexibly applied for mixed-source image&video-to-video DA settings, leading to a performance competitive to the state-of-the-art requiring only $5\%$ of the provided source videos.
+
+We summarize our contributions as follows: (1) We propose to address web image-to-video domain adaptation by decoupling the domain-alignment and spatio-temporal learning to bridge the modality gap. (2) We propose cyclic alternation between spatial and spatio-temporal learning to improve spatial and spatio-temporal models respectively. (3) We provide an extensive evaluation with different benchmark tasks that shows state-of-the-art results on unsupervised image-to-video domain adaptation and a competitive performance for the mixed-source image&video-to-video setting.
+
+
+Figure 1. Cycle Domain Adaptation (CycDA) pipeline: we address image-to-video adaption by training a spatial model and a spatio-temporal model alternately, passing pseudo labels to supervise each other in a cycle. The two alternating steps are: (1) domain alignment on the spatial model with pseudo labels from the spatio-temporal model, and (2) training the spatio-temporal model with updated pseudo labels from the spatial model.
+
+# 2 Related Work
+
+Webly-supervised action recognition. Various works have shown how web images and videos can be used as labeling-free data source to improve the performance of action recognition [9,11,13,29]. Gan et al. [11,13] train with web data only, without adaptation to the target domain. Ma et al. [29] combine web images and video frames to train a spatial model and achieve comparable performance by replacing parts of annotated videos with web images. Duan et al. [9] transform different types of web modalities to trimmed video clips and combine them with labeled target videos for joint training. In our work, we specifically address the domain shift on the spatial level and transfer the knowledge to the spatio-temporal level, without using any annotations on target data.
+
+Image-to-video DA. Compared to webly-supervised learning, image-to-video DA approaches actively address the domain shift between web images and target videos either by spatial alignment between web images and video frames [24,36,45], or through class-agnostic domain-invariant feature learning for images and videos [27,43,44]. Li et al. [24] use a spatial attention map for cross-domain knowledge transfer from web images to videos. In this case, the DA is addressed on the spatial level without transfer to the temporal level. Liu et al. [27] perform domain-invariant representation learning for images, video keyframes and videos, and fuse features of different modalities. Furthermore, hierarchical GAN [44], symmetric GAN [43] and spatio-temporal causal graph [2] are proposed to learn the mapping between image features and video features. Closest to our work is probably the work of Kae et al. [19] which also employs a spatial and a spatiotemporal model for two stages of class-agnostic domain alignment, proposing to copy the weights from the spatial to the spatio-temporal model.
+
+In contrast to these, we propose to transfer knowledge in the form of pseudo labels, without enforcing spatial information from the DA stage onto the spatiotemporal model. Moreover, we alternately conduct spatial alignment and spatio
+
+
+Figure 2. Our CycDA framework alternates between spatial alignment (stage 1 and 3) and spatio-temporal learning (stage 2 and 4). See text for details.
+
+temporal learning with knowledge transfer to each other. With category knowledge transferred to the spatial model, we perform class-aware domain alignment that induces domain-invariance within category-level.
+
+Video-to-video DA. Compared to image-to-video adaption, video-to-video adaptation methods adapt annotated source videos to unlabeled target videos [3,33,22,7,6,31,28,32,18], focusing mainly on the problem of domain alignment. Chen et al. [3] align the features spatially on the frame-level and temporally on the scale-level. Others propose feature alignment via self-attention [7], cross-domain co-attention [32], or across two-stream modalities of RGB and optical flow [22,31]. Sahoo et al. [33] propose temporal contrastive learning and background mixing for domain-invariance. In this work, we focus on image-to-video adaptation and use only single stream of RGB. We further show that we are able to extend the pipeline to the mixed-source case, where we achieve competitive performance compared to video-to-video adaptation methods while requiring only a small amount of source videos.
+
+# 3 Cycle Domain Adaptation (CycDA)
+
+We propose four stages to tackle image-to-video adaptation, which we summarize in Sec. 3.1. Afterwards, we detail each stage and motivate the cycling of stages in Sec. 3.2. Our CycDA can be flexibly extended (Sec. 3.3) for mixed-source video adaptation, where a limited amount of annotated source videos are available.
+
+# 3.1 System Overview
+
+The task of unsupervised image-to-video DA is to learn a video classifier given labeled source images and unlabeled target videos. In order to close the domain gap across these two different modalities, we employ (1) a spatial (image) model to train on source web images and frames sampled from target videos, and (2) a spatio-temporal (video) model to train on target video clips. We propose a training pipeline that alternately adapts the two models by passing pseudo labels to supervise each other in a cycle. This facilitates the knowledge transfer between both models, where pseudo labels efficiently guide the model through the
+
+corresponding task, i.e. semantic alignment (image model) or spatio-temporal learning (video model).
+
+As shown in Fig. 2, our CycDA pipeline consists of four training stages. The initial pseudo labels from class-agnostic domain alignment (Stage 1) are improved via video spatio-temporal learning (Stage 2). In Stage 3, these pseudo labels on target data, together with ground truth labels on source, enable semantic alignment through the class-aware domain alignment. This again refines the pseudo labels, which further provide enhanced supervision for spatio-temporal learning in stage 4. In this manner, one iteration of CycDA facilitates the alternating knowledge transfer between the image and video models, whereby pseudo labels are improved on each stage and further provide strengthened supervision for better learning on the next stage.
+
+Notations: First, we denote the feature extractor as $E(\cdot; \theta_E)$ , the classifier as $C(\cdot; \theta_C)$ , and the domain discriminator as $D(\cdot; \theta_D)$ . Then, we have the image model $\phi^I = \{E^I(\cdot; \theta_E^I), C^I(\cdot; \theta_C^I), D^I(\cdot; \theta_D^I)\}$ and the video model $\phi^V = \{E^V(\cdot; \theta_E^V), C^V(\cdot; \theta_C^V)\}$ . We use the superscripts $I, V$ and $F$ to denote modalities of image, video and video frame, correspondingly. $S$ and $T$ stand for source and target domains respectively. The labeled source image domain is denoted as $I_S = \{(i_j, l(i_j))|_{j=1}^{N_S^I}\}$ , where $l(\cdot)$ is the ground truth label of the corresponding image. The unlabeled target video domain is $V_T = \{v_j|_{j=1}^{N_T^V}\}$ and each video $v_j$ has $M_j$ frames, the set of frames of unlabeled target videos $V_T^F = \{\{v_{j,m}|_{m=1}^{M_j}\}|_{j=1}^{N_T^V}\}$ .
+
+# 3.2 Stages
+
+Stage 1 - Class-agnostic Spatial Alignment. In the first stage, we learn the class-agnostic domain alignment between source web images and frames sampled from unlabeled target videos. Thus, we reduce the domain gap between the appearance of the web images and target videos even if the classes could be incorrectly aligned during this stage. We train the image model $\phi^I$ with a supervised cross entropy loss $\mathcal{L}_{CE}(I_S)$ and an adversarial domain discrimination loss $\mathcal{L}_{ADD}(I_S,V_T^F)$ on source images and target frames. With the classification loss on source images given as
+
+$$
+\mathcal {L} _ {C E} \left(I _ {S}\right) = \sum_ {\left(i _ {j}, l \left(i _ {j}\right)\right) \in I _ {S}} - l \left(i _ {j}\right) \cdot \log \left(C ^ {I} \left(E \left(i _ {j}; \theta_ {E} ^ {I}\right); \theta_ {C} ^ {I}\right)\right) \tag {1}
+$$
+
+and the binary cross entropy loss for domain discrimination given as
+
+$$
+\mathcal {L} _ {A D D} (I _ {S}, V _ {T} ^ {F}) = \sum_ {i _ {j}, v _ {j ^ {\prime}, m} ^ {F}} \log D ^ {I} (E ^ {I} (i _ {j}; \theta_ {E} ^ {I}); \theta_ {D} ^ {I}) + \log (1 - D ^ {I} (E ^ {I} (v _ {j ^ {\prime}, m} ^ {F}; \theta_ {E} ^ {I}); \theta_ {D} ^ {I})),
+$$
+
+(2)
+
+the overall objective is $\min_{\theta_E^I,\theta_C^I}\mathcal{L}_{CE}(I_S) + \beta \max_{\theta_E^I}\min_{\theta_D^I}\mathcal{L}_{ADD}(I_S,V_T^F)$ , where $\beta$ is the trade-off weight between the two losses. We train the domain discriminator $D^{I}$ to distinguish between extracted features from different domains, while the feature extractor is trained adversely based on the domain discrimination
+
+task. In this case, the feature extractor learns to yield domain invariant features that the domain discriminator is unable to differentiate. The adversarial training is performed with a gradient reversal layer (GRL) [14,15] which reverses the sign of gradients of the domain discrimination loss on the feature extractor during back-propagation. The domain alignment on this stage is class-agnostic as there is not yet any pseudo label for category knowledge in the target domain. The alignment is performed globally at the domain level.
+
+Stage 2 & Stage 4 - Spatio-Temporal Learning. In this stage, we use the trained image model $\phi^I$ from the previous stage to generate pseudo labels for the target videos. Then we perform supervised spatio-temporal learning with the pseudo labeled target data.
+
+Specifically, we first use $\phi^I$ to predict the pseudo label $\hat{l} (\cdot)$ for each frame of the target videos. We employ a spatio-temporal model that trains on target videos capturing both spatial and temporal information in the target domain only. To select new pseudo label candidates, we temporally aggregate frame-level predictions into a video-level prediction. We discard predictions with confidence lower than a threshold $\delta_{p}$ and perform a majority voting among the remaining predictions to define the video label. From all videos, we only keep those that have at least one frame with a minimum confidence. We set the confidence threshold $\delta_{p}$ such that $p\times 100\%$ of videos remain after the thresholding.
+
+We denote the target video set after thresholding as $\tilde{V}_T$ . For stage 2, the supervised task on pseudo labeled target videos is to $\min_{\theta_E^V,\theta_C^V}\hat{\mathcal{L}}_{CE}(\tilde{V}_T)$ , with
+
+$$
+\hat {\mathcal {L}} _ {C E} (\tilde {V} _ {T}) = \sum_ {v _ {j} \in \tilde {V} _ {T}} - \hat {l} (v _ {j}) \cdot \log (C ^ {V} (E ^ {V} (V _ {j}; \theta_ {E} ^ {V}); \theta^ {V})). \tag {3}
+$$
+
+In stage 4, we repeat the process as described above and re-train the video model on the target data with the updated pseudo labels from the third stage.
+
+Stage 3 - Class-aware Spatial Alignment. The adversarial learning for domain discrimination in the first stage aligns features from different domains globally, but not within each category (c.f. Fig. 3 (b) and (c)). In this case, target samples in a category A can be incorrectly aligned with source samples in a different category B. This would lead to inferior classification performance of the target classifier. To evade this misalignment, we perform class-aware domain alignment in the third stage between the source web images and the target video frames. Since the source data consists exclusively of images, we apply alignment on the spatial model between images and frames. Furthermore, as the target data is unlabeled, in order to align features across both domains within each category, we generate pseudo labels by the model $\phi^V$ from the second stage to provide category knowledge. Specifically, we use the video model to generate video-level labels that we disseminate into frame-level labels. To align images and video frames we use cross-domain contrastive learning by maximizing the similarity between samples across domains of the same class and minimizing the similarity between samples from different classes. We use $z = E^{I}(i;\theta_{E}^{I})$ to denote the feature computed by the feature extractor on image $i$ . The set of source
+
+image features is $Z_{S}^{I} = \{E^{I}(i;\theta_{E}^{I})|i\in I_{S}\}$ and the set of target frame features is $Z_{T}^{F} = \{E^{I}(v^{F};\theta_{E}^{I})|v^{F}\in V_{T}^{F}\}$ . During training, for each pseudo labeled target sample $z_{j}^{F}\in Z_{T}^{F}$ , we randomly choose two samples from the source domain: a positive sample of the same label and a negative sample of a different label, i.e. $z_{j + }^{I},z_{j - }^{I}\in I_{S}$ . The contrastive loss is formulated as
+
+$$
+\mathcal {L} _ {\text {C O N T R}} \left(I _ {S}, V _ {T} ^ {F}\right) = - \sum_ {z _ {j} ^ {F} \in Z _ {T} ^ {F}} \log \frac {h \left(z _ {j} ^ {F} , z _ {j} ^ {I} +\right)}{h \left(z _ {j} ^ {F} , z _ {j} ^ {I} +\right) + h \left(z _ {j} ^ {F} , z _ {j} ^ {I} -\right)}. \tag {4}
+$$
+
+Following [5], we set $h(u,v) = \exp (\sin (u,v) / \tau)$ , where we use the cosine similarity $\mathrm{sim}(u,v) = u^{\mathsf{T}}v / (\| u\| \| v\|)$ and $\tau$ is the temperature parameter. Thus, the objective of stage 3 on the image model is $\min_{\theta_F^I,\theta_C^I}\mathcal{L}_{CE}(I_S) + \mathcal{L}_{CONTR}(I_S,V_T^F)$ .
+
+In the third stage, an alternative of exploiting pseudo labels from the video model from the second stage is to self-train the video model on the target data, as self-training is a common practice in DA [26,46,48,49]. However, the category-level domain alignment with supervision from the source domain further regularizes the learning of class distribution in the target domain. This results in a significantly improved target classifier, as we show in Sec. 4.5.
+
+Cycling of the Stages. The pseudo labels from the video model are exploited for class-aware domain alignment on the image model (stage 3) and the updated pseudo labels from the image model can supervise the training of the video model (stage 4). In this manner, stage 3 and stage 4 can be performed iteratively. We show in the evaluation (Table 1 and Fig. 5) the impact of this cyclic learning setup and how several iterations of CycDA can further improve the performance of the target classifier.
+
+# 3.3 Mixed-source Video Adaptation
+
+Image-to-video DA applies to the case in which the source domain consists only of web images. However, other possible settings presume limited amount of annotated videos with the domain shift to the unlabeled target videos. We refer to this case as mixed-source video adaptation. CycDA can be adjusted for this setting as follows. We denote the labeled source video domain as $V_{S} = \{(v_{j},l(v_{j}))|_{j = 1}^{N_{S}^{V}}\}$ . For the class-agnostic (stage 1) and class-aware domain alignment (stage 3) stages we replace the source image domain $\{I_S\}$ by the mixed-source domain data $\{I_S,F_S\}$ which consists of web images and frames sampled from source videos. The supervised classification, adversarial domain discrimination and cross-domain contrastive learning are adapted accordingly. For the spatio-temporal learning of the video model $\phi^V$ (stage 2 and 4) we include additional supervised classification w.r.t. the ground truth labels for the source videos, therefore the overall loss is $\mathcal{L}_{CE}(V_S) + \hat{\mathcal{L}}_{CE}(\tilde{V}_T)$ . In this case, the annotated source videos are utilized to regularize domain alignment on the image model, and provide further supervision for learning the classification task on the video model. In Sec. 4.4, we demonstrate that in the context of mixed-source video adaptation, even a limited amount of source videos is sufficient to achieve results competitive to video-to-video adaptation approaches that employ the entire source video dataset.
+
+# 4 Experiments
+
+# 4.1 Datasets
+
+To evaluate our CycDA framework for image-to-video adaptation, we conduct experiments on 3 real-world image-video action recognition benchmark settings. Videos are from two large-scale action recognition datasets, UCF101 [35] and HMDB51 [23]. Web images are from the EADs (Extensive Action Dataset) [2], Stanford40 [42] and the BU101 dataset [29].
+
+The three image-to-video adaptation tasks are: (1) Stanford40 $\rightarrow$ UCF101: the UCF101 action dataset contains 13320 videos collected from YouTube with 101 action classes. The Stanford40 dataset contains 9532 images collected from Google, Bing and Flickr, comprised of 40 action classes. Following [2,43,44], we select the 12 common action classes between the two datasets for image-to-video action recognition. (2) EADs $\rightarrow$ HMDB51: HMDB51 has 6766 videos with 51 action classes collected from online videos and movie clips. The EADs dataset consists of Stanford40 and the HII dataset [37]. It has 11504 images from 50 action classes. There are 13 shared action classes between the two datasets. (3) BU101 $\rightarrow$ UCF101: BU101 consists of 23.8K web action images from 101 classes that completely correspond to classes on UCF101. We use data of all classes for evaluation on large-scale image-to-video adaptation.
+
+UCF101 and HMDB51 both have three splits of training and test sets. Following [24,44,43], we report the average performance over all three splits.
+
+The UCF-HMDB dataset [3] is a benchmark for video-to-video DA. It consists of the 12 common classes between UCF101 and HMDB51. On this dataset, we perform two types of evaluations: (1) frame-to-video adaptation: we use only a single frame from each source video to adapt to target videos; and (2) mixed-source video adaptation: we use source and target videos of UCF-HMDB, and extend the source domain with web images from BU101.
+
+# 4.2 Implementation Details
+
+For the image model, we use a ResNet-18 [17] pretrained on ImageNet [8]. We freeze the first 6 sequential blocks and train with a learning rate of 0.001 to perform the domain alignment between web images and frames sampled from target videos. To avoid redundancy in the video frames, we uniformly divide a video into 5 segments. In each training epoch, we randomly sample one frame from each segment. As trade-off weight for domain discrimination, we follow the common practices in [14,15,4] to gradually increase $\beta$ from 0 to 1. The temperature parameter $\tau$ is set to 0.05.
+
+For the video model, we employ I3D Inception v1 [1] pretrained on the Kinetics dataset [21], which is common practice, e.g. [2,7,22,31,33]. We train the RGB stream only. To validate the efficacy of our CycDA pipeline, we use the I3D backbone with a shallow classifier of 2 FC layers, without any temporal aggregation module (e.g. GCN in [33] or self-attention module in [7]). We extract a clip of 64 frames from each video. Following [33], we use a learning rate of
+
+| Method | Backbone | E→H | S→U | B→U |
| source only | ResNet18 | 37.2 | 76.8 | 54.8 |
| DANN [15]* | ResNet18 | 39.6 | 80.3 | 55.3 |
| UnAtt [24] | ResNet101 | - | - | 66.4 |
| HiGAN [44] | ResNet50, C3D | 44.6 | 95.4 | - |
| SymGAN [43] | ResNet50, C3D | 55.0 | 97.7 | - |
| CycDA (1 iteration) | ResNet50, C3D | 56.6 | 98.0 | - |
| DANN [15]+I3D* | ResNet18, I3D | 53.8 | 97.9 | 68.3 |
| HPDA [2]* | ResNet50, I3D | 38.2 | 40.0 | - |
| CycDA (1 iteration) | ResNet18, I3D | 60.5 | 99.2 | 69.8 |
| CycDA (2 iterations) | ResNet18, I3D | 60.3 | 99.3 | 72.1 |
| CycDA (3 iterations) | ResNet18, I3D | 62.0 | 99.1 | 72.6 |
| supervised target | ResNet18, I3D | 83.2 | 99.3 | 93.1 |
+
+Table 1. Results on $\mathrm{E}\rightarrow \mathrm{H}$ (13 classes), $\mathrm{S}\rightarrow \mathrm{U}$ (12 classes) and $\mathrm{B}\rightarrow \mathrm{U}$ (101 classes), averaged over 3 splits. ResNet, C3D and I3D are pretrained on ImageNet[17], Sports-1M[20] and Kinetics400[21]. * denotes our evaluation.
+
+0.001 for the backbone and 0.01 on other components. We keep $p = 70\%$ and $80\%$ of videos in stage 2 and stage 4.
+
+# 4.3 Image-to-video DA
+
+We compare the proposed approach to other image-to-video adaptation methods on the three described benchmark settings as shown in Table 1. As CycDA enables the iterative knowledge transfer between the image model and the video model, we can repeat stage 3 and stage 4 multiple times. We therefore report the performance for the first three iterations. We add the lower bound (source only) and the upper bound (ground truth supervised target) for reference.
+
+We compare against several approaches: DANN [15] is classical adversarial domain discrimination on the image-level. UnAtt [24] applies a spatial attention map on video frames. HiGAN [44] and SymGAN [43] employ GANs for feature alignment (on backbone of ResNet50 and C3D) and define the current state-of-the-art on $\mathrm{E}\rightarrow \mathrm{H}$ and $\mathrm{S}\rightarrow \mathrm{U}$ . We also evaluate CycDA with the same backbones for fair comparison. DANN [15] + I3D is a strong baseline that trains the I3D model with pseudo labels from an adapted image model. HPDA [2] is a recent partial DA approach and for a fair comparison, we re-run its official implementation in a closed-set DA setting. Our CycDA outperforms all other approaches already after the first iteration. Except for the saturation on $\mathrm{S}\rightarrow \mathrm{U}$ , running CycDA for more iterations leads to a further performance boost on all evaluation settings.
+
+We further explore the potential of CycDA on UCF-HMDB, which is a benchmark for video-to-video adaptation. For a strict comparison, we select data from the same source video dataset used in the video-to-video adaptation methods, without using any auxiliary web data for training. However, instead of directly using the source videos, we perform frame-to-video adaptation where we use only one frame from each source video to adapt to target videos. Here we sample the middle frame from each video and report the results in Table 2 (case B).
+
+| DA setting | Method | Video backbone | Source data | U→H | H→U |
| web image | videos (U or H) in % |
| A: | video-to-video | AdaBN [25] | ResNet101 | - | 100% | 75.5 | 77.4 |
| MCD [34] | ResNet101 | - | 100% | 74.4 | 79.3 |
| TA3N [3] | ResNet101 | - | 100% | 78.3 | 81.8 |
| ABG [28] | ResNet101 | - | 100% | 79.1 | 85.1 |
| TCoN [32] | ResNet101 | - | 100% | 87.2 | 89.1 |
| DANN [15] | I3D | - | 100% | 80.7 | 88.0 |
| TA3N [3] | I3D | - | 100% | 81.4 | 90.5 |
| SAVA [7] | I3D | - | 100% | 82.2 | 91.2 |
| MM-SADA [31] | I3D | - | 100% | 84.2 | 91.1 |
| CrossModal [22] | I3D | - | 100% | 84.7 | 92.8 |
| CoMix [33] | I3D | - | 100% | 86.7 | 93.9 |
| B: | frame-to-video | CycDA | I3D | - | one frame | 83.3 | 80.4 |
| C: | mixed-source to video | CycDA | I3D | BU* | 0% | 77.8 | 88.6 |
| BU* | 5% | 82.2 | 93.1 |
| BU* | 10% | 82.5 | 93.5 |
| BU* | 50% | 84.2 | 95.2 |
| BU* | 100% | 88.1 | 98.0 |
| supervised target | I3D | - | - | 94.4 | 97.0 |
+
+Table 2. Results of Cycle Adaption on UCF-HMDB in comparison to video-to-video adaptation (case A) approaches. For frame-to-video adaptation (case B), we use only one frame from each source video to adapt to target videos. For mixed-source video adaptation (case C), we combine BU101 web images and source videos as the source data. *We sample 50 web images per class from 12 classes in BU101.
+
+We see that even when using only one frame per source video, on $\mathrm{U}\rightarrow \mathrm{H}$ , CycDA (83.3%) can already outperform $\mathrm{TA}^3\mathrm{N}$ [3] (81.4%) and SAVA [7] (82.2%) which use all source videos for video-to-video adaptation. This demonstrates the strength of CycDA to exploit the large informativity in single images such that they could potentially replace videos as the source data. On $\mathrm{H}\rightarrow \mathrm{U}$ , our source domain contains only 840 frames from the 840 videos in the HMDB training set on UCF-HMDB, which leads to an inferior performance. We show that this can be easily addressed by adding auxiliary web data in Sec. 4.4.
+
+# 4.4 Mixed-source image&video-to-video DA
+
+For mixed-source adaptation, we assume to have both web images and some amount of source videos in the source domain. To evaluate this case, we use the source and target videos on UCF-HMDB, and extend the source domain with web images of the 12 corresponding action classes in BU101. We notice that using all web data from BU101 leads to performance saturation on the target video set of UCF-HMDB. Therefore, to validate the efficacy of CycDA, we only sample 50 web images per class as auxiliary training data. We vary the amount of source videos in the mixed-source domain and report the results in Table 2 (case C). First, by training with only sampled web images (without any source videos), we achieve baseline results of $77.8\%$ (BU $\rightarrow$ H) and $88.6\%$ (BU $\rightarrow$ U). By adding only $5\%$ of videos to the mixed-source domain, we already achieve performance com
+
+ | Experiment | stage 1 | stage 2 | stage 3 | stage 4 | Acc |
| A: | source only | LCE(I_S) | - | - | - | 39.0 |
| B: | source only + video model | LCE(I_S) | LCE(V_T) | - | - | 50.5 |
| C: | class-agnostic DA + video model | LCE(I_S), LADD(I_S, V_T^F) | LCE(V_T) | - | - | 52.3 |
| D: | case C + vid. self-train×1 | LCE(I_S), LADD(I_S, V_T^F) | LCE(V_T) | LCE(V_T) | - | 55.4 |
| E: | case C + vid. self-train×2 | LCE(I_S), LADD(I_S, V_T^F) | LCE(V_T) | LCE(V_T) | LCE(V_T) | 56.4 |
| F: | CycDA | LCE(I_S), LADD(I_S, V_T^F) | LCE(V_T) | LCE(I_S), LCONTR(I_S, V_T^F) | LCE(V_T) | 60.8 |
+
+Table 3. Stage-wise ablation study of the CycDA training pipeline on EADs $\rightarrow$ HMDB51 split 1. A: source only on image model. B: source only training on image model and video model training. C: class-agnostic DA (stage 1) and video model training (stage 2). D: case C + one stage of self-training the videos model. E: case C + two stages of self-training the video model. F: CycDA with stage $1\sim 4$ . Category-level pseudo labels of case C and F are compared in Fig. 4.
+
+parable to the video-to-video adaptation methods, i.e. $82.0\%$ $(\mathrm{BU} + \mathrm{U}\rightarrow \mathrm{H})$ and $93.1\%$ $(\mathrm{BU} + \mathrm{H}\rightarrow \mathrm{U})$ . Furthermore, increasing the amount of source videos from $5\%$ to $50\%$ leads to another improvement of $2\%$ . As web images are more informative than sampled video frames, using web images as auxiliary training data can thus significantly reduce the amount of videos required. Finally, with sampled web images and all source videos, we outperform all video-to-video adaptation methods, even exceeding the supervised target model for $\mathrm{BU} + \mathrm{H}\rightarrow \mathrm{U}$ by $1\%$ . Considering that we only use 50 web images per class, this further demonstrates that CycDA can exploit both, the information in web images and knowledge from the source data with domain shift, for a potentially improved learning.
+
+# 4.5 Ablation study
+
+We perform several ablation studies to validate the proposed CycDA pipeline. We conduct these experiments on the setting of EADs $\rightarrow$ HMDB51 (split 1).
+
+Stage-wise ablation study. We first validate the efficacy of the CycDA pipeline by switching the stages with alternate counterparts. We report the quantitative results of six ablation settings in Table 3. Case A (source only), training the image model on web images only and predicting on target test set, demonstrates the lower bound of $39\%$ . Case B (source only + video model), training with pseudo labeled target videos, is a vanilla baseline. It shows that training the video model with supervision from the image model already significantly improves performance by $11.5\%$ . In case C, with class-agnostic domain alignment on the image model, the performance of B is improved by $1.8\%$ . In case F, after completing the cycle with class-aware domain alignment in stage 3 and training the video model in stage 4 with the updated pseudo labels, we achieve the best performance with $60.8\%$ .
+
+
+(a) source only
+
+
+image features
+(b) CycDA stage 1 class-agnostic alignment
+
+
+(c) CycDA stage 3 class-aware alignment
+
+
+(d) source only + video model
+
+
+target video features
+(e) CycDA stage 2 video model training
+
+
+(f) CycDA stage 4 video model training
+
+
+Figure 3. t-SNE visualizations of image features (for both source and target) and target video features (colored w.r.t. ground truth). We plot the results of source only, source only and video model training, and results of each stage in CycDA.
+
+Additionally, we conduct ablation experiments using pseudo labels from case C to self-train the video model. Although self-training the video model for 1 (case D) or 2 (case E) stages exhibits performance improvement compared to case C, it is still clearly outperformed by CycDA. This indicates that the elaborate step of knowledge transfer from the video model to the image model and class-aware domain alignment are critical for a good performance.
+
+We further illustrate the t-SNE [30] feature visualizations of ablation cases in Fig. 3. By observing image features of the source only case (Fig. 3(a)), we see that web images (blue) gather in category clusters after supervised training, while target video frames (red) are far less discriminative and highly misaligned with source due to large domain shift. The class-agnostic domain alignment (Fig. 3(b)) in stage 1 results in a slightly better global alignment of source and target features. With category knowledge from the video model, the class-aware domain alignment (Fig. 3(c)) demonstrates distinctly better category-level association between source and target. By passing pseudo labels from the image model of Fig. 3(a)(b)(c) to supervise the spatio-temporal training, we get the corresponding video models whose features are plotted in Fig. 3(d)(e)(f). The vanilla baseline of source only + video model (Fig. 3(d)) leads to highly undiscriminative features on the difficult classes, which is slightly improved by class-agnostic alignment (Fig. 3(e)). Class-aware domain alignment (Fig. 3(f)) results in more pronounced category clusters with larger inter-class distances.
+
+
+Figure 4. (a) Category-level pseudo label analysis on target. We compare the accuracy of category-level pseudo labels on target videos for the ablation case C and F from Table 3. Here we plot the accuracy of pseudo labels of the 13 common classes on EADs $\rightarrow$ HMDB51. (b) Samples of four categories on EADs and HMDB51.
+
+
+
+Category-level pseudo label analysis on target. In Fig. 4(a), we plot the accuracy of category-wise pseudo labels on target videos for the ablation cases C and F from Table 3. On case C (blue) which consists of stage 1 (class-agnostic spatial domain alignment) and stage 2 (spatio-temporal learning), image-to-video action recognition has varying performance on different action classes. More specifically, it yields better results on appearance-based actions with distinct background (e.g. climb), or on actions with discriminative pose or gesture (e.g. smoke, pour). On the contrary, there is inferior performance on fine-grained actions with subtle movements (e.g. talk) or actions that are semantically highly generalized with large inter-class variation (e.g. run, wave), c.f. in Fig. 4(b).
+
+By comparing the pseudo label accuracy of cases C and F, we see that the complete CycDA with stage 3 and stage 4 contributes to a significant performance boost on the difficult classes (e.g. run, hug, kiss) while keeping the performance on the easy classes. This can be attributed to the class-aware domain alignment that improves cross-domain association on the difficult classes while keeping the alignment on easy ones. Note that better class-aware domain alignment also leads to more support samples for difficult classes, which could result in slight performance drop on the easier classes.
+
+Domain adaptation strategies in stage 3. In stage 3, we transfer knowledge from the video model to the image model by passing pseudo labels from the video model to provide category information in domain alignment. We compare different DA strategies that use pseudo labels from the video model in Table 4. Intuitively, performing the supervised task on both source and target (case B) outperforms the case of pseudo labeled target only (case A). Adding the adversarial domain discrimination (case C) leads to a further boost. The cross-domain contrastive learning (case D) has the best performance among the 4 cases. In comparison to the case of only stage 1 and 2, a complete cycle with 4 stages leads to performance improvement of at least $3.3\%$ for all cases. This indicates the benefits of transferring the knowledge from the video model onto the image model. The proposed CycDA generalizes well on different strategies using pseudo labels from the previous stage.
+
+| Experiment | stage 3 | stage 4 | Acc |
| stage 1~2 | - | - | 52.3 |
| stage 1~4 | A: LCE(VT)B: LCE(IS, VT)C: LCE(IS, VT), LADD(IS, VT)D: LCE(IS), LCONTR(IS, VT) | LCE(VT) | 55.6 |
| LCE(VT) | 56.4 |
| LCE(VT) | 58.0 |
| LCE(VT) | 60.8 |
+
+Table 4. Comparison of DA strategies in stage 3 on EADs $\rightarrow$ HMDB51 split 1. A: supervised classification on pseudo labeled target frames. B: supervised classification on source and pseudo labeled target. C: B + adversarial domain discrimination. D: supervised classification on source + cross-domain contrastive learning.
+
+ | Aggregation | Acc |
| A: | avg. + class-balanced thresh. | 50.3 |
| B: | avg. + thresh. | 55.9 |
| C: | thresh. + avg. | 60.8 |
+
+Table 5. Temporal aggregation of frame-level pseudo labels into video-level pseudo labels on EADs $\rightarrow$ HMDB51 split 1.
+
+
+Figure 5. Performance of multiple iterations of CycDA (stage 3 and 4) on EADs $\rightarrow$ HMDB51. Average on 3 splits.
+
+Temporal aggregation of frame-level pseudo labels. Before video model training, we temporally aggregate frame-level pseudo labels. Here we compare three strategies of temporal aggregation in Table 5. Frame-level thresholding followed by temporal averaging (case C) outperforms the other two cases which perform temporal averaging before video-level thresholding. Frame-level thresholding filters out frames of low confidence scores and effectively increases the accuracy of video pseudo labels.
+
+Number of iterations. Finally, we illustrate the performance after several iterations on EADs $\rightarrow$ HMDB51 in Fig. 5. It shows that within the first five iterations, performing CycDA iteratively results in a slight increase of performance. Further, within all the 9 iterations, CycDA delivers relatively stable performance, with the result fluctuating between $60.0\%$ and $62.2\%$ without dropping below the ablated alternatives shown in Table 3.
+
+# 5 Conclusions
+
+We presented CycDA to address the image-to-video adaptation problem. We proposed to alternately perform spatial domain alignment to address the domain shift between images and target frames, and spatio-temporal learning to bridge the modality gap. Our evaluations across several benchmarks and datasets demonstrate that CycDA exploits the large informativity in the source images for enhanced performance on the target video classifier.
+
+Acknowledgements This work was partially funded by the Austrian Research Promotion Agency (FFG) project 874065 and by the Christian Doppler Laboratory for Semantic 3D Computer Vision, funded in part by Qualcomm Inc.
+
+# References
+
+1. Carreira, J., Zisserman, A.: Quo vadis, action recognition? a new model and the kinetics dataset. In: CVPR. pp. 6299-6308 (2017)
+2. Chen, J., Wu, X., Hu, Y., Luo, J.: Spatial-temporal causal inference for partial image-to-video adaptation. In: AAAI. vol. 35, pp. 1027-1035 (2021)
+3. Chen, M.H., Kira, Z., AlRegib, G., Yoo, J., Chen, R., Zheng, J.: Temporal attentive alignment for large-scale video domain adaptation. In: ICCV. pp. 6321-6330 (2019)
+4. Chen, M.H., Li, B., Bao, Y., AlRegib, G., Kira, Z.: Action segmentation with joint self-supervised temporal domain adaptation. In: CVPR. pp. 9454-9463 (2020)
+5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: ICML. pp. 1597-1607. PMLR (2020)
+6. Choi, J., Sharma, G., Chandraker, M., Huang, J.B.: Unsupervised and semi-supervised domain adaptation for action recognition from drones. In: WACV. pp. 1717-1726 (2020)
+7. Choi, J., Sharma, G., Schulter, S., Huang, J.B.: Shuffle and attend: Video domain adaptation. In: ECCV. pp. 678-695. Springer (2020)
+8. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR. pp. 248-255. IEEE (2009)
+9. Duan, H., Zhao, Y., Xiong, Y., Liu, W., Lin, D.: Omni-sourced webly-supervised learning for video recognition. In: ECCV. pp. 670-688. Springer (2020)
+10. Feichtenhofer, C.: X3d: Expanding architectures for efficient video recognition. In: CVPR (2020)
+1. Gan, C., Sun, C., Duan, L., Gong, B.: Webly-supervised video recognition by mutually voting for relevant web images and web video frames. In: ECCV. pp. 849-866. Springer (2016)
+2. Gan, C., Sun, C., Nevatia, R.: Deck: Discovering event composition knowledge from web images for zero-shot event detection and recounting in videos. In: AAAI. vol. 31 (2017)
+3. Gan, C., Yao, T., Yang, K., Yang, Y., Mei, T.: You lead, we exceed: Labor-free video concept learning by jointly exploiting web videos and images. In: CVPR. pp. 923-932 (2016)
+4. Ganin, Y., Lempitsky, V.: Unsupervised domain adaptation by backpropagation. In: ICML. pp. 1180-1189. PMLR (2015)
+5. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., Lempitsky, V.: Domain-adversarial training of neural networks. JMLR 17(1), 2096-2030 (2016)
+6. Guo, S., Huang, W., Zhang, H., Zhuang, C., Dong, D., Scott, M.R., Huang, D.: Curriculumnet: Weakly supervised learning from large-scale web images. In: ECCV. pp. 135-150 (2018)
+7. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR. pp. 770-778 (2016)
+8. Jamal, A., Namboodiri, V.P., Deodhare, D., Venkatesh, K.: Deep domain adaptation in action space. In: BMVC. vol. 2, p. 5 (2018)
+9. Kae, A., Song, Y.: Image to video domain adaptation using web supervision. In: WACV. pp. 567-575 (2020)
+20. Karpathy, A., Toderici, G., Shetty, S., Leung, T., Sukthankar, R., Fei-Fei, L.: Large-scale video classification with convolutional neural networks. In: CVPR. pp. 1725–1732 (2014)
+
+21. Kay, W., Carreira, J., Simonyan, K., Zhang, B., Hillier, C., Vijayanarasimhan, S., Viola, F., Green, T., Back, T., Natsev, P., et al.: The kinetics human action video dataset. arXiv preprint arXiv:1705.06950 (2017)
+22. Kim, D., Tsai, Y.H., Zhuang, B., Yu, X., Sclaroff, S., Saenko, K., Chandraker, M.: Learning cross-modal contrastive features for video domain adaptation. In: ICCV. pp. 13618-13627 (2021)
+23. Kuehne, H., Jhuang, H., Garrote, E., Poggio, T., Serre, T.: Hmdb: a large video database for human motion recognition. In: ICCV. pp. 2556-2563. IEEE (2011)
+24. Li, J., Wong, Y., Zhao, Q., Kankanhalli, M.S.: Attention transfer from web images for video recognition. In: ACM Multimedia. pp. 1-9 (2017)
+25. Li, Y., Wang, N., Shi, J., Hou, X., Liu, J.: Adaptive batch normalization for practical domain adaptation. Pattern Recognition 80, 109-117 (2018)
+26. Liu, H., Wang, J., Long, M.: Cycle self-training for domain adaptation. arXiv preprint arXiv:2103.03571 (2021)
+27. Liu, Y., Lu, Z., Li, J., Yang, T., Yao, C.: Deep image-to-video adaptation and fusion networks for action recognition. TIP 29, 3168-3182 (2019)
+28. Luo, Y., Huang, Z., Wang, Z., Zhang, Z., Baktashmotlagh, M.: Adversarial bipartite graph learning for video domain adaptation. In: ACM Multimedia. pp. 19-27 (2020)
+29. Ma, S., Bargal, S.A., Zhang, J., Sigal, L., Sclaroff, S.: Do less and achieve more: Training cnns for action recognition utilizing action images from the web. Pattern Recognition 68, 334-345 (2017)
+30. Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. JMLR 9(11) (2008)
+31. Munro, J., Damen, D.: Multi-modal domain adaptation for fine-grained action recognition. In: CVPR. pp. 122-132 (2020)
+32. Pan, B., Cao, Z., Adeli, E., Niebles, J.C.: Adversarial cross-domain action recognition with co-attention. In: AAAI. vol. 34, pp. 11815–11822 (2020)
+33. Sahoo, A., Shah, R., Panda, R., Saenko, K., Das, A.: Contrast and mix: Temporal contrastive video domain adaptation with background mixing. In: NeurIPS (2021)
+34. Saito, K., Watanabe, K., Ushiku, Y., Harada, T.: Maximum classifier discrepancy for unsupervised domain adaptation. In: CVPR. pp. 3723-3732 (2018)
+35. Soomro, K., Zamir, A.R., Shah, M.: Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402 (2012)
+36. Sun, C., Shetty, S., Sukthankar, R., Nevatia, R.: Temporal localization of fine-grained actions in videos by domain transfer from web images. In: ACM Multimedia. pp. 371-380 (2015)
+37. Tanisik, G., Zalluhoglu, C., Ikizler-Cinbis, N.: Facial descriptors for human interaction recognition in still images. Pattern Recognition Letters 73, 44-51 (2016)
+38. Wang, L., Xiong, Y., Lin, D., Van Gool, L.: Untrimmednets for weakly supervised action recognition and detection. In: CVPR. pp. 4325-4334 (2017)
+39. Wang, Z., She, Q., Smolic, A.: Action-net: Multipath excitation for action recognition. In: CVPR (2021)
+40. Yang, C., Xu, Y., Shi, J., Dai, B., Zhou, B.: Temporal pyramid network for action recognition. In: CVPR (2020)
+41. Yang, J., Sun, X., Lai, Y.K., Zheng, L., Cheng, M.M.: Recognition from web data: A progressive filtering approach. TIP 27(11), 5303-5315 (2018)
+42. Yao, B., Jiang, X., Khosla, A., Lin, A.L., Guibas, L., Fei-Fei, L.: Human action recognition by learning bases of action attributes and parts. In: ICCV. pp. 1331-1338. IEEE (2011)
+
+43. Yu, F., Wu, X., Chen, J., Duan, L.: Exploiting images for video recognition: Heterogeneous feature augmentation via symmetric adversarial learning. TIP 28(11), 5308-5321 (2019)
+44. Yu, F., Wu, X., Sun, Y., Duan, L.: Exploiting images for video recognition with hierarchical generative adversarial networks. In: IJCAI (2018)
+45. Zhang, J., Han, Y., Tang, J., Hu, Q., Jiang, J.: Semi-supervised image-to-video adaptation for video action recognition. IEEE Trans Cybern 47(4), 960-973 (2016)
+46. Zhang, Y., Deng, B., Jia, K., Zhang, L.: Label propagation with augmented anchors: A simple semi-supervised learning baseline for unsupervised domain adaptation. In: ECCV. pp. 781-797. Springer (2020)
+47. Zhuang, B., Liu, L., Li, Y., Shen, C., Reid, I.: Attend in groups: a weakly-supervised deep learning framework for learning from web data. In: CVPR. pp. 1878-1887 (2017)
+48. Zou, Y., Yu, Z., Kumar, B., Wang, J.: Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In: ECCV. pp. 289-305 (2018)
+49. Zou, Y., Yu, Z., Liu, X., Kumar, B., Wang, J.: Confidence regularized self-training. In: ICCV. pp. 5982-5991 (2019)
\ No newline at end of file
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/images.zip b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9804d48324707aa47b53ed067a8e220740283ab6
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca5a28bb3b3099b93c3948e18c23f809d52fe3ac72af5b711af0a47c51507ae1
+size 437675
diff --git a/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/layout.json b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..411ab8d7281752f5a01892f799e21f4f6cb96e02
--- /dev/null
+++ b/cycdaunsupervisedcycledomainadaptationtolearnfromimagetovideo/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d1155a5a5b3f7270fc69eb8c33d3dfb5de7ed40dcff50a10ecfcfd842d69e557
+size 394714
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_content_list.json b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..70a1518fec767951c42d8f247431c381a03ec7eb
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6b66959969b879a674d30a33488c82c830ab2c8635cdab4170454876130ab50
+size 96727
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_model.json b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a6c220a7564b9415a9b7f6e14d4ce374de38e8ee
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e3810726e0a973fb796cf36d220c0faeb0d95829be7774ccfc2c58343b13783a
+size 119616
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_origin.pdf b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ecf6620a582e108534b9a4e16748b3f18ba5093e
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/aa5eee26-23ea-4bef-a340-999f7d2d8d09_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91a1b3c84d80e33362cc9dfad10c403d6acbba31555a4f8eee7f45debf6ee8d6
+size 3123281
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/full.md b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..590867c2908fe0a8af2a343efd8eee729eff2276
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/full.md
@@ -0,0 +1,334 @@
+# $\mathbf{D}^2$ ADA: Dynamic Density-aware Active Domain Adaptation for Semantic Segmentation
+
+Tsung-Han Wu $^{1}$ , Yi-Syuan Liou $^{1}$ , Shao-Ji Yuan $^{1}$ , Hsin-Ying Lee $^{1}$ Tung-I Chen $^{1}$ , Kuan-Chih Huang $^{1}$ , and Winston H. Hsu $^{1,2}$
+
+$^{1}$ National Taiwan University $^{2}$ Mobile Drive Technology
+
+Abstract. In the field of domain adaptation, a trade-off exists between the model performance and the number of target domain annotations. Active learning, maximizing model performance with few informative labeled data, comes in handy for such a scenario. In this work, we present $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ , a general active domain adaptation framework for semantic segmentation. To adapt the model to the target domain with minimum queried labels, we propose acquiring labels of the samples with high probability density in the target domain yet with low probability density in the source domain, complementary to the existing source domain labeled data. To further facilitate labeling efficiency, we design a dynamic scheduling policy to adjust the labeling budgets between domain exploration and model uncertainty over time. Extensive experiments show that our method outperforms existing active learning and domain adaptation baselines on two benchmarks, GTA5 $\rightarrow$ Cityscapes and SYNTHIA $\rightarrow$ Cityscapes. With less than $5\%$ target domain annotations, our method reaches comparable results with that of full supervision.
+
+Keywords: Active Learning, Domain Adaptation, Semantic Segmentation
+
+# 1 Introduction
+
+Semantic segmentation is vital for many intelligent systems, such as self-driving cars and robotics. Over the past ten years, supervised deep learning methods [5,6,7,8,22,41,45,54,56] have achieved great success assisted by rich labeled datasets. However, obtaining large-scale datasets with manual pixel-by-pixel annotation is still costly in terms of time and effort. Thus, several prior works utilized domain adaptation techniques to transfer the knowledge learned from the whole labeled source domain, such as simulated game environments, to real-world unlabeled target domain.
+
+In the field of domain adaptation, a trade-off exists between model performance and the amount of target domain annotations. With sufficient target domain manual annotations, supervised learning method can reach high performance (e.g. 71.3 mIoU on Cityscapes shown in Tab. 1). However, without any target labeling, the performance of unsupervised domain adaptation (UDA) methods [4,10,12,20,23,24,26,37,42,43,53,55,59,60,61] are still far below that of
+
+
+(a) Far from source domain
+
+
+(b) Diverse in target domain
+Fig. 1. Different Exploration Techniques in the ADA. (a) [40,58] proposed acquiring labels of target samples that are far from the source domain by the trained domain discriminator. However, the selected biased samples are inconsistent with real target distribution. (b) [13,31,39] proposed selecting diverse samples in the target domain with clustering techniques for label acquisition. Nonetheless, redundant annotations exist on samples that are similar to the existing labeled source domain dataset. (c) We propose a density-aware ADA strategy that acquires labels for samples that are representative in the target domain yet scarce the source domain, which is better than only considering either the source domain (a) or the target domain (b).
+
+
+(c) Density-aware (ours)
+
+full supervision (e.g. 57.5 mIoU on GTA [32] $\rightarrow$ Cityscapes [11] reported by [55]). Compared to the above two extreme cases, which are impractical in real-world applications, a more reasonable manner is to strike a balance between model performance and the cost of labeling efforts.
+
+Active learning, maximizing model performance with few informative labeled data, comes in handy for such a scenario. In the past few years, several works utilized model uncertainty [14,34,36,38,44,46] or data diversity [2,21,28,35,50] as the indicator to select valuable samples for labeling. The core concept of uncertainty-based methods is to acquire labels for data close to the model decision boundary, and the main idea of data diversity approaches is to query labels for a batch of samples that are far away from each other in the feature space.
+
+Recently, some studies leveraged uncertainty and diversity active learning methods for domain adaptation [13,31,39,40,58], named Active Domain Adaptation (ADA); however, these methods have two significant defects. First of all, existing techniques for exploring target domain distributions is not efficient. Fig. 1 (a, b) shows two typical approaches. As observed in (a), selecting samples far from source domain distributions [40,58] might lead to outliers or biased data [29]. As shown in (b), labeling diverse data in the target domain [13,31,39] might cause unnecessary annotations. In Fig. 3, we showed that the methods with $5\%$ annotations still performed worse than ours with $2.5\mathrm{x}$ fewer labels.
+
+Furthermore, in the field of active learning, label acquisition strategies will be executed for multiple rounds [35,44]; yet, existing methods [13,31,39,40,58], combining uncertainty and diversity, did not notice the uncertainty measurement is less informative in the first few rounds in the ADA problem. As shown in Fig. 2 (a, b, c), model uncertainty might fail to detect high-confident but erroneous target domain regions (e.g. mispredict the pavement road as the sidewalk) under severe domain shift in earlier rounds. Thus, heavily relying on uncertainty cues led to poor results under low labeling budgets (see Tab. 2 and Fig. 3).
+
+
+Fig. 2. Analysis of Uncertainty Criterion in the ADA. Uncertainty-based active learning methods acquire labels of data close to the decision boundary (red background). Since its inability to detect high-confident error under severe domain shift, several representative samples in the target domain far from the decision boundary will not be selected (yellow background) in earlier rounds, resulting in low label efficiency under few labeling budgets as shown in (a, b, c). However, as the two domains gradually align by fine-tuning with acquired labels, the number of high-confident but erroneous regions are rapidly reduced. Meanwhile, uncertainty measurement is able to capture the low-confident error with an accurate model in later rounds, as shown in (d, e, f). Hence, we propose a dynamic scheduling policy to pay more attention on domain exploration in earlier stages and rely more on model uncertainty later (Sec. 3.3).
+
+To address the two problems, we present an Dynamic Density-aware Active Domain Adaptation (D²ADA) framework for semantic segmentation. To select the most informative target domain data for labeling, we propose a novel density-aware selection method to select data with the largest domain gaps. In this work, we use the term, domain density, to describe the prevalence of an observed sample in a specific domain. Then, we acquire the labels of regions with the largest density difference between the source and the target domain. As our intuition in Fig. 1 (c), since the model has already performed well on rich labeled source domain data, labeling few samples with high target domain density but low source domain density is sufficient for models to overcome the domain shift. Compared to prior works in Fig. 1 (a, b), the superiority of our method is demonstrated in Fig. 3. Also, it is mathematically proved to reduce the generalization bound of domain adaptation.
+
+To maximize the advantages of domain exploration and model uncertainty, we develop a dynamic scheduling policy to adjust the labeling budgets between the two selection strategies over time. Since the key idea of the exploration technique is to reduce the domain gap, it greatly improves the performance in
+
+the first few rounds when the domain gap is large but is less effective later when the two domains are almost aligned as shown in Tab. 2. In contrast, as discussed in Fig. 2, the strength of uncertainty is in later rounds (d, e, f), while its defect of ignoring high-confident but erroneous areas usually occurs in the earlier rounds (a, b, c). Based on the analysis, we designed a dynamic scheduling policy to allocate more labeling budgets for our density selection in earlier rounds and more for uncertainty selection later.
+
+Experiments showed that our proposed $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ surpasses existing active learning and domain adaptation baselines on two widely used benchmarks, GTA5 $\rightarrow$ Cityscapes and SYNTHIA $\rightarrow$ Cityscapes. Moreover, with less than $5\%$ target domain labels, our method reaches comparable results with full supervision.
+
+To sum up, our contributions are highlighted as follows,
+
+- We open up a new way for ADA that utilizes domain density as an active selection criterion.
+- We design a dynamic scheduling policy to adjust the budgets between model uncertainty and domain exploration in the ADA problem.
+- Extensive experiments demonstrate our method outperforms current state-of-the-art active learning and domain adaptation methods.
+
+# 2 Related Work
+
+We introduce domain adaptation methods for semantic segmentation with none or few target labels and briefly review the progress of deep active learning.
+
+# 2.1 Unsupervised Domain Adaptation for Semantic Segmentation
+
+Many researchers have delved into unsupervised domain adaptation (UDA) methods for semantic segmentation. One widely-used approach is to align the distribution of the source and target domain through adversarial training [4,12,24,42,43]. Another popular method is to apply self-training techniques [47,55,57,59,60,61] by regularizing model uncertainty and assigning pseudo labels to reliable target domain data. However, the performance of distribution alignment is still not satisfying [28], and self-training often suffers from label noise [55]. These defects make existing UDA methods hard to reach the performance of full supervision on labeled target domain data.
+
+# 2.2 Domain Adaptation for Semantic Segmentation with Few Target Labels
+
+To reduce the performance gap between UDA methods and supervision on the whole labeled target domain data, some recent works have explored the utilization of weak and few target domain annotations.
+
+[30] introduced a weakly-supervised domain adaptation (WDA) framework for semantic segmentation, where image-level annotations are provided initially, and few manual or pseudo pixel-level labels are gradually added.
+
+Some considered the semi-supervised domain adaptation (SSDA) scenario, where few pixel-level annotations are available during training. [48] attempted to align the features of the source and target domain globally and semantically. [9] reduced the domain shift by mixing domains and knowledge distillation.
+
+Unlike the above settings, where few labels were initially given, others used active learning strategies to acquire few target annotations from humans. For example, [28] chose diverse target domain images dissimilar to multiple source domain anchors for labeling. [36] utilized the inconsistency map generated by the disagreement of two classifiers to acquire few uncertain target pixel labels.
+
+Different from those prior works focusing on uncertain or diverse samples, our density-aware selection method acquires labels of few but vital samples that can bridge the gap between the source and target domains.
+
+# 2.3 Active Learning for Domain Adaptation
+
+Active learning can reduce the annotation effort by gradually selecting the most valuable unlabeled data to be labeled.
+
+Conventional active learning strategies can be roughly divided into two categories: uncertainty-based methods and diversity-aware approaches. The main idea of uncertainty-based methods is to acquire labels of data close to the model decision boundary. For example, [44,46] utilized the softmax entropy, confidence, or margin of network outputs as the selection criterion. [14,15] proposed a better measurement of uncertainty with MC-dropout. On the other hand, the key concept of diversity approaches is querying annotations of a batch of samples far away from each other in the feature space. Prior works used clustering [2] or greedy selection [21,35,50] to achieve the diversity in a query batch.
+
+In addition, several recent works have studied active domain adaptation scenarios that consider both uncertainty and diversity. [40,58] used the trained classifier and domain discriminator to select highly uncertain samples far from the source domain distribution. [13,31,39] utilized clustering to select highly uncertain samples that are diverse in target domain distribution. Very recently, [52] proposed an energy-based approach and [51] presented the concept of regional impurity to address this problem.
+
+To the best of our knowledge, we propose the first density-aware active domain adaptation strategy to acquire labels of representative samples with high density in the target domain but low density in the source domain. Also, we developed the first dynamic scheduling policy between domain exploration and model uncertainty for active domain adaptation.
+
+# 3 Method
+
+# 3.1 Overview
+
+In the Active Domain Adaptation (ADA) problem, we have a data pool of $C$ -category semantic segmentation from two domains, comprising rich labeled data
+
+$D_{S}$ in the source domain and some data $D_{T}$ in the target domain. $D_{T}$ can be divided into $D_T^L$ and $D_T^U$ , where $D_T^L$ contains the data in the target domain that has been labeled and $D_T^U$ stores the remaining unlabeled data.
+
+Given the initial $D_T$ without any annotations, i.e., $D_T^L = \emptyset$ , the ADA algorithm iteratively acquires annotations of few data in $D_T^U$ to maximize the performance improvement over the test data in the target domain. The label acquisition process will be performed several rounds and the labeling budgets in single round is a fixed number of pixels.
+
+Our Dynamic Density-aware Active Domain Adaptation (D²ADA) framework can be divided into 3 steps: (1) Train an initial model on $D_{S} \cup D_{T}$ with UDA methods as a warmup step. (2) Perform the density-aware selection to determine representative regions for each category according to the domain density and balance the budgets across classes. (Sec. 3.2). (3) Dynamically determine the labeling budgets for domain exploration and model uncertainty in each round. Then, for the top-ranked regions in $D_{T}^{U}$ , acquire ground truth labels and move them to $D_{T}^{L}$ . Finally, fine-tune the model on $D_{S} \cup D_{T}^{L}$ in a supervised manner and go back to step (2) for a new round (Sec. 3.3). The complete and detailed algorithm can be referred in the supplementary material.
+
+# 3.2 Density-aware Selection
+
+To efficiently label the most informative target domain data, unlike prior domain exploration techniques causing biased samples (Fig. 1(a)) or redundant labeling (Fig. 1(b)), our density-aware approach (Fig. 1(c)) selects data representative in the target distribution but uncommon in the source distribution. To achieve this, we introduce the concept of domain density to calculate the prevalence of data in a single domain and estimate the categorical domain gaps between the two domains. By selecting data with the largest domain gaps, we can adapt the model to the target domain with the least possible amount of queried annotations.
+
+In the following section, we first introduce the definition of domain density and provide ways to estimate it for each category. Then, we elaborate on our density difference metric and its theoretical foundation. Finally, we describe the motivation and operation of our class-balanced selection.
+
+Domain Density Estimation. Domain density is defined as a measurement of how common a region $R$ is predicted as a certain class in a particular domain. Following prior works [3,19,25,38], we divide an image into multiple regions using the widely-used SLIC [1] algorithm. To derive the domain density, we first calculate the feature $z$ of a region $R$ as the average feature over all the pixels within $R$ . Similarly, a category $c \in [C] = \{1, 2, \dots, C\}$ is assigned to a region based on the predicted probability averaged across all pixels in the region. Given a domain $S$ , a feature vector $z$ , and a category $c$ , we define the source domain density
+
+$$
+d _ {S} = p _ {S} (z | c) \tag {1}
+$$
+
+as the probability that $z$ is classified as $c$ in $S$ . To estimate $p_S(z|c)$ , we construct the density estimators from all the observed $(z,c)$ pairs in the source domain dataset. The target domain follows the manner similarly.
+
+In our implementation, a set of Gaussian Mixture Models (GMMs) are served as the density estimators. The construction of GMMs can be efficiently completed by offline and parallel execution, which takes about 0.01 seconds per region with an 8-core CPU personal computer. More discussions and details are left in the supplementary material.
+
+Density Difference as Metric. The key idea of our density-aware method is to select unlabeled target regions that contribute most to the domain gap so that we can adapt the model from the existing labeled source domain to the target domain efficiently. In practice, we use the difference between the target and the source domain density of a single region to evaluate the domain gap.
+
+For the $i$ -th unlabeled target region, we first obtain its source domain density $d_S^i$ and target domain density $d_T^i$ by feeding $(z_i, c_i)$ to the pre-constructed density estimators. Then, we introduce a metric to rank all regions in $D_T^U$ :
+
+$$
+\pi_ {i} = \log \left(\frac {d _ {T} ^ {i}}{d _ {S} ^ {i}}\right), \tag {2}
+$$
+
+where $i = 1,2,\dots ,|\# \text{regions} \in D_T^U|$ . The ratio at the log scale is the log-likelihood difference of the two domain densities [16]. According to Eq. 2, regions with larger $\pi$ are more prevalent in the target domain and less observable in the source domain. Therefore, we select regions with large $\pi$ values to replenish the insufficient knowledge of the source domain and to maximize the exploration of the target domain. For each category $c$ , we sorted all unlabeled regions based on their importance scores. Then, a fixed number of top-ranked regions for each category will be selected for labeling until running out of annotation budgets.
+
+Theoretical Foundation. To provide the theoretical foundations for our proposed density difference metric, we leverage the proposition presented in [27]
+
+$$
+\ell_ {t e s t} \leq \ell_ {t r a i n} + \frac {M}{\sqrt {2}} \sqrt {D _ {\mathrm {K L}} \left(p _ {T} (c , z) \mid \mid p _ {S} (c , z)\right)}, \tag {3}
+$$
+
+where $\ell_{test}$ and $\ell_{train}$ denote the testing and training loss respectively. $p_S$ and $p_T$ are the joint probability distributions of the category $c$ and the extracted feature $z$ in the source and the target domain distribution respectively. $M$ is a constant term and $D_{\mathrm{KL}}(||)$ is the KL divergence of the two distributions.
+
+As shown in Eq. 3, to provide a tighter generalization bound for $\ell_{test}$ , we aim to minimize the KL of the two joint probability distributions as follows:
+
+$$
+\begin{array}{l} D _ {\mathrm {K L}} \left(p _ {T} (c, z) \mid \mid p _ {S} (c, z)\right) = D _ {\mathrm {K L}} \left(p _ {T} (c) \mid \mid p _ {S} (c)\right) \\ + \mathbb {E} _ {p _ {T} (c)} [ D _ {\mathrm {K L}} (p _ {T} (z | c) \mid p _ {S} (z | c)) ]. \tag {4} \\ \end{array}
+$$
+
+The proof of Eq. 4 is provided in the supplementary material.
+
+Since $p_T(c)$ and $p_S(c)$ are similar in most cases, we can obtain better generalization to the target domain by minimizing the expected value of the KL divergence from $p_S(z|c)$ to $p_T(z|c)$ . Additionally, to deal with the label imbalance
+
+problem and to make the model perform well for each category for semantic segmentation, we opt to reduce the categorical KL term, i.e., $D_{\mathrm{KL}}(p_T(z|c) || p_S(z|c))$ .
+
+Although it is impossible to obtain the precise KL term by sampling all data points in the high dimensional continuous feature space, we could leverage the Monte Carlo simulation process to estimate the KL of the two distributions [18]. Given a sufficient number of $N$ observed region features $\{z_i\}_{i=1}^N$ predicted to a certain category $c$ , the KL divergence of the two conditional probability distributions can be approximated as:
+
+$$
+D _ {\mathrm {K L}} \left(p _ {T} (z | c) \mid \mid p _ {S} (z | c)\right) \approx \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left(\frac {p _ {T} \left(z _ {i} \mid c\right)}{p _ {S} \left(z _ {i} \mid c\right)}\right) = \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left(\frac {d _ {T} ^ {i}}{d _ {S} ^ {i}}\right) = \frac {1}{N} \sum_ {i = 1} ^ {N} \pi_ {i}, \tag {5}
+$$
+
+where $\pi$ is our designed metric to rank all regions in the same class (see Eq. 2).
+
+Eq. 3, 4, 5 bridge the theory and our proposed metric. By providing annotations for data that contribute the most to the KL divergence (large $\pi$ value) for each category, the domain shift between the source and target domain could be reduced, making the generalization bound of $\ell_{test}$ tighter.
+
+Class-balanced Selection. With our proposed density difference metric, the labeling budget in each round can be equally divided into $C$ categories. Nonetheless, we demonstrate that ADA can be achieved more efficiently.
+
+We empirically observe the required budget for domain adaptation varies across classes, and thus it is inefficient to allocate the same budget to each class. For example, UDA methods can reach the performance close to fully supervised learning in some classes like "vegetarian" and "building". However, it is difficult for them to generalize to others like "train" or "sidewalk" (see Tab. 1). Hence, we propose a class-balanced selection to fully utilize the labeling budget.
+
+Intuitively, we would like to spend more budgets on hard categories, while fewer selection budgets for already well-aligned ones. According to Eq. 5, the average $\pi$ scores of a particular category can be regarded as an approximation of categorical KL divergence from the source domain to the target domain. Therefore, we use this indicator to balance the selection budget across classes. Suppose the total labeling budget of our density selection in each round is $B^{d}$ pixels, for a certain category $c$ , the allocated budget $B^{d,c}$ is as follows:
+
+$$
+B ^ {d, c} = \frac {w _ {c}}{\sum_ {i \in [ C ]} w _ {i}} \cdot B ^ {d}, w _ {c} = \sigma \left(D _ {K L} \left(p _ {T} (z | c) \mid \mid p _ {S} (z | c)\right)\right). \tag {6}
+$$
+
+In the Eq. 6, $\sigma$ is a normalization function to make the weighting term falls within a reasonable range. The equation ensures that more labels are assigned to classes with larger domain shift, while less are distributed to well-aligned ones.
+
+# 3.3 Dynamic Scheduling Policy
+
+As described in Sec. 1, prior ADA practices acquired labels considering both uncertainty and domain exploration equally over time. However, these practices,
+
+not aware of the defects of both methods under different stages, caused poor labeling efficiency, especially under low labeling budgets in earlier rounds.
+
+As shown in the comparison of Fig. 2 (a, b, c) and (d, e, f), uncertainty indicator is less effective under severe domain shift but provides informative cues when more target domain labeled data are acquired. Conversely, since the design concept of domain exploration is to conquer the domain shift, it is effective in the earlier rounds in ADA but the growth rapidly slows down in the later rounds as shown in Tab. 2 (a, c). As a result, we develop a dynamic scheduling policy to benefit from both selection strategies and facilitate labeling efficiency.
+
+Let $B$ be the constant labeling budgets of each active selection round. In the $n$ -th round, $B$ can be divided to $B_{n}^{d}$ for the density-aware approach and $B_{n}^{u}$ for an uncertainty-based method. Our budget allocation arrangements for the two approaches are as follows:
+
+$$
+\begin{array}{l} \lambda = \alpha \cdot 2 ^ {- \beta (n - 1)}, \\ B _ {n} ^ {d} = \lambda B, B _ {n} ^ {u} = (1 - \lambda) B, \tag {7} \\ \end{array}
+$$
+
+where $\alpha$ is the balance coefficient between density-aware and the uncertainty-based method, and $\beta$ is the decay rate of the labeling budget of the density-aware approach. The reason for using half decay is to reflect the observation of the rapid domain shift reduction, which is discussed in Sec. 4.4. The above formula ensures that the density-aware method is heavily relied on when the domain gaps are large in the first few rounds, and the uncertainty-based method is mainly used when the gaps are diminished in the later rounds. The effectiveness of the designed policy is shown in Tab. 2. In our implementation, we use the conventional softmax entropy [44] as the uncertainty measurement.
+
+After deciding the labeling budgets $B_{n}^{d}$ and $B_{n}^{u}$ for density-aware and uncertainty methods with our dynamic scheduling policy in each round, we select regions with the two selection strategies. Then, we acquire ground truth labels for these regions and move them from the unlabeled target set $D_{T}^{U}$ to the labeled target set $D_{T}^{L}$ . Finally, we fine-tune the model with $D_{S} \cup D_{T}^{L}$ under full supervision and then execute the next active selection round.
+
+# 4 Experiments
+
+# 4.1 Experimental Settings
+
+We elaborate the datasets, networks and active learning protocol in our experiments. The implementation details are reported in the supplementary material.
+
+Datasets. We evaluated various active learning and domain adaptation methods on two widely-used domain adaptive semantic segmentation benchmarks: GTA5 $\rightarrow$ Cityscapes and SYNTHIA $\rightarrow$ Cityscapes. Cityscapes [11] is a real-world self-driving dataset containing 2975 labeled training images, 500 labeled validation images and 1225 test images. GTA5 [32] is a synthetic dataset consisting of 24966 annotated images, which shares 19 semantic categories with Cityscapes. SYNTHIA dataset [33] has 9400 synthetic annotated images, which share 16
+
+Fig. 3. Comparison with different active learning baselines. On two widely-used benchmarks, our $\mathbf{D}^2$ ADA outperforms 8 existing active learning strategies, including uncertainty-based methods (MAR, CONF, ENT), hybrid approaches (ReDAL, BADGE), and ADA practices. The result suggested that compared to prior domain exploration methods shown in Fig. 1 (a, b), our density-aware method (c) achieves significant improvement. More explanations and observations are reported in Sec. 4.2.
+
+--FullSupervision 一RAND 一MAR
+
+
+—AADA - Fig.1 (a) —CLUE - Fig.1 (b) —D²ADA (Ours) - Fig.1 (c)
+
+semantic categories with Cityscapes. For a fair comparison, we evaluated all methods on the Cityscapes validation split.
+
+Models. We used DeepLabV3+ [8], a semantic segmentation model, to evaluate all active learning strategies. To fairly compare our method with existing domain adaptation approaches, we report the results on both DeepLabV2 [6] and DeepLabV3+ [8]. The two models are based on the ResNet-101 [17] backbone.
+
+Active Learning Protocol. For all experiments, we first adopted [42] to train the network with adversarial training as a warmup step. Then we performed $N$ -round active selection comprising of the following steps: (1) Select a small number of regions with $B$ pixels from the unlabeled Cityscapes training split $D_T^U$ based on different active selection strategies. (2) Acquire the labels of these selected data and add them to $D_T^L$ . (3) Fine-tune the model with $D_S \cup D_T^L$ in a supervised manner. In our setting, we choose $N = 5$ , $B = 1\%$ of the total number of pixels in Cityscapes training split for both tasks.
+
+# 4.2 Comparison with Active Learning Baselines
+
+We compared $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ with 8 other active learning strategies, including random region selection (RAND), uncertainty-based methods (CONF [44], MAR [44], and ENT [44]), hybrid methods (BADGE [2] and ReDAL [50]), and existing Active Domain Adaptation baselines (AADA [40] and CLUE [31]). The implementation details are described in the supplementary material.
+
+The experimental results are shown in Fig. 3. In each subplot, the x-axis indicates the percentage of total target domain annotated points and the y-axis is the corresponding mIoU score achieved by the network.
+
+Table 1. Comparison with different domain adaptation approaches on (a) GTA5 $\rightarrow$ Cityscapes and (b) SYNTHIA $\rightarrow$ Cityscapes. Our proposed D²ADA outperforms any existing methods on the overall mIoU and most per-class IoU with only $5\%$ target annotations with different network backbones. mIoU* in (b) denotes the averaged scores across 13 categories used in [42]. To fairly compare all methods under the same number of annotations, we draw a chart in Fig. 4.
+
+| (a) GTA5 → Cityscapes | |
| Method | Road | SW | Build | Wall | Fence Pole | TL | TS | Veg. | Terrain | Sky | PR | Rider | Car | Truck | Bus | Train | Motor | Bike | |
| UDA | AdaptSeg [42] | 86.5 | 36.0 | 79.9 | 23.4 | 23.3 | 35.2 | 14.8 | 14.8 | 83.4 | 33.3 | 75.6 | 58.5 | 27.6 | 73.7 | 32.5 | 35.4 | 3.9 | 30.1 | 28.1 |
| ADVENT [43] | 89.9 | 36.5 | 81.2 | 29.2 | 25.2 | 28.5 | 32.3 | 22.4 | 83.9 | 34.0 | 77.1 | 57.4 | 27.9 | 83.7 | 29.4 | 39.1 | 1.5 | 28.4 | 23.3 |
| SIMDA [49] | 90.6 | 44.7 | 84.8 | 34.3 | 28.7 | 31.6 | 35.0 | 37.6 | 84.7 | 43.3 | 85.3 | 57.0 | 31.5 | 83.8 | 42.6 | 48.5 | 1.9 | 30.4 | 39.0 |
| CBST [60] | 91.8 | 53.5 | 80.5 | 32.7 | 21.0 | 34.0 | 28.9 | 20.4 | 83.9 | 34.2 | 80.9 | 53.1 | 24.0 | 82.7 | 30.3 | 35.9 | 16.0 | 25.9 | 42.8 |
| CRST [61] | 91.0 | 55.4 | 80.0 | 33.7 | 21.4 | 37.3 | 32.9 | 24.5 | 85.0 | 34.1 | 80.8 | 57.7 | 24.6 | 84.1 | 27.8 | 30.1 | 26.9 | 26.0 | 47.1 |
| LTIR [20] | 92.9 | 55.0 | 85.3 | 34.2 | 31.1 | 34.9 | 40.7 | 34.0 | 85.2 | 40.1 | 87.1 | 61.0 | 31.1 | 82.5 | 32.3 | 42.9 | 0.3 | 36.4 | 46.1 |
| FDA [53] | 92.5 | 53.3 | 82.4 | 26.5 | 27.6 | 36.4 | 40.6 | 38.9 | 82.3 | 39.8 | 78.0 | 62.6 | 34.4 | 84.9 | 34.1 | 53.1 | 16.9 | 27.7 | 46.4 |
| TPLD [37] | 94.2 | 60.5 | 82.8 | 36.6 | 16.6 | 39.3 | 29.0 | 25.5 | 85.6 | 44.9 | 84.4 | 60.6 | 27.4 | 84.1 | 37.0 | 47.0 | 31.2 | 36.1 | 50.3 |
| IAST [26] | 93.8 | 57.8 | 85.1 | 39.5 | 26.7 | 26.2 | 43.1 | 34.7 | 84.9 | 32.9 | 88.0 | 62.6 | 29.0 | 87.3 | 39.2 | 49.6 | 23.2 | 34.7 | 39.6 |
| ProDA [55] | 87.8 | 56.0 | 79.7 | 46.3 | 44.8 | 45.6 | 53.5 | 53.5 | 88.6 | 45.2 | 82.1 | 70.7 | 39.2 | 88.8 | 45.5 | 59.4 | 1.0 | 48.9 | 56.4 |
| CAMDA [59] | 91.3 | 46.0 | 84.5 | 34.4 | 29.7 | 32.6 | 35.8 | 36.4 | 84.5 | 43.2 | 83.0 | 60.0 | 32.2 | 83.2 | 35.0 | 46.7 | 0.0 | 33.7 | 42.2 |
| DPL-Dual [10] | 92.8 | 54.4 | 86.2 | 41.6 | 32.7 | 36.4 | 49.0 | 34.0 | 85.8 | 41.3 | 86.0 | 63.2 | 34.2 | 87.2 | 39.3 | 44.5 | 18.7 | 42.6 | 43.1 |
| BAPA-Net [23] | 94.4 | 61.0 | 88.0 | 26.8 | 39.9 | 38.3 | 46.1 | 55.3 | 87.8 | 46.1 | 89.4 | 68.8 | 40.0 | 90.2 | 60.4 | 59.0 | 0.0 | 45.1 | 54.2 |
| WDA | WDA [30] (Point) | 94.0 | 62.7 | 86.3 | 36.5 | 32.8 | 38.4 | 44.9 | 51.0 | 86.1 | 43.4 | 87.7 | 66.4 | 36.5 | 87.9 | 44.1 | 58.8 | 23.2 | 35.6 | 55.9 |
| SSDA | ASS [48] (+50 city) | 94.3 | 63.0 | 84.5 | 26.8 | 28.0 | 38.4 | 35.5 | 48.7 | 87.1 | 39.2 | 88.8 | 62.2 | 16.3 | 87.6 | 23.2 | 39.2 | 7.2 | 24.4 | 58.1 |
| ADA | LabOR [36] (V2, 2.2%) | 96.6 | 77.0 | 89.6 | 47.8 | 50.7 | 48.0 | 56.6 | 63.5 | 89.5 | 57.8 | 91.6 | 72.0 | 47.3 | 91.7 | 62.1 | 61.9 | 48.9 | 47.9 | 65.3 |
| MADA [28] (V3+, 5%) | 95.1 | 69.8 | 88.5 | 43.3 | 48.7 | 45.7 | 53.3 | 59.2 | 89.1 | 46.7 | 91.5 | 73.9 | 50.1 | 91.2 | 60.6 | 56.9 | 48.4 | 51.6 | 68.7 |
| RIPU [51] (V3+, 5%) | 97.0 | 77.3 | 90.4 | 54.6 | 53.2 | 47.7 | 55.9 | 64.1 | 90.2 | 59.2 | 93.2 | 75.0 | 54.8 | 92.7 | 73.0 | 79.7 | 68.9 | 55.5 | 70.3 |
| D2ADA (V2, 5%) | 96.3 | 73.6 | 89.3 | 50.0 | 52.3 | 48.0 | 56.9 | 64.7 | 89.3 | 53.9 | 92.3 | 73.9 | 52.9 | 91.8 | 69.7 | 78.9 | 62.7 | 57.7 | 71.1 |
| D2ADA (V3+, 5%) | 97.0 | 77.8 | 90.0 | 46.0 | 55.0 | 52.7 | 58.7 | 65.8 | 90.4 | 58.9 | 92.1 | 75.7 | 54.4 | 92.3 | 69.0 | 78.9 | 68.5 | 59.1 | 72.3 |
| Target Only | DeepLabV2 [6] | 97.4 | 79.5 | 90.3 | 51.1 | 52.4 | 49.0 | 57.5 | 68.0 | 90.5 | 58.1 | 93.1 | 75.1 | 53.9 | 92.7 | 72.0 | 80.2 | 65.0 | 58.1 | 71.1 |
| DeepLabV3+ [8] | 97.6 | 81.3 | 91.1 | 49.8 | 57.6 | 53.8 | 59.6 | 69.1 | 91.2 | 60.5 | 94.4 | 76.7 | 55.6 | 93.3 | 75.8 | 79.9 | 72.9 | 57.7 | 72.2 |
+
+| (b) SYNTHIA → Cityscapes |
| Method | Road | SW | Build | Wall* | Fence* | Pole* | TL | TS | Veg. | Sky | PR | Rider | Car | Bus | Motor | Bike |
| UDA | AdaptSeg [42] | 79.2 | 37.2 | 78.8 | - | - | - | 9.9 | 10.5 | 78.2 | 80.5 | 53.5 | 19.6 | 67.0 | 29.5 | 21.6 | 31.3 |
| ADVENT [43] | 85.6 | 42.2 | 79.7 | 8.7 | 0.4 | 25.9 | 5.4 | 8.1 | 80.4 | 84.1 | 57.9 | 23.8 | 73.3 | 36.4 | 14.2 | 33.0 |
| SIMDA[49] | 83.0 | 44.0 | 80.3 | - | - | - | 17.1 | 15.8 | 80.5 | 81.8 | 59.9 | 33.1 | 70.2 | 37.3 | 28.5 | 45.8 |
| CBST [60] | 68.0 | 29.9 | 76.3 | 10.8 | 1.4 | 33.9 | 22.8 | 29.5 | 77.6 | 78.3 | 60.6 | 28.3 | 81.6 | 23.5 | 18.8 | 39.8 |
| CRST [61] | 67.7 | 32.2 | 73.9 | 10.7 | 1.6 | 37.4 | 22.2 | 31.2 | 80.8 | 80.5 | 60.8 | 29.1 | 82.8 | 25.0 | 19.4 | 45.3 |
| LTIR [20] | 92.6 | 53.2 | 79.2 | - | - | - | 1.6 | 7.5 | 78.6 | 84.4 | 52.6 | 20.0 | 82.1 | 34.8 | 14.6 | 39.4 |
| FDA [53] | 79.3 | 35.0 | 73.2 | - | - | - | 19.9 | 24.0 | 61.7 | 82.6 | 61.4 | 31.1 | 83.9 | 40.8 | 38.4 | 51.1 |
| TPLD [37] | 80.9 | 44.3 | 82.2 | 19.9 | 0.3 | 40.6 | 20.5 | 30.1 | 77.2 | 80.9 | 60.6 | 25.5 | 84.8 | 41.1 | 24.7 | 43.7 |
| IAST [26] | 81.9 | 41.5 | 83.3 | 17.7 | 4.6 | 32.3 | 30.9 | 28.8 | 83.4 | 85.0 | 65.5 | 30.8 | 86.5 | 38.2 | 33.1 | 52.7 |
| ProDA [55] | 87.8 | 45.7 | 84.6 | 37.1 | 0.6 | 44.0 | 54.6 | 37.0 | 88.1 | 84.4 | 74.2 | 24.3 | 88.2 | 51.1 | 40.5 | 45.6 |
| CAMDA [59] | 82.5 | 42.2 | 81.3 | - | - | - | 18.3 | 15.9 | 80.6 | 83.5 | 61.4 | 33.2 | 72.9 | 39.3 | 26.6 | 43.9 |
| DPL-Dual [10] | 87.5 | 45.7 | 82.8 | 13.3 | 0.6 | 33.2 | 22.0 | 20.1 | 83.1 | 86.0 | 56.6 | 21.9 | 83.1 | 40.3 | 29.8 | 45.7 |
| BAPA-Net [23] | 91.7 | 53.8 | 83.9 | 22.4 | 0.8 | 34.9 | 30.5 | 42.8 | 86.6 | 88.2 | 66.0 | 34.1 | 86.6 | 51.3 | 29.4 | 50.5 |
| WDA | WDA [30] (Point) | 94.9 | 63.2 | 85.0 | 27.3 | 24.2 | 34.9 | 37.3 | 50.8 | 84.4 | 88.2 | 60.6 | 36.3 | 86.4 | 43.2 | 36.5 | 61.3 |
| SSDA | ASS [48] (+50 city) | 94.1 | 63.9 | 87.6 | - | - | - | 18.1 | 37.1 | 87.5 | 89.7 | 64.6 | 37.0 | 87.4 | 38.6 | 23.2 | 59.6 |
| ADA | MADA [28] (V3+, 5%) | 96.5 | 74.6 | 88.8 | 45.9 | 43.8 | 46.7 | 52.4 | 60.5 | 89.7 | 92.2 | 74.1 | 51.2 | 90.9 | 60.3 | 52.4 | 69.4 |
| RIPU[51] (V3+, 5%) | 97.0 | 78.9 | 89.9 | 47.2 | 50.7 | 48.5 | 55.2 | 63.9 | 91.1 | 93.0 | 74.4 | 54.1 | 92.9 | 79.9 | 55.3 | 71.0 |
| D2ADA (V2, 5%) | 96.4 | 76.3 | 89.1 | 42.5 | 47.7 | 48.0 | 55.6 | 66.5 | 89.5 | 91.7 | 75.1 | 55.2 | 91.4 | 77.0 | 58.0 | 71.8 |
| D2ADA (V3+, 5%) | 96.7 | 76.8 | 90.3 | 48.7 | 51.1 | 54.2 | 58.3 | 68.0 | 90.4 | 93.4 | 77.4 | 56.4 | 92.5 | 77.5 | 58.9 | 73.3 |
| Target Only | DeepLabV2 [6] | 97.4 | 79.5 | 90.3 | 51.1 | 52.4 | 49.0 | 57.5 | 68.0 | 90.5 | 93.1 | 75.1 | 53.9 | 92.7 | 80.2 | 58.1 | 71.1 |
| DeepLabV3+ [8] | 97.6 | 81.3 | 91.1 | 49.8 | 57.6 | 53.8 | 59.6 | 69.1 | 91.2 | 94.4 | 76.7 | 55.6 | 93.3 | 79.9 | 57.7 | 72.2 |
+
+The improvement of our proposed $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ is significant compared to prior active learning strategies. Under $5\%$ labels, $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ surpassed the second-
+
+placed approach by $0.55\mathrm{mIoU}$ in $\mathrm{GTA} \to \mathrm{Cityscapes}$ , whereas the gap between the second and fourth place was only 0.2. Similarly, in SYNTHIA $\rightarrow$ Cityscapes, $\mathbf{D^2ADA}$ outperformed second place by $0.98\mathrm{mIoU}$ , while the difference between the second and fourth place was 0.39. Moreover, our method consistently prevailed over other methods by more than $0.5\mathrm{mIoU}$ under all cases. The results verify our method makes huge progress in active domain adaptation problems.
+
+On the GTA5 $\rightarrow$ Cityscapes, our proposed $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ surpasses uncertainty-based active learning methods (ENT, CONF, and MAR) for over $3\%$ mIoU at the first round. This suggests that density as a selection metric clearly benefits ADA over uncertainty against domain shift in the first few rounds.
+
+Compared with existing ADA methods (AADA, CLUE) or hybrid active learning approaches (ReDAL, BADGE), our method also achieves better performance under any tasks and with any amount of budget. On the two tasks, AADA even performs worse than random selection in the early stage. We conjecture that the selected biased samples might be inconsistent with the real target distribution as shown in Fig.1 (a). As for CLUE, the methods with $5\%$ annotations still performed worse than our method with merely 2.5x fewer labels ( $2\%$ annotations) on the two tasks. We infer the main reason might be that they only considered choosing diverse target domain data but did not avoid the selection that were likely to appear in the source distribution as observed in Fig.1 (b).
+
+# 4.3 Comparison with Domain Adaptation Methods
+
+We compared our $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ with various domain adaptation methods, including unsupervised domain adaptations (UDAs) [10,20,23,26,37,42,43,49,53,55,59,60] weakly-supervised domain adaptation (WDA) [30], semi-supervised domain adaptation (SSDA) [9,48] and active domain adaptations (ADA) [28,36,51,52].
+
+Tab. 1 (a, b) shows the result of GTA5 $\rightarrow$ Cityscapes and SYNTHIA $\rightarrow$ Cityscapes respectively. Compared with the current state-of-the-art UDA method [55], our method achieves an advantage of more than $10\%$ mIoU with only $5\%$ annotation effort. Furthermore, the performance of our method can achieve over $97\%$ of the result of full supervision on target labeled data on both DeepLabV2 and DeepLabV3+ models. On the two tasks, compared with other label-efficient approaches (WDA, SSDA, ADA), our method not only performs better on the overall mIoU score but also gains improvement on small objects, such as "traffic sign (TS)" or "bicycle", and difficult categories, like "fence" and "pole".
+
+Since the labeling budgets used in prior label-efficient methods differ, Fig. 4 makes a fair comparison of these methods. The x-axis indicates the percentage of total target domain annotated points and the y-axis is the corresponding mIoU score achieved by the network. Obviously, our approach achieves higher performance over existing methods with the same number of labeled pixels.
+
+Furthermore, according to statistics, our selected regions contain only 3.1 different categories on average, with $50\%$ regions less than two categories. Thus,
+
+Fig. 4. Comparison with various label-efficient domain adaptation methods. We compare our method with the state-of-the-art UDA method, ProDA [55] as well as various label-efficient approaches, including WDA [30], SSDA [9], ASS [48], MADA [28], LabOR [36] and EADA [52]. On two tasks and networks, our proposed $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ achieves the best result under the same number of labels.
+
+-- DeepLabV2 ——DeepLabV3+ ——D²ADA (V2, Ours) ——D²ADA (V3+, Ours)
+— LabOR ——WDA ——SSDA ——ProDA ——ASS ——EADA (V2) ——MADA (V3+)
+
+
+
+Table 2. Ablation studies. The three columns on the right show the model performance when $1\%$ , $3\%$ , and $5\%$ target annotations are acquired by different active selection strategies. The results validate the effectiveness of our density-aware method, class-balanced selection, and dynamic scheduling policy as the discussion in Sec. 4.4. It also demonstrates uncertainty perform worse with low labeling budgets ( $1\%$ , $3\%$ ).
+
+ | Components | mIoU wrt. labels |
| uncertainty | density aware | class balance | dynamic scheduling | 1% | 3% | 5% |
| (a) | ✓ | | | | 59.97 | 68.79 | 70.70 |
| (b) | | ✓ | | | 62.75 | 68.81 | 69.82 |
| (c) | | ✓ | ✓ | | 64.03 | 69.38 | 70.69 |
| (d) | ✓ | ✓ | ✓ | | 63.30 | 69.66 | 71.15 |
| (e) | ✓ | ✓ | ✓ | ✓ | 64.03 | 69.86 | 71.25 |
+
+compared with prior works selecting scattered pixels [36] or small regions [51], our method, selecting superpixel-level regions, are more friendly for annotators to label (by drawing few polygons) and would require much less labeling effort.
+
+# 4.4 Ablation Studies
+
+We also conduct experiments to validate the effectiveness of all the proposed components with DeepLabV3+ backbone on GTA5 $\rightarrow$ Cityscapes. Extensive experiments about hyper-parameter settings and other in-depth analyses are left in the supplementary material.
+
+Tab. 2 demonstrates the effectiveness of our density-aware selection, class-balanced selection, and dynamic scheduling policy. First, from the comparison of
+
+(a, b), with low budgets (1%, 3%), our density-aware selection solves the defect of uncertainty metrics, echoing our motivations stated in Fig. 2.
+
+Second, as shown in Fig. 5, due to the class-balanced selection, our method queries more labels on minor classes but fewer labels on well-learned classes. Tab. 2 (b, c) also shows our class-balanced selection boosts the performance by over $0.5\mathrm{mIoU}$ in all cases. These results suggest that spending more labeling budgets on hard categories but few budgets on well-aligned ones is effective.
+
+
+Fig. 5. The label distribution of our selected regions. Following [51], we draw histograms to compare the label distribution of the original target domain data (blue) and our $5\%$ selected regions (red). The purple line chart shows the relative changes from the target dataset to our selection. Evidently, our class-balanced selection acquires more labels on minor classes, like 12x more labels on "train", "motor", and "bike".
+
+Third, as shown in Tab. 2 (a, e) and (c, e), given any budget, our dynamic scheduling policy surpasses the density or uncertainty methods alone. Also, the comparison of (d) and (e) validates our policy outperforms the "equally distributed" budget allocation under all situations. The results indicate that our dynamic scheduling strategy can take advantage of the two methods, further improving the labeling efficiency.
+
+# 5 Conclusion
+
+We propose $\mathbf{D}^2\mathbf{A}\mathbf{D}\mathbf{A}$ , a novel active domain adaptation method for semantic segmentation. By labeling samples with high probability density in the target domain yet with low probability density in the source domain, models can conquer the domain shift with limited annotation effort. Furthermore, we design the first dynamic scheduling policy to balance labeling budgets between domain exploration and model uncertainty for the ADA problem.
+
+# Acknowledgement
+
+This work was supported in part by the Ministry of Science and Technology, Taiwan, under Grant MOST 110-2634-F-002-051, Mobile Drive Technology Co., Ltd (MobileDrive), and Industrial Technology Research Institute (ITRI). We are grateful to the National Center for High-performance Computing.
+
+# References
+
+1. Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., Süsstrunk, S.: Slic superpixels compared to state-of-the-art superpixel methods. IEEE transactions on pattern analysis and machine intelligence 34(11), 2274-2282 (2012) 6
+2. Ash, J.T., Zhang, C., Krishnamurthy, A., Langford, J., Agarwal, A.: Deep batch active learning by diverse, uncertain gradient lower bounds. In: ICLR (2020) 2, 5, 10
+3. Casanova, A., Pinheiro, P.O., Rostamzadeh, N., Pal, C.J.: Reinforced active learning for image segmentation. In: International Conference on Learning Representations (2020), https://openreview.net/forum?id=SkgC6TNFvr 6
+4. Chang, W.L., Wang, H.P., Peng, W.H., Chiu, W.C.: All about structure: Adapting structural information across domains for boosting semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1900-1909 (2019) 1, 4
+5. Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K., Yuille, A.L.: Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence 40(4), 834-848 (2017) 1
+6. Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K.P., Yuille, A.L.: Semantic image segmentation with deep convolutional nets and fully connected crfs. CoRR abs/1412.7062 (2015) 1, 10, 11
+7. Chen, L.C., Papandreou, G., Schroff, F., Adam, H.: Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587 (2017) 1
+8. Chen, L.C., Zhu, Y., Papandreou, G., Schroff, F., Adam, H.: Encoder-decoder with atrous separable convolution for semantic image segmentation. In: Proceedings of the European conference on computer vision (ECCV). pp. 801-818 (2018) 1, 10, 11
+9. Chen, S., Jia, X., He, J., Shi, Y., Liu, J.: Semi-supervised domain adaptation based on dual-level domain mixing for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 11018-11027 (2021) 5, 12, 13
+0. Cheng, Y., Wei, F., Bao, J., Chen, D., Wen, F., Zhang, W.: Dual path learning for domain adaptation of semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9082-9091 (2021) 1, 11, 12
+1. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3213-3223 (2016) 2, 9
+2. Du, L., Tan, J., Yang, H., Feng, J., Xue, X., Zheng, Q., Ye, X., Zhang, X.: Ssf-dan: Separated semantic feature based domain adaptation network for semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 982-991 (2019) 1, 4
+3. Fu, B., Cao, Z., Wang, J., Long, M.: Transferable query selection for active domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 7272-7281 (2021) 2, 5
+4. Gal, Y., Ghahramani, Z.: Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In: international conference on machine learning. pp. 1050-1059 (2016) 2, 5
+
+15. Gal, Y., Islam, R., Ghahramani, Z.: Deep bayesian active learning with image data. In: International Conference on Machine Learning. pp. 1183-1192 (2017) 5
+16. Hastie, T., Tibshirani, R., Friedman, J.H., Friedman, J.H.: The elements of statistical learning: data mining, inference, and prediction, vol. 2. Springer (2009) 7
+17. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016) 10
+18. Hershey, J.R., Olsen, P.A.: Approximating the kullback leibler divergence between gaussian mixture models. In: 2007 IEEE International Conference on Acoustics, Speech and Signal Processing-ICASSP'07. vol. 4, pp. IV-317. IEEE (2007) 8
+19. Kasarla, T., Nagendar, G., Hegde, G.M., Balasubramanian, V., Jawahar, C.: Region-based active learning for efficient labeling in semantic segmentation. In: 2019 IEEE Winter Conference on Applications of Computer Vision (WACV). pp. 1109-1117. IEEE (2019) 6
+20. Kim, M., Byun, H.: Learning texture invariant representation for domain adaptation of semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12975-12984 (2020) 1, 11, 12
+21. Kirsch, A., van Amersfoort, J., Gal, Y.: Batchbald: Efficient and diverse batch acquisition for deep bayesian active learning. In: Advances in Neural Information Processing Systems. pp. 7026-7037 (2019) 2, 5
+22. Lin, G., Milan, A., Shen, C., Reid, I.: Refinenet: Multi-path refinement networks for high-resolution semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1925-1934 (2017) 1
+23. Liu, Y., Deng, J., Gao, X., Li, W., Duan, L.: Bapa-net: Boundary adaptation and prototype alignment for cross-domain semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 8801-8811 (2021) 1, 11, 12
+24. Luo, Y., Zheng, L., Guan, T., Yu, J., Yang, Y.: Taking a closer look at domain shift: Category-level adversaries for semantics consistent domain adaptation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2507-2516 (2019) 1, 4
+25. Mackowiak, R., Lenz, P., Ghori, O., Diego, F., Lange, O., Rother, C.: CEREALS - cost-effective region-based active learning for semantic segmentation. In: British Machine Vision Conference 2018, BMVC 2018, Newcastle, UK, September 3-6, 2018. p. 121. BMVA Press (2018), http://bmvc2018.org/content/papers/0437.pdf 6
+26. Mei, K., Zhu, C., Zou, J., Zhang, S.: Instance adaptive self-training for unsupervised domain adaptation. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXVI 16. pp. 415-430. Springer (2020) 1, 11, 12
+27. Nguyen, A.T., Tran, T., Gal, Y., Torr, P., Baydin, A.G.: KL guided domain adaptation. In: International Conference on Learning Representations (2022), https://openreview.net/forum?id=OJzqUlIVVdd 7
+28. Ning, M., Lu, D., Wei, D., Bian, C., Yuan, C., Yu, S., Ma, K., Zheng, Y.: Multi-anchor active domain adaptation for semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9112–9122 (2021) 2, 4, 5, 11, 12, 13
+29. Ovadia, Y., Fertig, E., Ren, J., Nado, Z., Sculley, D., Nowozin, S., Dillon, J., Lakshminarayanan, B., Snoek, J.: Can you trust your model's uncertainty? evaluating
+
+predictive uncertainty under dataset shift. Advances in neural information processing systems 32 (2019) 2
+30. Paul, S., Tsai, Y.H., Schulter, S., Roy-Chowdhury, A.K., Chandraker, M.: Domain adaptive semantic segmentation using weak labels. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part IX 16. pp. 571-587. Springer (2020) 4, 11, 12, 13
+31. Prabhu, V., Chandrasekaran, A., Saenko, K., Hoffman, J.: Active domain adaptation via clustering uncertainty-weighted embeddings. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 8505-8514 (2021) 2, 5, 10
+32. Richter, S.R., Vineet, V., Roth, S., Koltun, V.: Playing for data: Ground truth from computer games. In: European conference on computer vision. pp. 102-118. Springer (2016) 2, 9
+33. Ros, G., Sellart, L., Materzynska, J., Vazquez, D., Lopez, A.M.: The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3234-3243 (2016) 9
+34. Roth, D., Small, K.: Margin-based active learning for structured output spaces. In: European Conference on Machine Learning. pp. 413-424. Springer (2006) 2
+35. Sener, O., Savarese, S.: Active learning for convolutional neural networks: A core-set approach. In: International Conference on Learning Representations (2018), https://openreview.net/forum?id=H1aIuk-RW 2, 5
+36. Shin, I., Kim, D.J., Cho, J.W., Woo, S., Park, K., Kweon, I.S.: Labor: Labeling only if required for domain adaptive semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 8588-8598 (2021) 2, 5, 11, 12, 13
+37. Shin, I., Woo, S., Pan, F., Kweon, I.S.: Two-phase pseudo label densification for self-training based domain adaptation. In: European conference on computer vision. pp. 532-548. Springer (2020) 1, 11, 12
+38. Siddiqui, Y., Valentin, J., Nießner, M.: Viewal: Active learning with viewpoint entropy for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 9433-9443 (2020) 2, 6
+39. Singh, A., Doraiswamy, N., Takamuku, S., Bhalerao, M., Dutta, T., Biswas, S., Chepuri, A., Vengatesan, B., Natori, N.: Improving semi-supervised domain adaptation using effective target selection and semantics. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2709-2718 (2021) 2, 5
+40. Su, J.C., Tsai, Y.H., Sohn, K., Liu, B., Maji, S., Chandraker, M.: Active adversarial domain adaptation. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 739-748 (2020) 2, 5, 10
+41. Sun, K., Xiao, B., Liu, D., Wang, J.: Deep high-resolution representation learning for human pose estimation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5693-5703 (2019) 1
+42. Tsai, Y.H., Hung, W.C., Schulter, S., Sohn, K., Yang, M.H., Chandraker, M.: Learning to adapt structured output space for semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 7472-7481 (2018) 1, 4, 10, 11, 12
+43. Vu, T.H., Jain, H., Bucher, M., Cord, M., Pérez, P.: Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2517-2526 (2019) 1, 4, 11, 12
+
+44. Wang, D., Shang, Y.: A new active labeling method for deep learning. In: 2014 International Joint Conference on Neural Networks (IJCNN). pp. 112-119 (2014). https://doi.org/10.1109/IJCNN.2014.6889457 2, 5, 9, 10
+45. Wang, J., Sun, K., Cheng, T., Jiang, B., Deng, C., Zhao, Y., Liu, D., Mu, Y., Tan, M., Wang, X., et al.: Deep high-resolution representation learning for visual recognition. IEEE transactions on pattern analysis and machine intelligence (2020) 1
+46. Wang, K., Zhang, D., Li, Y., Zhang, R., Lin, L.: Cost-effective active learning for deep image classification. IEEE Transactions on Circuits and Systems for Video Technology 27(12), 2591-2600 (2016) 2, 5
+47. Wang, Y., Peng, J., Zhang, Z.: Uncertainty-aware pseudo label refinery for domain adaptive semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 9092-9101 (2021) 4
+48. Wang, Z., Wei, Y., Feris, R., Xiong, J., Hwu, W.M., Huang, T.S., Shi, H.: Alleviating semantic-level shift: A semi-supervised domain adaptation method for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. pp. 936-937 (2020) 5, 11, 12, 13
+49. Wang, Z., Yu, M., Wei, Y., Feris, R., Xiong, J., Hwu, W.m., Huang, T.S., Shi, H.: Differential treatment for stuff and things: A simple unsupervised domain adaptation method for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12635-12644 (2020) 11, 12
+50. Wu, T.H., Liu, Y.C., Huang, Y.K., Lee, H.Y., Su, H.T., Huang, P.C., Hsu, W.H.: Redal: Region-based and diversity-aware active learning for point cloud semantic segmentation. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 15510-15519 (2021) 2, 5, 10
+51. Xie, B., Yuan, L., Li, S., Liu, C.H., Cheng, X.: Towards fewer annotations: Active learning via region impurity and prediction uncertainty for domain adaptive semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 8068-8078 (2022) 5, 11, 12, 13, 14
+52. Xie, B., Yuan, L., Li, S., Liu, C.H., Cheng, X., Wang, G.: Active learning for domain adaptation: An energy-based approach. In: Thirty-Sixth AAAI Conference on Artificial Intelligence (AAAI-22) (2022) 5, 12, 13
+53. Yang, Y., Soatto, S.: Fda: Fourier domain adaptation for semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 4085-4095 (2020) 1, 11, 12
+54. Yuan, Y., Chen, X., Chen, X., Wang, J.: Segmentation transformer: Object-contextual representations for semantic segmentation. In: European Conference on Computer Vision (ECCV). vol. 1 (2021) 1
+55. Zhang, P., Zhang, B., Zhang, T., Chen, D., Wang, Y., Wen, F.: Prototypical pseudo label denoising and target structure learning for domain adaptive semantic segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12414-12424 (2021) 1, 2, 4, 11, 12, 13
+56. Zhao, H., Shi, J., Qi, X., Wang, X., Jia, J.: Pyramid scene parsing network. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 2881-2890 (2017) 1
+57. Zheng, Z., Yang, Y.: Rectifying pseudo label learning via uncertainty estimation for domain adaptive semantic segmentation. International Journal of Computer Vision 129(4), 1106-1120 (2021) 4
+
+58. Zhou, F., Shui, C., Yang, S., Huang, B., Wang, B., Chaib-draa, B.: Discriminative active learning for domain adaptation. Knowledge-Based Systems 222, 106986 (2021) 2, 5
+59. Zhou, Q., Feng, Z., Gu, Q., Pang, J., Cheng, G., Lu, X., Shi, J., Ma, L.: Context-aware mixup for domain adaptive semantic segmentation. arXiv preprint arXiv:2108.03557 (2021) 1, 4, 11, 12
+60. Zou, Y., Yu, Z., Kumar, B., Wang, J.: Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In: Proceedings of the European conference on computer vision (ECCV). pp. 289-305 (2018) 1, 4, 11, 12
+61. Zou, Y., Yu, Z., Liu, X., Kumar, B., Wang, J.: Confidence regularized self-training. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 5982-5991 (2019) 1, 4, 11
\ No newline at end of file
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/images.zip b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..bdffccb89b54c92fddad793f18e2a371a680192a
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6dfe2c2e6d3f12e5de23521baa21bb5a73c48237067fc69e0496ebf7a2561ec
+size 501017
diff --git a/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/layout.json b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0de21804cd214f5cb085f9a0b418e147d3616829
--- /dev/null
+++ b/d2adadynamicdensityawareactivedomainadaptationforsemanticsegmentation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:013e2b01b6bad32915e0a318b82db6dfb6cae90b0618279ef999a58d17483688
+size 486995
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_content_list.json b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c21365c871acd0cb582f6e05705b6e79522667a3
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:afecb6729aff0727b65c0cd1817aef9806a62e569954484b4776d7379b8112f6
+size 73824
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_model.json b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..94e40955655148370349754def8cd193c198b7dd
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:657a9711d92a2f9076b9ea681ca2ee1167493f9950e11cb0b43e6c43c82f70f9
+size 90533
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_origin.pdf b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d70a7a4c394edc19e08e555443cc7b55875a089b
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/6090b6fc-35a9-48ea-99b0-9db49835a8a7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:757a376361acd6f8203ed7923d031afbf77c92428efa9768c66c19e57776af6c
+size 7169491
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/full.md b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..9d0690e02720a70314680e2c77f770db04444682
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/full.md
@@ -0,0 +1,312 @@
+# D2C-SR: A Divergence to Convergence Approach for Real-World Image Super-Resolution
+
+Youwei Li $^{1}$ Haibin Huang $^{2}$ Lanpeng Jia $^{3}$ Haoqiang Fan $^{1}$ Shuaicheng Liu $^{4,1,\dagger}$
+
+1 Megvii Technology, Beijing, China 2 Kuaishou Technology, Beijing, China 3 Great Wall Motor Company Limited, Baoding, China
+
+4 University of Electronic Science and Technology of China, Chengdu, China {liyouwei, fhq}@megvii.com jialanpeng@gwm.cn jackiehuanghaibin@gmail.com liushuaicheng@uestc.edu.cn
+
+†Corresponding Author
+
+Abstract. In this paper, we present D2C-SR, a novel framework for the task of real-world image super-resolution. As an ill-posed problem, the key challenge in super-resolution related tasks is there can be multiple predictions for a given low-resolution input. Most classical deep learning based approaches ignored the fundamental fact and lack explicit modeling of the underlying high-frequency distribution which leads to blurred results. Recently, some methods of GAN-based or learning super-resolution space can generate simulated textures but do not promise the accuracy of the textures which have low quantitative performance. Rethinking both, we learn the distribution of underlying high-frequency details in a discrete form and propose a two-stage pipeline: divergence stage to convergence stage. At divergence stage, we propose a tree-based structure deep network as our divergence backbone. Divergence loss is proposed to encourage the generated results from the tree-based network to diverge into possible high-frequency representations, which is our way of discretely modeling the underlying high-frequency distribution. At convergence stage, we assign spatial weights to fuse these divergent predictions to obtain the final output with more accurate details. Our approach provides a convenient end-to-end manner to inference. We conduct evaluations on several real-world benchmarks, including a new proposed D2CRealSR dataset with x8 scaling factor. Our experiments demonstrate that D2C-SR achieves better accuracy and visual improvements against state-of-the-art methods, with a significantly less parameters number and our D2C structure can also be applied as a generalized structure to some other methods to obtain improvement. Our codes and dataset are available at https://github.com/megvii-research/D2C-SR.
+
+# 1 Introduction
+
+Super-resolution (SR) is one of the fundamental problems in computer vision with its applications for several important image processing tasks. Despite decades of development in SR technologies, it remains challenging to recover high-quality and accurate details from low-resolution (LR) inputs due to its ill-posed nature.
+
+In fact, given a LR image, there exist infinitely possible high-resolution (HR) predictions by adding different high-frequency information. This is the key challenge for the design of learning-based SR methods. Recently, deep neural network (DNN) based methods [13, 15, 19, 20, 32] have achieved tremendous success and outperformed most classical methods based on sparse coding [6, 30] or local liner regression [23, 29]. However, these early deep learning methods only rely on $L_{1}$ or $L_{2}$ reconstruction loss, which have a relatively high quantitative performance but can not reproduce rich texture details due to ill-posed nature. Later on, conditional GAN-based methods [7] are adapted into SR tasks, which provide methods for learning the distribution in a data-driven way and led to generate richer simulated textures. However, these methods still suffered from mode collapse and tend to generate implausible or inaccurate texture details. Thus, the quantitative performance of GAN-based methods are not satisfactory. After realizing the importance of modeling the underlying high-frequency distribution explicitly, some methods of learning SR space appear. SRFlow [14] introduced a normalizing flow-based method which tried to address the mode collapse problem and make a continuous Gaussian distribution to model all the high-frequency. Therefore, although SRFlow can sample to get a certain prediction, it does not promise the most accurate prediction. Furthermore, when adapting more complicated distribution, like large amount of real-world scenes, it would significantly increase the hardness of convergence during training. Some works [11, 16, 24, 28] introduced ensemble-based SR approaches that trained a same network from different initialization or different down-sampling methods and merged the outputs into the SR results. Due to the lack of explicit modeling of the SR space, the different results produced by these methods are very dependent on the randomness of the initialization or artificially rules, and are therefore unstable and has a risk of degradation. In other words, they lack an explicit and stable way to make the results divergent. However, these works still give us meaningful inspiration. In this paper, some discussions are made based on this.
+
+In this paper, we present D2C-SR, a novel divergence to convergence framework for real-world SR, by rethinking the ill-posed problem and the SR space approaches. D2C-SR follows the idea of explicitly learning the underlying distribution of high-frequency details. But unlike conditional GAN-based methods or SRFlow [14], our D2C-SR model the high-frequency details distribution using a discrete manner. Our key insight is that: most classical SR methods use a single output to fit all high-frequency details directly and 'regression to mean', therefore only obtains average and blurred outputs. While SRFlow [14] uses an continuous Gaussian distribution to fit all high-frequency details, but the fit is very difficult and does not guarantee stable and accurate high-frequency details. The GAN-based approaches have the same problem. Therefore, we adopt a trade-off approach by using a finite discrete distribution to fit the high-frequency details, thus ensuring a stable, controllable and accurate output relatively.
+
+Specifically, at divergence stage, we first propose a tree-based structure network, where end branches are designed to learn random possible high-frequency details separately. To stabilize the divergence process, we also propose the diver
+
+gence loss which can explicitly allows for divergence of the results produced by different branches. Meanwhile, we use the construction loss to ensure consistency with HR during the entire process. Due to there are multiple local minima in the network optimization process, we expect different branches to have access to different local minima through the appropriate strength of these restraints. Theoretically, if there are multiple branches and fit to the full range of high-frequency possibilities, the best HR image should be the fusion of the high-frequency details exactly. Hence, at convergence stage, we assign spatial weights to combine the divergent predictions to produce a more accurate result.
+
+To fully evaluate the efficiency and generality of D2C-SR for real-world SISR, we conduct experiments on several benchmarks, including RealSR [4], DRealSR [27] and our new benchmark, D2CRealSR, with x8 upscaling factor. Experimental results show that our D2C-SR can achieve state-of-the-art performance and visual improvements with less parameters. In sum, the main contributions are as follows:
+
+- We present D2C-SR, a novel framework with divergence and convergence stage for real-world SR. D2C-SR explicitly model the underlying distribution of high-frequency details in a discrete manner and provide a convenient end-to-end inference. For stable divergence, we also propose the divergence loss to generate multiple results with divergent high-frequency representations.
+- A new real-world SR benchmark (D2CRealSR), which has a larger scaling factor (x8) compared to existing real-world SR benchmarks.
+- D2C-SR sets up new state-of-the-art performance on many popular real-world SR benchmarks, including our new proposed D2CRealSR benchmark and, it can provide compatible performance with significantly less parameter number.
+- Our D2C structure can also be applied as a generalized structure to some other methods to obtain improvement.
+
+# 2 Related Work
+
+# 2.1 DNN-based SISR
+
+Single Image Super-Resolution (SISR) is a long standing research topic due to its importance and ill-posed nature. Traditional learning-based methods adopts sparse coding [6, 21, 30] or local linear regression [22, 23, 29]. Deep learning (DL)-based methods have achieved dramatic advantages against conventional methods for SISR [1, 26]. It is first proposed by SRCNN [19] that employs a relatively shallow network and adopts the bicubic degradation for HR and LR pairs. Following which, various SISR approaches have been proposed, such as VDSR that adopts very deep network [19]; EDSR that modifies the ResNet for enhancement [13]; ESPCN that uses efficient sub-pixel CNN [18]; CDC that divides images into multiple regions [27], and VGG loss [19], GAN loss [7] that improve the perceptual visual quality [12, 17, 25]. Ensemble-based methods [11, 16, 24, 28] train a same network from different initialization or different training pair generation but it lacks explicit modeling of SR space. In this work, we propose a tree-based network structure, for the purpose of multi-mode learning.
+
+
+Fig. 1: Difference between our method and the classical methods in handling ill-posed problems. Blue and red dots in the box indicate possible HR texture details and the ideal details for a settled LR region. Classical methods only find the single average prediction. Our method can produce multiple divergent predictions at divergence stage and fuse to obtain more accurate predictions at convergence stage.
+
+# 2.2 Learning Super-Resolution Space
+
+Single image super-resolution is ill-posed, where infinitely many high-resolution images can be downsampled to the same low-resolution images. Therefore learning a deterministic mapping may not be optimal. The problem can be converted to stochastic mapping, where multiple plausible high-resolution images are predicted given a single low-resolution input [2]. DeepSEE incorporates semantic maps for explorative facial super-resolution [3]. SRFlow adopts normalizing flow to learn the high-frequency distribution of facial datasets by using an continuous Gaussian distribution [14]. Unlike this, our method model the high-frequency distribution using a discrete manner. Thus the prediction of our method has better texture consistency with HR and the details are more accurate.
+
+# 2.3 Real-World Super-Resolution and Datasets
+
+Bicubic downsampling datasets are widely used but the gap between the simulation and the real degradation limits the performance in the real-world application [8]. Therefore, some works explore degradation of real scenarios by collecting real-world datasets, e.g., City100 [5], RealSR [4], SR-RAW [31] and DRealSR [27]. We propose the D2CRealSR dataset with larger scaling factor (x8) compared to the above datasets. Real-world degradation loses more details compared to simulated degradation [5], and the reduction of the prior makes recovery more difficult. Our method can handle these problems better than others.
+
+# 3 Method
+
+# 3.1 Overview
+
+As shown in Fig. 2, D2C-SR consists of two sub-networks: a divergence network to learn the possible predictions and a convergence network to fuse the predictions to
+
+
+(a) Divergence
+
+
+(c) Divergence Loss
+Fig. 2: Two stages in D2C architecture: (a) Divergence stage, (b) Convergence stage. Divergence network with tree-based structure outputs multi-predictions $I_{D}^{i}$ with different high-frequency recovery. Convergence network obtains more accurate result by weighted combining divergence results. (c) Divergence loss.
+
+final result. In this section, we first describe divergence network in Sec. 3.2. Then, we introduce convergence network in Sec. 3.3. The network training strategy are described in Sec. 3.4. To facilitate the explanation, we also present in Fig. 1.
+
+# 3.2 Divergence Network
+
+Divergence network produce multiple divergent predictions to address the ill-posed nature. We built a tree-based structure network to get the desired predictions. There are four main modules in the divergence network: shallow feature extraction, basic branch module, multi-branch deep residual structure and upscale module. We define the depth of the tree network is $L$ , and each branch has $C$ sub-branches. Each branch and its sub-branches are composed of a basic branch module and non-weight shared. Further, the basic branch module contains $G$ residual groups, and each residual group contains $B$ residual channel attention blocks, which refer to RCAN [32]. The divergence network first extracts the shallow features from the input LR image by the shallow feature extraction module, which is a simple Conv layer. Then, the input features are each fed into their own branch and sub-branches modules. The feature outputs of the end branches go through the multi-branch deep residual structure, then upscaled by the upscale module. So far, the divergence network generate $P$ divergent predictions. These predictions are expressed as $I_{D} = \mathcal{F}(I_{LR};\Theta_{D})$ , where $\Theta_{D}$ is the divergence network parameter and $I_{LR}$ is the LR image. $I_{D}^{i}$ denotes $i$ -th prediction of divergence network.
+
+Multi-branch Deep Residual Structure. We construct relatively deeper residuals and apply residuals structure to all branches of our tree-based divergence network. In addition to the residuals within the residual group and the residuals from the input features to the end branches, we also add the residuals from intermediate branches to their own sub-branches as shown in Fig. 2. Residual learning address the problem of long-term memory in deep SR network. Therefore, inspired by previous works [10, 12, 32], we utilize multi-branch deep residual
+
+structure to achieve more performance gain. We validate the effect of deep residual structure in Sec. 4.5.
+
+Divergence loss. Divergence loss used in divergence network, which composed of $L_{2}$ loss and modified triplet loss. The $L_{2}$ loss can be defined as
+
+$$
+L _ {2} ^ {D} = \sum_ {i = 1} ^ {P} \left\| I _ {D} ^ {i} - I _ {H R} \right\| _ {2}. \tag {1}
+$$
+
+It is worth noting that we used $L_{2}$ loss on all branches separately instead of just averaging them out with an overall $L_{2}$ loss. Because it allows for a more independent divergence of each branch, which is beneficial for the divergence stage. In order to make the divergence network produce divergence results more stable, we adopt triplet loss between all pairs of different predictions from divergence network. Our goal is to make the distance between $I_{D}^{i}$ and HR close and the distance between different members within $I_{D}$ farther. However, using triplet loss directly on RGB images causes the network to focus more on other differentiated directions (e.g., RGB space and luminance) than texture features. Therefore, we perform a series of processes on the triplet inputs shown in Fig. 2. Firstly, we process $I_{D}^{i}$ by $G(\cdot)$ :
+
+$$
+G (I _ {D} ^ {i}) = \frac {Y _ {D} ^ {i} - \mu_ {Y _ {D} ^ {i}}}{\sigma_ {Y _ {D} ^ {i}}}, \tag {2}
+$$
+
+where $Y_{D}^{i}$ is Y channel of $I_{D}^{i}$ in YCbCr space, $\mu_{Y_D^i}$ and $\sigma_{Y_D^i}$ are mean and standard deviation of $Y_{D}^{i}$ respectively. $G(\cdot)$ operation enables network to focus more on the differentiation of texture space rather than color and luminance space. Secondly, the triplet inputs are converted to the residual domain where texture differences can be better represented. We express the residual of $I_{D}^{i}$ as
+
+$$
+r e s _ {I _ {D} ^ {i}} = \left| G (I _ {D} ^ {i}) - G (I _ {H R}) \right|, \tag {3}
+$$
+
+where $|\cdot|$ is absolute value function. The pixel value of the residual images can oscillate between positive and negative, and absolute value function can reduce the checkerboard phenomenon caused by triplet loss as shown in Fig 6. Overall, the formula for triplet loss is
+
+$$
+\operatorname {t r i p} (a, p, n) = \operatorname {M a x} [ d (a, p) - d (a, n) + \operatorname {m a r g i n}, 0 ], \tag {4}
+$$
+
+where $a$ , $p$ and $n$ are anchor, positive and negative, respectively. Therefore, we can represent our final triplet loss as
+
+$$
+T _ {D} = \frac {\sum_ {i = 1} ^ {P} \sum_ {j = 1 , j \neq i} ^ {P} \beta_ {i j} * t r i p \left(r e s _ {I _ {D} ^ {i}} , z e r o , r e s _ {I _ {D} ^ {j}}\right)}{\left(P (P - 1)\right)}, \tag {5}
+$$
+
+where zero is zero map and it is the positive in residual domain. $\beta$ is a attenuation coefficient which can be described as
+
+$$
+\beta_ {i j} = \theta^ {l - 1}, l \in [ 1, L ], \tag {6}
+$$
+
+where $\theta$ is parameter and $\theta \in (0,1]$ . The $l$ is index of the tree depths where the common parent branch of $I_D^i$ and $I_D^j$ is located. We use $\beta$ because that in a tree structure, differentiation should be progressive, i.e., branches with closer relatives should have relatively smaller degrees of divergence. Finally, our divergence loss is described as
+
+$$
+L _ {D} = L _ {2} ^ {D} + \alpha * T _ {D}, \tag {7}
+$$
+
+where $\alpha$ is weight hyperparameter of $T_{D}$ . Some detailed parameter settings will be introduced in Sec. 4.1.
+
+# 3.3 Convergence Network
+
+Combining the divergence results generated by the divergence network can produce more accurate results. We think that different areas on the predictions have different contribution weights for the final result. So we construct convergence network to merge divergent predictions weighted pixel-by-pixel, which can generate the result closer to the real HR image. Convergence network concatenates all the $P$ predictions of the divergence network and outputs weight map for each prediction $I_D^i$ . Weight maps can be expressed as $W = F(Concat(I_D); \Theta_C)$ where $\Theta_C$ is the convergence network model parameter. We denote $W_i$ as the weight map of $I_D^i$ . Every $I_D^i$ are element-wise multiplied by respective weight map $W_i$ , and then all of the results are summed to produce the final SR result. Accordingly, SR result can be defined as
+
+$$
+I _ {S R} = \sum_ {i = 1} ^ {P} \left(I _ {D} ^ {i} \cdot W _ {i}\right), \tag {8}
+$$
+
+where $I_{SR}$ represents final SR result.
+
+Convergence loss. The goal of convergence network is to merge $I_D^i$ from divergence network. Therefore, loss function of convergence network is called convergence loss, which only consists of $L_2$ loss. We denote convergence loss as $L_2^C$ , which can be expressed as
+
+$$
+L _ {2} ^ {C} = \left\| I _ {S R} - I _ {H R} \right\| _ {2}. \tag {9}
+$$
+
+How to generate $I_{SR}$ has been introduced in Eq. 8. The goal of convergence loss is to make the generated SR image get closer to the ground-truth HR image.
+
+# 3.4 Training Strategy
+
+The two networks in our framework are trained separately. We firstly train the divergence network into a stable status where it can generate super-resolution divergence predictions. We then freeze the parameters of divergence network and train the convergence network by enabling the whole pipeline. More details will be discussed in Sec. 4.1.
+
+Table 1: Performance comparison on RealSR [4], DRealSR [27] and our proposed D2CRealSR datasets. The best results are highlighted. $-$ indicates either the available model is not supported for such a test, or not open-sourced.
+
+| Method | RealSR | DRealSR (train on RealSR) | D2CRealSR |
| x2 | x3 | x4 | x2 | x3 | x4 | x8 |
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM |
| Bicubic | 31.67 | 0.887 | 28.61 | 0.810 | 27.24 | 0.764 | 32.67 | 0.877 | 31.50 | 0.835 | 30.56 | 0.820 |
| DRCN [11] | 33.42 | 0.912 | 30.36 | 0.848 | 28.56 | 0.798 | 32.46 | 0.873 | 31.58 | 0.838 | 30.14 | 0.816 |
| SRResNet [12] | 33.17 | 0.918 | 30.65 | 0.862 | 28.99 | 0.825 | 32.85 | 0.890 | 31.25 | 0.841 | 29.98 | 0.822 |
| EDSR [13] | 33.88 | 0.920 | 30.86 | 0.867 | 29.09 | 0.827 | 32.86 | 0.891 | 31.20 | 0.843 | 30.21 | 0.817 |
| RCAN [32] | 33.83 | 0.923 | 30.90 | 0.864 | 29.21 | 0.824 | 32.93 | 0.889 | 31.76 | 0.847 | 30.37 | 0.825 |
| ESRGAN [25] | 33.80 | 0.922 | 30.72 | 0.866 | 29.15 | 0.826 | 32.70 | 0.889 | 31.25 | 0.842 | 30.18 | 0.821 |
| SR-Flow [14] | - | - | - | - | 24.20 | 0.710 | - | - | - | 24.97 | 0.730 | 23.11 |
| LP-KPN [4] | 33.49 | 0.917 | 30.60 | 0.865 | 29.05 | 0.834 | 32.77 | - | 31.79 | - | 30.75 | - |
| CDC [27] | 33.96 | 0.925 | 30.99 | 0.869 | 29.24 | 0.827 | 32.80 | 0.888 | 31.65 | 0.847 | 30.41 | 0.827 |
| D2C-SR(Ours) | 34.40 | 0.926 | 31.33 | 0.871 | 29.72 | 0.831 | 33.42 | 0.892 | 31.80 | 0.847 | 30.80 | 0.825 |
+
+# 4 Experiment
+
+# 4.1 Dataset and Implementation Details
+
+D2CRealSR. Existing RealSR datasets generally include x2, x3 and x4 scaling factor only, but lack of larger scaling factor. We collect a new dataset on x8 scaling factor, which called D2CRealSR. We construct the LR and HR pairs by zooming the lens of DSLR cameras. D2CRealSR consists of 115 image pairs and 15 image pairs are selected randomly for testing set; the rest pairs construct the training set. We use SIFT method to register the image pairs iterative: we first register the image pairs roughly and crop the main central area, then we align the brightness of the central area of image pairs and register them once again. After, we crop off the edges of aligned image pairs. The image size of each pair is $3,456 \times 2,304$ after the alignment process.
+
+Existing datasets. We also conduct experiments on existing real-world SR datasets: RealSR and DRealSR. RealSR has 559 scenes captured from DSLR cameras and align the image pairs strictly. 459 scenes for training and 100 scenes for testing. The image sizes of RealSR image pairs are in the range of $700\sim 3000$ and $600\sim 3500$ . DRealSR has 83, 84 and 93 image pairs in testing set, 884, 783 and 840 image pairs in training set for x2, x3, x4 scaling factors, respectively. Note that we found some of the image pairs in DRealSR are misaligned, which is caused by the depth of field. So we only validate our results on testing set of DRealSR to show the performance of the cross-dataset of our method.
+
+Implementation details. In the experiment, we set the number of branch layers as $L = 2$ , the number of child branches $C = 2$ . The basic branch module includes $G = 2$ residual groups and $B = 4$ residual blocks in each group. We use Adam optimizer and set exponential decay rates as 0.9 and 0.999. The initial learning
+
+rate is set to $10^{-4}$ and then reduced to half every $2k$ epochs. For each training batch, we randomly extract 4 LR image patches with the size of $96 \times 96$ . We implement D2C-SR method with the Pytorch framework and train the network using NVIDIA 2080Ti GPU.
+
+# 4.2 Comparisons with Existing Methods
+
+To evaluate our method, we train and test our model on our D2CRealSR with scaling factor x8 and an existing real-world SR dataset, RealSR with scaling factor x4, x3, x2. In addition, we validate on DRealSR testing set for performance of cross-dataset. We compare our model with other state-of-the-art SISR methods, including DRCN [11], SRResNet [12], EDSR [13], RCAN [32], ESRGAN [25], LP-KPN [4] and CDC [27]. The SISR results were evaluated on the Y channel in the YCbCr space using PSNR and SSIM. Among these SR methods, EDSR and RCAN are the classic SISR methods and DRCN is the open-source ensemble-based method. In addition, LP-KPN and CDC are designed to solve the real-world SR problem and they outperform on real-world SR benchmarks.
+
+Quantitative comparison. The evaluation results of the SR methods, including our model and the other 8 methods are demonstrated in Table 1. The best results are highlighted and our method are $0.48dB$ higher than the second ranked CDC method on x4 RealSR. Our model outperforms by a large margin on all the benchmarks and achieve state-of-the-art performance.
+
+Qualitative comparison. Visualization results of SR methods and ours on RealSR and D2CRealSR datasets are shown in Fig. 3 and Fig. 4. It is observed that existing SR methods (e.g., RCAN, LP-KPN, CDC) tend to restore the details to be thicker, blurry, or unnatural. Meanwhile, in Canon-041, Nikon-050 and Sony-101, our method recovered sharper and more accurate edge textures. In Nikon-024, we recover more information on the letters. From the visual comparisons, our method has the ability to recover richer and more accurate details.
+
+Visualization of D2C processes. To further represent the progress of the D2C-SR, we visualize and compare the LR image, HR image, divergence intermediate results, and final results as well as the results of other comparison methods in Fig. 5. Classical SR methods directly use a single prediction to fit the distribution of all high-frequency details, thus obtain blurred outputs due to the ill-posed nature. Our two-stage approach explicitly learns the distribution of high-frequency details using a discrete manner, thus we can get rich and accurate texture details.
+
+Comparison in perceptual metric. In recent years, the perceptual metric becomes another dimension to evaluate the image quality, and we also conduct a comparison on the perceptual metric in Table 2. Based on Sec. 3, we add vgg loss to train our model [12] to obtain a balance of multiple metrics. Experiments
+
+
+Fig. 3: Comparison for x4 SR on RealSR [4] dataset.
+
+demonstrate that our method can achieve better performance on several evaluation measures, including the perceptual metric.
+
+# 4.3 Applying the D2C Structure to Other Methods
+
+In Table 3, we apply the D2C structure to other methods and compare the performance with the original method. To make a fair comparison and reduce the influences caused by different sizes of parameters, we reduce the number of feature channels or the basic modules such that the number of parameters of the D2C counterpart model is smaller than the original model. Our results show that multiple methods can achieve better performance with fewer number of parameters by applying the D2C structure.
+
+
+Sony_101 (x8)
+
+
+SRResNet
+
+
+EDSR
+
+
+ESRGAN
+
+
+CDC
+
+
+SRFlow
+
+
+RCAN
+
+
+Ours
+
+
+HR
+
+
+Fig. 4: Comparison for x8 SR on our captured D2CRealSR dataset.
+Fig. 5: Visualization of D2C processes and other methods (x4).
+
+# 4.4 Model Size Analyses
+
+We show comparisons about model size and performance in Fig. 7. We list six sizes of models: 5.88M, 4.53M, 3.63M, 0.91M, 0.23M and 0.19M. These models are constructed by changing the number of residual groups $G$ and the number of residual block $B$ . Our 0.23M model can achieve a better effect than other methods. At this PSNR level, CDC uses 39.92M, and RCAN also uses 15M parameters. Our baseline model chieve higher performance using 5.88M parameters only. Our method have a better trade-off between model size and performance.
+
+
+(a) Without ABS
+
+
+(b) With ABS
+
+Table 4: Effect study on the width and depth of the tree-based network (x4).
+
+ | 1 | 2 | 3 | 4 |
| Width (C) | 29.41 | 29.54 | 29.56 | 29.58 |
| Depth (L) | 29.30 | 29.54 | 29.63 | 29.64 |
+
+
+Fig. 6: Absolute value function (ABS) reduces the checkerboard phenomenon.
+Fig. 7: Performance vs. parameters.
+
+Table 2: Performance comparison in LPIPS on RealSR.
+
+| Method | x2 | x3 | x4 |
| PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS |
| Bicubic | 31.67 | 0.887 | 0.223 | 28.61 | 0.810 | 0.389 | 27.24 | 0.764 | 0.476 |
| SRResNet [12] | 33.17 | 0.918 | 0.158 | 30.65 | 0.862 | 0.228 | 28.99 | 0.825 | 0.281 |
| EDSR [13] | 33.88 | 0.920 | 0.145 | 30.86 | 0.867 | 0.219 | 29.09 | 0.827 | 0.278 |
| RCAN [32] | 33.83 | 0.923 | 0.147 | 30.90 | 0.864 | 0.225 | 29.21 | 0.824 | 0.287 |
| CDC [27] | 33.96 | 0.925 | 0.142 | 30.99 | 0.869 | 0.215 | 29.24 | 0.827 | 0.278 |
| D2C-SR(Ours) | 34.39 | 0.926 | 0.136 | 31.31 | 0.870 | 0.214 | 29.67 | 0.830 | 0.270 |
+
+Table 3: Performance of applying our D2C structure to other methods on RealSR.
+
+| Method | x2 | x3 | x4 | Parameters |
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM |
| SRRResNet [12] | 33.17 | 0.918 | 30.65 | 0.862 | 28.99 | 0.825 | 1.52M |
| D2C-SRResNet | 33.82 | 0.920 | 30.69 | 0.862 | 29.19 | 0.822 | 1.37M |
| VDSR [10] | 31.39 | 0.876 | 30.03 | 0.845 | 27.07 | 0.751 | 0.67M |
| D2C-VDSR | 34.08 | 0.920 | 30.29 | 0.858 | 28.21 | 0.793 | 0.67M |
| RRDBNet [25] | 33.44 | 0.919 | 30.29 | 0.858 | 28.34 | 0.813 | 16.7M |
| D2C-RRDBNet | 33.49 | 0.920 | 30.33 | 0.859 | 28.47 | 0.814 | 9.16M |
| RDN [33] | 33.97 | 0.922 | 30.90 | 0.864 | 29.23 | 0.824 | 6.02M |
| D2C-RDN | 34.03 | 0.922 | 30.93 | 0.865 | 29.32 | 0.825 | 5.59M |
| EDSR [13] | 33.88 | 0.920 | 30.86 | 0.867 | 29.09 | 0.827 | 43.1M |
| D2C-EDSR | 34.17 | 0.924 | 31.08 | 0.868 | 29.41 | 0.829 | 7.91M |
| IMDN [9] | 33.59 | 0.916 | 30.74 | 0.859 | 29.17 | 0.819 | 0.874M |
| D2C-IMDN | 33.95 | 0.920 | 30.98 | 0.862 | 29.45 | 0.824 | 0.738M |
+
+# 4.5 Ablation Studies
+
+The width and depth of tree-based network. Our divergence network is a tree-based architecture. We set different $L$ and $C$ to provide experimental evaluations on the width and depth of the tree. Because increasing the depth and width increases memory usage. So we do these experiments on a small baseline model, which has $G = 2$ residual groups and each group has $B = 1$ block. As show in Table 4, we increase the width and depth from 1 to 4 respectively on x4 scaling factor and show the changes in PSNR. By increasing the width or depth of the tree-based network, the performance of our D2C-SR improves.
+
+Divergence loss. As mentioned in Sec. 3.2, the divergence loss is used to enforce the outputs from different branches divergent. In Fig. 8, the visualization divergent results show that different branches produce different texture predictions. We verify the effectiveness of our divergence loss by removing the term of Eq. 5. As shown in Table 5 "w/o. divergence loss", the approach appears degraded. Because of the random nature of the model initialization, it is possible to lead to some degree of divergence in the results without using triplet loss and thus still
+
+Table 5: Effect of our divergence loss and multi-branch deep residual structure.
+
+ | x2 | x3 | x4 |
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM |
| w/o. Divergence Loss | 33.98 | 0.920 | 31.12 | 0.863 | 29.43 | 0.824 |
| w/o. Multi Deep Res | 34.28 | 0.925 | 31.28 | 0.870 | 29.68 | 0.830 |
| D2C-SR(Ours) | 34.40 | 0.926 | 31.33 | 0.871 | 29.72 | 0.831 |
+
+
+Fig. 8: Visualization of the divergent predictions.
+
+gain some performance, it is still possible to gain some benefit from the effect of divergence. However, as mentioned in Sec. 1, it is not stable without the explicit divergence constraint, and thus may still bring degradation of performance. Further, we change the weight of the divergence loss and observe the changes that occur in different branches. As shown in Fig. 9, the results are relatively similar when divergence loss is not used. As the coefficients $\alpha$ increase, the differentiation of the different branches becomes more obvious. In this example, the results containing richer and more details appear. Theoretically, if $\alpha$ or the margin is too large it may lead to performance degradation, so we determine the $\alpha$ or the margin based on the model convergence.
+
+Multi-branch deep residual structure. As mentioned in Sec. 3.2, we also disable the structure to verify its effectiveness. As shown in Table 5 "w/o. Multi Deep Res", the PSNR decreased without the multi-branch deep residual structure.
+
+# 4.6 Visualization of Weight Maps
+
+We assign spatial weights to the divergence results and use this weight for the fusion of the divergence results at the convergence stage. In Fig. 10, we visualize the weight maps using the heatmap. The visualization results show that predictions have some regional and texture correlation. We suggest that the weight generation depends mainly on the sharpness, edge style and texture preferences of the divergence results. We further measure the gap between the learned weight and the approximate ideal weight by finding the pixel that best matches the HR in the divergence results. The PSNR between the ideal fusion results and HR is 31.06dB on RealSR x4, thus the gap is 1.34dB (29.72dB ours).
+
+
+Fig. 9: Comparisons on different weighting coefficient $\alpha$ in our divergence loss.
+
+
+Fig. 10: Weight maps in convergence stage. Red indicates higher values.
+
+
+
+
+
+
+
+
+
+# 4.7 Simulated SISR and Real-World SISR
+
+More works have focused on real-world SR because the great gap between simulated and real-world degradation hinders practical SR applications [4, 27]. On the other hand, real-world degradation loses more information than bicubic compared with the HR, which also have been discussed in [5], and ill-posed problem becomes more apparent in real-world datasets. Therefore, the real-world datasets can better reflect the effectiveness of our method.
+
+# 5 Conclusion
+
+In this study, we revisit the problem of image super-resolution and provide a new two-stage approach: divergence stage for multiple predictions learning as well as convergence for predictions fusion. Considering the limitations of traditional SR methods and SR space methods, we adopt a trade-off approach by using a finite discrete distribution to fit the high-frequency details. This allows the network to be more efficient and achieves state-of-the-art performance with much less computational cost. Further, our D2C framework is a promising direction for image processing tasks like image inpainting as well as image denoising, and it is worth further exploration.
+
+Acknowledgment This work was supported by the National Natural Science Foundation of China (NSFC) under grants No. 61872067 and No. 61720106004.
+
+# References
+
+1. Anwar, S., Khan, S., Barnes, N.: A deep journey into super-resolution: A survey. ACM Computing Surveys (CSUR) 53(3), 1-34 (2020) 3
+2. Bahat, Y., Michaeli, T.: Explorable super resolution. In: CVPR. pp. 2716-2725 (2020) 4
+3. Buhler, M.C., Romero, A., Timofte, R.: Deepsee: deep disentangled semantic explorative extreme super-resolution. In: ACCV (2020) 4
+4. Cai, J., Zeng, H., Yong, H., Cao, Z., Zhang, L.: Toward real-world single image super-resolution: A new benchmark and a new model. In: CVPR. pp. 3086-3095 (2019) 3, 4, 8, 9, 10, 14
+5. Chen, C., Xiong, Z., Tian, X., Zha, Z.J., Wu, F.: Camera lens super-resolution. In: CVPR. pp. 1652-1660 (2019) 4, 14
+6. Dai, D., Timofte, R., Van Gool, L.: Jointly optimized regressors for image superresolution. In: Computer Graphics Forum. vol. 34, pp. 95-104 (2015) 2, 3
+7. Goodfellow, I.J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial networks. arXiv preprint arXiv:1406.2661 (2014) 2, 3
+8. Gu, J., Lu, H., Zuo, W., Dong, C.: Blind super-resolution with iterative kernel correction. In: CVPR. pp. 1604-1613 (2019) 4
+9. Hui, Z., Gao, X., Yang, Y., Wang, X.: Lightweight image super-resolution with information multi-distillation network. In: Proceedings of the 27th acm international conference on multimedia. pp. 2024-2032 (2019) 12
+0. Kim, J., Kwon Lee, J., Mu Lee, K.: Accurate image super-resolution using very deep convolutional networks. In: CVPR. pp. 1646-1654 (2016) 5, 12
+1. Kim, J., Lee, J.K., Lee, K.M.: Deeply-recursive convolutional network for image super-resolution. In: CVPR. pp. 1637-1645 (2016) 2, 3, 8, 9
+2. Ledig, C., Theis, L., Huszar, F., Caballero, J., Cunningham, A., Acosta, A., Aitken, A., Tejani, A., Totz, J., Wang, Z., et al.: Photo-realistic single image super-resolution using a generative adversarial network. In: CVPR. pp. 4681-4690 (2017) 3, 5, 8, 9, 12
+3. Lim, B., Son, S., Kim, H., Nah, S., Mu Lee, K.: Enhanced deep residual networks for single image super-resolution. In: CVPRW. pp. 136-144 (2017) 2, 3, 8, 9, 12
+4. Lugmayr, A., Danelljan, M., Van Gool, L., Timofte, R.: Srflow: Learning the super-resolution space with normalizing flow. In: ECCV. pp. 715-732 (2020) 2, 4, 8
+5. Michelini, P.N., Liu, H., Zhu, D.: Multigrid backprojection super-resolution and deep filter visualization. In: AAAI. vol. 33, pp. 4642-4650 (2019) 2
+6. Pan, Z., Li, B., Xi, T., Fan, Y., Zhang, G., Liu, J., Han, J., Ding, E.: Real image super resolution via heterogeneous model ensemble using gp-nas. In: ECCV. pp. 423-436. Springer (2020) 2, 3
+7. Sajjadi, M.S., Scholkopf, B., Hirsch, M.: Enhancenet: Single image super-resolution through automated texture synthesis. In: ICCV. pp. 4491-4500 (2017) 3
+8. Shi, W., Caballero, J., Huszár, F., Totz, J., Aitken, A.P., Bishop, R., Rueckert, D., Wang, Z.: Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In: CVPR. pp. 1874-1883 (2016) 3
+9. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014) 2, 3
+20. Song, D., Xu, C., Jia, X., Chen, Y., Xu, C., Wang, Y.: Efficient residual dense block search for image super-resolution. In: AAAI. vol. 34, pp. 12007-12014 (2020) 2
+
+21. Sun, L., Hays, J.: Super-resolution from internet-scale scene matching. In: Proc. ICCP. pp. 1-12 (2012) 3
+22. Timofte, R., De Smet, V., Van Gool, L.: Anchored neighborhood regression for fast example-based super-resolution. In: ICCV. pp. 1920-1927 (2013) 3
+23. Timofte, R., De Smet, V., Van Gool, L.: A+: Adjusted anchored neighborhood regression for fast super-resolution. In: ACCV. pp. 111-126 (2014) 2, 3
+24. Wang, L., Huang, Z., Gong, Y., Pan, C.: Ensemble based deep networks for image super-resolution. Pattern recognition 68, 191-198 (2017) 2, 3
+25. Wang, X., Yu, K., Wu, S., Gu, J., Liu, Y., Dong, C., Qiao, Y., Change Loy, C.: Esrgan: Enhanced super-resolution generative adversarial networks. In: ECCV. pp. 0-0 (2018) 3, 8, 9, 12
+26. Wang, Z., Chen, J., Hoi, S.C.: Deep learning for image super-resolution: A survey. IEEE Trans. on Pattern Analysis and Machine Intelligence (2020) 3
+27. Wei, P., Xie, Z., Lu, H., Zhan, Z., Ye, Q., Zuo, W., Lin, L.: Component divide-and-conquer for real-world image super-resolution. In: ECCV. pp. 101-117 (2020) 3, 4, 8, 9, 12, 14
+28. Xiong, D., Gui, Q., Hou, W., Ding, M.: Gradient boosting for single image superresolution. Information Sciences 454, 328-343 (2018) 2, 3
+29. Yang, C.Y., Yang, M.H.: Fast direct super-resolution by simple functions. In: ICCV. pp. 561-568 (2013) 2, 3
+30. Yang, J., Wright, J., Huang, T., Ma, Y.: Image super-resolution as sparse representation of raw image patches. In: CVPR. pp. 1-8 (2008) 2, 3
+31. Zhang, X., Chen, Q., Ng, R., Koltun, V.: Zoom to learn, learn to zoom. In: CVPR. pp. 3762-3770 (2019) 4
+32. Zhang, Y., Li, K., Li, K., Wang, L., Zhong, B., Fu, Y.: Image super-resolution using very deep residual channel attention networks. In: ECCV. pp. 286-301 (2018) 2, 5, 8, 9, 12
+33. Zhang, Y., Tian, Y., Kong, Y., Zhong, B., Fu, Y.: Residual dense network for image super-resolution. In: CVPR. pp. 2472-2481 (2018) 12
\ No newline at end of file
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/images.zip b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..8e35a909a22466d3b65dbc96a33427aaa94100eb
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f60732e35063e4c7ebe5c1ff7295731c3f996e9885d5a53c60bde90524f59ae
+size 672662
diff --git a/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/layout.json b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8ee0c2aa73698b91fa8b140ea72926d835c13b23
--- /dev/null
+++ b/d2csradivergencetoconvergenceapproachforrealworldimagesuperresolution/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d6dbb9821afb598fb8c1ac09fecc6093c809f8ae0737a016f3ae084eb9ced4fa
+size 389123
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_content_list.json b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8893c2cd921163aaf0be840eaca42145b98cf582
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8d83c08eaa791514fd6386d139928d6e4560fdb373c214b8616d3f12d6cb92fd
+size 87588
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_model.json b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..63be733ec869f23f9fb8953c236001922176e1ec
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0fe062238048d5abf1d1184866555e0e741d7062759b61e60b4d1005d817a3dd
+size 117477
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_origin.pdf b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7930c76ef53d1de92f62e99916fd3b18c9d74c0a
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/91f5b100-ce6a-4f50-9990-96b53d4cb84a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7ec42f9ee92370969baaf6c21d32d040ce2b3e6df805a40964c0261b7793103
+size 8124027
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/full.md b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2c65d3bca043d5bc048eb1618b04b69c0772d535
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/full.md
@@ -0,0 +1,365 @@
+# D2HNet: Joint Denoising and Deblurring with Hierarchical Network for Robust Night Image Restoration
+
+Yuzhi Zhao $^{1}$ , Yongzhe Xu $^{2}$ , Qiong Yan $^{2}$ , Dingdong Yang $^{2}$ , Xuehui Wang $^{3}$ , and Lai-Man Po $^{1}$
+
+$^{1}$ Department of Electrical Engineering, City University of Hong Kong
+
+$^{2}$ SenseTime Research and Tetras.AI
+
+3 MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University yzzhao2-c@my.cityu.edu.hk, wangxuehui@sjtu.edu.cn, eelmpo@cityu.edu.hk, {xuyongzhe1, yanqiong, yangdingdong}@tetras.ai
+
+Abstract. Night imaging with modern smartphone cameras is troublesome due to low photon count and unavoidable noise in the imaging system. Directly adjusting exposure time and ISO ratings cannot obtain sharp and noise-free images at the same time in low-light conditions. Though many methods have been proposed to enhance noisy or blurry night images, their performances on real-world night photos are still unsatisfactory due to two main reasons: 1) Limited information in a single image and 2) Domain gap between synthetic training images and real-world photos (e.g., differences in blur area and resolution). To exploit the information from successive long- and short-exposure images, we propose a learning-based pipeline to fuse them. A D2HNet framework is developed to recover a high-quality image by deblurring and enhancing a long-exposure image under the guidance of a short-exposure image. To shrink the domain gap, we leverage a two-phase DeblurNet-EnhanceNet architecture, which performs accurate blur removal on a fixed low resolution so that it is able to handle large ranges of blur in different resolution inputs. In addition, we synthesize a D2-Dataset from HD videos and experiment on it. The results on the validation set and real photos demonstrate our methods achieve better visual quality and state-of-the-art quantitative scores. The D2HNet codes and D2-Dataset can be found at https://github.com/zhaoyuzhi/D2HNet.
+
+Keywords: Night Image Restoration, Image Denoising, Image Deblurring, Domain Gap Issue
+
+# 1 Introduction
+
+Capturing high-quality photos at night-time on modern smartphones is troublesome due to the limitations of sensors and optical systems. It is a long-standing and practical problem in the computational photography field. Acquiring sharp and clean photos effectively and efficiently on smartphones in night conditions is
+
+in great demand. The main difficulty lies in that the image signal is too weak compared with the inherent noise in the imaging process, which yields a low signal-to-noise ratio (SNR) and degrades image quality [41, 42, 70]. To obtain higher SNR, there are many solutions either on the hardware level (in-camera solutions) or algorithm level, which typically fall into one of these three categories: 1) Physical solutions: using a larger sensor, opening the aperture, using flash, or setting longer exposure time; 2) Single-image restoration: deblurring the long-exposure image with motion blurs, or denoising the short-exposure image with severe noises; 3) Burst-image restoration: combining several photos captured in quick succession using temporal coherence within the burst.
+
+Though these solutions improve the night image restoration quality, they might not meet the requirements of both effectiveness and efficiency for mobile photography. For physical solutions, larger sensor size and aperture are related to hardware design and increase the cost. The built-in flash does not help for far scenes. Long exposure time causes motion blur. To post-process the captured images, single-image restoration methods have been widely studied, e.g., training neural networks [36, 90] on a large number of paired degraded-clean images. However, a single input image contains limited information thus restricting the restoration quality. To use more information, burst-image restoration methods [46, 49] combine multiple continuous frames to generate a single good image. Though they have a theoretically superior SNR than single-image restoration methods, the speed is restricted by the capturing process, including multiple exposure and readout time. Meanwhile, the misalignment issue has to be solved for all captured frames. In addition, the data distribution gap (e.g., differences in blur area, resolution) between training and real images remains a key problem.
+
+In this paper, we tackle this real-world problem by post-processing successive long- and short-exposure images through a D2HNet framework. It can produce clean and sharp photographs on mobile devices without any manual control or extra hardware support. Compared with the previous image restoration approaches, our approach has three main advantages: 1) Taking advantage of both long and short exposures; 2) Addressing the domain gap issue between training data and real-world photos by a special two-phase network; 3) Balancing image processing quality and capturing time (only 2 long- and short-exposure images are needed).
+
+Normally, long-exposure images have regular color and fewer noises and short-exposure images are of trivial blurs. Compared with single-image restoration [36,90], fusing them helps reduce the noise level and blurriness, and improve color fidelity for night photos. Compared with burst-image restoration methods [46,49], two shots have milder misalignment issues and require a shorter capturing time. Built upon these observations, we propose the D2HNet framework. To address the domain gap between training data and real photos captured by different smartphones, we split D2HNet into sequential subnets: DeblurNet and EnhanceNet. DeblurNet runs on a small resolution at the training and a fixed resolution at the testing similar to training images. It ensures pixel shifts or blur levels between training and real-world images are comparable; therefore, the network generalizes better to different image resolutions and blur areas.
+
+
+(a) Long-exposure input image
+
+
+(b) Short-exposure input image
+
+
+(c)SGN
+
+
+(d) MIRNet
+
+
+(c) MPRNet
+
+
+(f) DeblurGAN
+Fig. 1. Performance on real-world night photos. Input photos captured by Xiaomi Mi Note 10 smartphone are shown in (a) and (b). Results from single image denoising methods are in (c) - (e). Results from single image deblurring methods are in (f) and (g). Results from long-short fusion methods (including our D2HNet) are in (h) - (j).
+
+
+(g)MIMOUNet++
+
+
+(h) LSD2
+
+
+(i) LSFNet
+
+
+(j) D2HNet
+
+EnhanceNet enhances the DeblurNet output on actual target resolutions together with short- and long-exposure inputs. We use deformable convolutions [18] in the EnhanceNet to align the features hierarchically to better extract the details and textures from the long-exposure input. In addition, we propose a CutNoise scheme to assist the learning of where and how to deblur and a VarmapSelection scheme to balance blurry and non-blurry patches during training.
+
+To evaluate the capability of D2HNet, we synthesize a D2-Dataset from HD videos for training and validation. It contains 6853 tuples of long- and short-exposure images with corresponding sharp ground truth. It covers a wide range of scenes, e.g., cities, villages, forests, deserts, and mountains. We also capture 28 pairs of long- and short-exposure photos of real-world scenes by a smartphone for testing. Extensive experiments on both D2-Dataset and real captured photos show the state-of-the-art (SOTA) performance achieved by the proposed D2HNet. One real sample is shown in Figure 1. D2HNet can produce clean and sharp images simultaneously, while the other methods fail to do so. It demonstrates that D2HNet better utilizes the information of dual-exposure images.
+
+Below we summarize the main contributions of this paper:
+
+1) We propose a two-phase D2HNet for robust real night image restoration and to address the domain gap issue between training data and real photos;
+2) We propose two data augmentation schemes, CutNoise and VarmapSelection, to improve and stabilize the training of D2HNet;
+3) We create a D2-Dataset including 6853 image tuples with multiple levels of blurs for benchmarking D2HNet;
+4) We conduct extensive experiments with long-short fusion methods, and single image denoising or deblurring methods. The proposed D2HNet achieves better performance than other methods.
+
+# 2 Related Work
+
+Single-image Denoising. Image denoising is a fundamental topic in image processing. Previous methods such as total variation [59], wavelet coring [60], non-local means [4], BM3D [17] assumed noises and signals have specific statistical regularities. However, these methods used hand-crafted models thus not robust to real noises. Recently, CNNs have shown their advanced performance to address blind denoising issue [13,25,43,44,48,65,90,91]. Some works further extended them to reduce real noises [2,5,10-12,14,26,29,33,38,45,82,84,85,89,93]. To better simulate noise emerged on mobile ISP, many inverse algorithms [3,77,83] and real noise calibration methods [1,71,73] were proposed.
+
+Single-image Deblurring. Image deblurring aims to generate a sharp and clean reconstruction from a blurry input. Many classical non-blind methods formulated the problem as blind deconvolutions [35,39,56]. The blur kernels are normally assumed as noisy linear operators enforced on the clean images. Recently, CNN-based approaches [6,15,21,23,30,36,37,51-54,57,63,64,66,74,81,88,92] proposed the end-to-end deblurring with specific network architectures and loss functions. These methods are trained on large-scale blurry-sharp pairs. However, directly applying them to real-world photos may not obtain sharp results.
+
+Burst-image Restoration. Since the overall photon counts of burst images are more than a single image, burst-image-based methods [20, 22, 32, 46, 49, 76, 78, 86] have theoretically superior SNR than single-image-based methods. However, burst images suffered from noises and camera shake, which increase the difficulty of implementation. To overcome that, [22] proposed a recurrent neural network to filter noises in a sequence of images. [49] combined neural network and kernel method to perform denoising and alignment jointly. Though they restore high-quality photos, their data capture occupies a major time during application.
+
+Image Restoration by Fusing Successive Long- and Short-exposure images. Image restoration with dual exposures [16,24,61,62,68,75,80] is beneficial for both noise reduction and blur estimation. For instance, Yuan et al. [80] firstly estimated blur kernels using the texture of short-exposure images, which are then used to restore the long-exposure blurry images. Recently, LSD2 [50] and LSFNet [9] used CNNs to fuse dual-exposure images and obtained better results than single-image denoising or deblurring methods on their synthetic dataset. However, they ignored the potential domain gap issue between training images and real-world photos.
+
+Deformable Convolution. Dai et al. [18] proposed deformable convolutions, which allows the network to obtain the information away from regular local neighborhoods by learning additional offsets. It has been widely applied in computer vision tasks such as semantic segmentation [18,94], video deblurring [69], video super-resolution [7,8,67], and video restoration [19,27]. For instance, EDVR [69] used deformable convolutions to align inputs without using explicit optical flows. For the long-short fusion problem, there normally exists a misalignment issue between input long- and short-exposure images. Also, it is difficult to compute accurate optical flows from noisy and blurry inputs. Inspired by previous methods, we adopt deformable convolutions as alignment blocks.
+
+# 3 Data Acquisition
+
+D2-Dataset. We synthesize a D2-Dataset for training and benchmarking. The data synthesis pipeline is as follows:
+
+1) We collect 30 HD videos with $1440 \times 2560$ resolution from the Internet. They are almost noise-free and cover a wide range of scenes. We sample 60 continuous frames (approximately 1 second in original 60-fps videos) every 10 seconds in each video to reduce repeated scenes and avoid scene switching;
+2) We use a video frame interpolation model SuperSloMo [31] to increase the original 60-fps videos to 960 fps. It smooths videos to simulate realistic blurs;
+3) We synthesize successive long-exposure image $l$ and short-exposure image $s$ by averaging interpolated frames. Meantime, we add a time gap between $l$ and $s$ to model hardware readout limitation. We also extract corresponding sharp single frames, i.e., the last frame of long-exposure image $l_{last}$ and the first frame of short-exposure image $s_{first}$ .
+
+The pipeline results in 6853 image tuples $(l, s, l_{last},$ and $s_{first})$ , where 5661 tuples are used for training and 1192 for validation. More details are presented in the supplementary material.
+
+Testing Images. We capture 28 pairs of long- and short-exposure images with resolution $3472 \times 4624$ using a Xiaomi Mi Note 10 smartphone. To ensure the overall brightness of long- and short-exposure images are approximately the same, we set "ISO×exposure time" of them equal. Specifically, the exposure time of the long-exposure image is set to be 8 times of short-exposure time while its ISO is $1/8$ of the short-exposure image.
+
+# 4 Methodology
+
+# 4.1 Problem Formulation
+
+Given paired noisy long- and short-exposure images denoted as $l_{n}$ and $s_{n}$ , we aim to recover a sharp and clean image $z$ . We formulate it as maximizing a posteriori of the output conditioned on inputs and D2HNet parameters $\Theta$ :
+
+$$
+\Theta^ {*} = \underset {\Theta} {\arg \max } p (z | l _ {n}, s _ {n}, \Theta). \tag {1}
+$$
+
+We train our network on the proposed D2-Dataset. From it we use $l$ , $s$ pair to generate noisy training inputs $l_{n}, s_{n}$ , and $s_{\text{first}}$ as ground truth of $z$ here.
+
+# 4.2 D2HNet Architecture and Optimization
+
+**Workflow.** The workflow of D2HNet is illustrated in Figure 2. To address the domain gap issue between synthetic training images and real-world photos (e.g., different resolutions and blur levels), we use a two-phase structure in our workflow. In phase one, the two inputs are downsampled into a smaller and fixed resolution, so that motion scales and pixel shifts in the long-exposure image
+
+
+Fig. 2. Illustration of the D2HNet workflow.
+
+
+Fig. 3. Illustration of DeblurNet (left) and EnhanceNet (right). Alignment blocks, Feature fusion blocks, and Residual blocks are noted in the figure while the remaining blocks are normal convolutional layers. Offsets are learnable and as parts of Alignment blocks. Images $t$ and $y$ are the outputs of DeblurNet and EnhanceNet, respectively.
+
+are restricted. Then, the DeblurNet with a certain receptive field can perform accurate deblurring based on the edge information in the short-exposure image. In phase two, to enhance the details lost during downsampling, the EnhanceNet post-process the upsampled first-phase network output together with long-short inputs in their original resolution.
+
+DeblurNet. For the input data, DeblurNet receives the downsampled long- and short-exposure input images with a downsampling ratio $\alpha$ . At the training, $\alpha$ is set to $1/2$ ; while at the testing, the input resolution is fixed to $1024 \times 1024$ . Therefore, the domain gap is reduced since the motion scales of testing images are controlled. We use the average pooling as the downsampling operator at both training and testing stages as it mimics the physical differences between low- and high-resolution images better. For the network architecture, DeblurNet uses 3 levels to extract features since it better balances the deblurring quality and computational complexity, where DWT [43] is used as the downsampling operator. There are two Residual blocks at the bottleneck and at the tail respectively, where each block includes 4 sequential residual layers [28]. The output $t$ is upsampled by bilinear sampling and then as the input for the next phase, i.e., EnhanceNet.
+
+EnhanceNet. The target of EnhanceNet is to recover the details (mostly from long-exposure input) and further remove artifacts for the upsampled DeblurNet output $t^{\uparrow}$ . As shown in Figure 3, EnhanceNet has 3 modules: feature pyramid extraction (green blocks), alignment and feature fusion (pink and yellow blocks), and reconstruction (blue blocks).
+
+The feature pyramid extraction has two branches without sharing weights. The output two feature pyramids have 5 levels, denoted as $F_{s}^{1} - F_{s}^{5}$ and $F_{l}^{1} - F_{l}^{5}$ , respectively. Since inputs $s_n / y^\uparrow$ and $l_n$ are not spatially aligned, we perform the alignment for long-exposure features $(F_l^1 -F_l^5)$ by Alignment blocks, where we use the modulated deformable convolution [94]. Alignment blocks allow the following layers to better fuse the information of two feature pyramids. Here we give a brief introduction for the modulated deformable convolution. As we have known, a $3\times 3$ convolution kernel of dilation 1 has learnable weights $w_{k}\in \{1,\dots ,K\}$ and fixed offsets $p_k\in \{(-1, - 1),(-1,0),(-1,1),(0, - 1),(0,0),(0,1),(1, - 1),(1,0),(1,1)\}$ where $K = 9$ . Then for the modulated deformable convolution, there are learnable parameters, offsets $\varDelta p_k^i$ and modulation scalars $\varDelta m_k^i$ for each location $p_k$ . The offsets $\varDelta p_k^i$ are real numbers and the modulation scalars $\varDelta m_k^i$ are in range of [0, 1]. Therefore, for such convolution result on $i$ -th long-exposure feature $F_{l}^{i}$ can be expressed as:
+
+$$
+F _ {a} ^ {i} (p) = \sum_ {k = 1} ^ {K} w _ {k} ^ {i} \cdot F _ {l} ^ {i} \left(p + p _ {k} + \Delta p _ {k} ^ {i}\right) \cdot \Delta m _ {k} ^ {i}. \tag {2}
+$$
+
+The modulation scalars and learnable offsets (pink blocks in Figure 3) are learned from short- and long-exposure features hierarchically. For simplicity, we only express the learnable offsets from a series of convolutional layers $c^i$ as:
+
+$$
+\Delta P _ {k} ^ {i} = \left\{ \begin{array}{c c} c ^ {i} \left(F _ {s} ^ {i}, F _ {l} ^ {i}, \Delta P _ {k} ^ {i + 1}\right), & i = 1, 2, 3, 4 \\ c ^ {i} \left(F _ {s} ^ {i}, F _ {l} ^ {i}\right), & i = 5 \end{array} \right. \tag {3}
+$$
+
+where $\Delta P_k^i = \{\Delta p_k^i\}$ . The deepest 5-th level $\Delta P_k^5$ is first computed. Since the misalignment between two features $F_s^i$ and $F_l^i$ of the deepest level is small [21] the learning of offsets is relatively accurate and less challenging. We then pass the learned offsets to the upper levels to learn more precise offsets. This process is done level-by-level as a hierarchical refinement [9,47,69].
+
+After long-exposure features $F_{l}^{1} - F_{l}^{5}$ are aligned, we perform the feature fusion. In $i$ -th level's Feature fusion block, the aligned features $F_{a}^{i}$ and short-exposure features $F_{s}^{i}$ are concatenated and then processed by a Residual block $r^i$ as:
+
+$$
+F _ {f} ^ {i} = r ^ {i} \left(F _ {s} ^ {i}, F _ {a} ^ {i}\right), \tag {4}
+$$
+
+where the output features $F_{f}^{5}$ are connected to the first decoder layer, while $F_{f}^{1} - F_{f}^{4}$ serve as short-cut connections like in UNet [58]. Finally, we use a Residual block (including 4 residual layers) at the tail to further refine the features at the original resolution. The final output is added to $t^{\uparrow}$ .
+
+Loss. We first train DeblurNet and then train EnhanceNet. The L1 loss [90] is used for training them, as shown in Figure 2. They are expressed as:
+
+$$
+L _ {1} ^ {D e b l u r N e t} = \mathbb {E} [ | | t - z ^ {\downarrow} | | _ {1} ], L _ {1} ^ {E n h a n c e N e t} = \mathbb {E} [ | | y - z | | _ {1} ], \tag {5}
+$$
+
+
+Fig. 4. Illustration of detailed procedures of training and testing pipelines (upper) and examples of every step of data processing procedures (lower).
+
+
+Fig. 5. Variance map patch distribution on D2-Dataset. The 5-th percentile point 182.82 is set as the threshold. If the average of a variance map patch is lower than 182.82, its corresponding long-exposure patch is regarded to be highly blurry.
+
+where $z^{\downarrow}$ is the average pooling downsampled result from the ground truth $z$ to match the resolution of $t$ .
+
+# 4.3 Data Processing
+
+The data processing is a key process for training the D2HNet, which includes VarmapSelection, Appearance Adjustment, Noise Modeling, and CutNoise, as shown in Figure 4. It is designed to better model the real image distortion and balance the training data distribution.
+
+VarmapSelection. It is a variance-map-based selection scheme to address the imbalanced blurriness issue and improve the robustness of D2HNet. Since most regions of the simulated long-exposure image $l$ are of low levels of blur, simply randomly choosing patches at the training causes loss fluctuation and ineffective deblurring ability for large motion. VarmapSelection scheme uses the variance map to represent the blur level and choose larger motion patches for training. The variance map is calculated from both $l$ and $l_{last}$ as:
+
+$$
+l _ {\text {v a r m a p}} = \min (\operatorname {V a r} (l)) / \operatorname {V a r} \left(l _ {\text {l a s t}}\right), 1), \tag {6}
+$$
+
+where Var computes the variance using a $k \times k$ window, with stride $k$ . The resulted map is $1 / k \times 1 / k$ of the original size, so we upsample it with the nearest interpolation. According to the definition, a smaller value means higher levels of blur. One example variance map is shown in the pink rectangle of Figure 4, where the blurrier regions in $l$ have clearer (darker) responses in $l_{\text{varmap}}$ .
+
+To determine whether a randomly chosen patch is of a large blur, we choose to define a threshold based on variance statistics on the training set. For each variance map, we randomly sample 1000 different squares of size $1024 \times 1024$ and calculate the average variance value for each square. Then, we sort all values across the dataset and use the 5-th percentile point as the threshold, as shown in Figure 5. Afterward, we do sampling again, keep only the squares that have lower average variance values than the threshold and draw patches from the corresponding long-short-GT tuples. This process results in additional 9453 tuples of a strong blur. They are added to the original training set.
+
+Appearance Adjustment. To simulate low-light image tuples, we apply Illumination Adjustment (IA) to lower the overall brightness. We also apply Color Adjustment (CA) to model the difference between long- and short-exposure images. An example is shown in the pink rectangle of Figure 4. IA is done by an inverse gamma compression for long-short-GT tuples, as follows:
+
+$$
+I A (u) = \max (u, \varepsilon) ^ {g}, \text {f o r} u \in \{s, l, z \}, \tag {7}
+$$
+
+where $\varepsilon = 10^{-8}$ . The gamma value $g$ is randomly chosen from $[1/0.6, 1/0.7, 1/0.75, 1/0.8, 1/0.9]$ . CA is achieved by a linear transform to disturb the overall color and brightness for only the short-exposure image $s$ . It is defined as:
+
+$$
+C A (s) = a \cdot s + b, \tag {8}
+$$
+
+where $a$ and $b$ are sampled uniformly from [0.3, 0.6] and [0.001, 0.01], respectively. Noise Modeling. We calibrate real smartphone noises in the RAW image space following [73] and then apply the noise simulation. Since our D2-dataset contains only sRGB images, we adopt a simple reverse ISP process [3] to convert them from sRGB to RAW. It includes an inverse gamma compression (as in Equation 7 with $g = 2.2$ ), an inverse white balance which simply scales R and B channels by scalar $1 / w_r$ , $1 / w_b$ separately, and the mosaic to form Bayer pattern. Note white balance gain for the G channel ( $w_g$ ) is fixed to 1, while $w_r$ and $w_b$ are sampled uniformly from [1.9, 2.4] and [1.5, 1.9], respectively. After noise modeling, we then convert it to sRGB by a forward ISP process with corresponding parameters for inversion. The noise model is calibrated on the Xiaomi Mi Note 10, which we use to capture real photos.
+
+CutNoise. To encourage the fusion and utilization of the short-exposure image, inspired by [79], we design the CutNoise scheme. It is performed after noise simulation on the short-exposure image which has stronger noise. CutNoise randomly selects a region and copies ground truth $z$ (i.e., $s_{\text{first}}$ ) to the corresponding position of $s_n$ . The region itself can be any shape but we fix it to square for easy implementation. With CutNoise, D2HNet will not degenerate to use only the blurrier long-exposure input but is forced to learn to fuse information from the sharper short-exposure one, therefore generating sharper output.
+
+Table 1. Comparisons of D2HNet and other methods on D2-Dataset validation set by PSNR and SSIM [72]. The red and blue colors denote the best and second-best results, respectively.
+
+| Method | 1440p | val data | 2880p | val data |
| PSNR | SSIM | PSNR | SSIM |
| DenseFuse [40] | 32.90 | 0.9484 | 34.70 | 0.9637 |
| LSD2 [50] | 33.20 | 0.9517 | 35.36 | 0.9675 |
| LSFNet [9] | 33.87 | 0.9557 | 36.17 | 0.9715 |
| DeblurGAN [36] | 33.80 | 0.9558 | 36.26 | 0.9701 |
| SGN [25] | 33.87 | 0.9567 | 36.25 | 0.9720 |
| TP1 | 34.35 | 0.9628 | 36.66 | 0.9755 |
| TP2 | 34.26 | 0.9599 | 36.54 | 0.9733 |
| TP3 | 34.41 | 0.9611 | 36.70 | 0.9747 |
| D2HNet | 34.67 | 0.9639 | 36.85 | 0.9767 |
+
+Table 2. The results of the human perceptual study on real photos for the D2HNet and other pipelines, given by preference rates (PR) for D2HNet over all the votes.
+
+| Method | PR |
| D2HNet > DenseFuse, LSD2, LSFNet | 86.07% |
| DeblurGAN, SGN | |
| D2HNet > TP1 | 82.50% |
| D2HNet > TP2 | 81.07% |
| D2HNet > TP3 | 79.28% |
+
+# 5 Experiment
+
+# 5.1 Implementation Details
+
+Our training samples include original 5661 tuples of full-resolution images from the D2-Dataset and 9453 tuples of strong blurry patches selected by the VarmapSelection scheme. For DeblurNet, the input resolution is fixed to $512 \times 512$ by average pooling. The epochs are 100 and the learning rate is initialized as $1 \times 10^{-4}$ . For EnhanceNet, the input resolution is $256 \times 256$ randomly cropped patches due to memory limit. The epochs are 150 and the learning rate is initialized as $5 \times 10^{-5}$ . For both subnets, the learning rates are halved every 50 epochs. The batch size equals 2 and an epoch includes 5661 iterations, corresponding to the number of training tuples. The Adam optimizer [34] with $\beta_{1} = 0.5$ and $\beta_{2} = 0.999$ is used. The probabilities of performing Illumination Adjustment, Color Adjustment, and CutNoise are set to 0.3, 0.5, and 0.3, respectively. The size of the CutNoise square is 120. We implement the D2HNet with PyTorch 1.1.0 and train it on 2 Titan Xp GPUs. It takes approximately 2 weeks to complete the optimization.
+
+# 5.2 Long-short Fusion Method Experiments
+
+We compare the image restoration quality of D2HNet and other recent works with similar target, DenseFuse [40], LSD2 [50], and LSFNet [9], or with SOTA performance in either denoising or deblurring, SGN [25], DeblurGAN [36] (see more in Section 5.3). To fit the dual inputs, SGN's and DeblurGAN's input layers are changed to receive two images. In addition, we define three more two-phase pipelines for a more comprehensive evaluation: 1) image denoising by $\mathrm{SGN}+$ long-short fusion by SGN (denoted as TP1); 2) image deblurring by DeblurGAN $^+$ long-short fusion by SGN (denoted as TP2); 3) long-short fusion by SGN $^+$ long-short fusion refinement by SGN (the same workflow as D2HNet, denoted as TP3). The same data processing schemes are applied to other methods.
+
+We illustrate the generated samples on real photos in Figure 6. From image pairs #1 and #3, the black backgrounds of D2HNet results are cleaner than other
+
+
+Fig. 6. Visual comparisons of the proposed D2HNet with other methods. More results on both real photos and validation images are in the supplementary material.
+
+methods, e.g., obvious artifacts in results of DenseFuse, DeblurGAN, and TP1-TP3. It demonstrates that D2HNet has a better denoising ability for inputs. For image pair #2, D2HNet can generate a clean and sharp result from extreme blurry inputs, while maintaining the denoising ability of dark regions; however, there lie in artifacts in the dark regions of others. From image pairs #3 and #4, we can see D2HNet has better edge preservation ability compared with others, e.g., letters and Chinese characters are sharper and cleaner.
+
+The quantitative analysis is concluded in Table 1. Compared with other single-phase methods, D2HNet obtains $0.80\sim 1.77$ db PSNR gain on $1440\mathrm{p}$ . It also outperforms the simple concatenated methods (TP1-TP3) on both $1440\mathrm{p}$ and $2880\mathrm{p}$ , which demonstrates that D2HNet is more robust to different input resolutions. Since there is no ground truth for real photos, we conduct a human perceptual study on the results generated from different methods and there are 10 observers. In each comparison, a user is presented with a pair of restored images side by side of a shuffled sequence. Then, the user chooses one result that produces cleaner and sharper images than others. The preference rates (PRs) are concluded in Table 2, where there are $79.28\% \sim 86.07\%$ votes for D2HNet. The majority of users thought that D2HNet achieves higher image quality than compared methods. It demonstrates that D2HNet recovers images with better details and textures and well addresses the domain gap issue.
+
+Table 3. Comparisons of D2HNet and Table 4. Comparisons of D2HNet and other single image denoising methods. other single image deblurring methods.
+
+| Method | 1440p | val data SSIM | 2880p | val data SSIM | Method | 1440p | val data SSIM | 2880p | val data SSIM |
| DnCNN [90] | 32.20 | 0.9192 | 33.61 | 0.9265 | DeepDeblur [51] | 23.51 | 0.8252 | 23.80 | 0.8731 |
| MemNet [65] | 33.74 | 0.9517 | 35.73 | 0.9644 | SRN [66] | 23.99 | 0.8363 | 24.11 | 0.8780 |
| MWCNN [43] | 32.47 | 0.9372 | 34.71 | 0.9554 | DeblurGAN [36] | 24.23 | 0.8399 | 24.13 | 0.8749 |
| SGN [25] | 33.94 | 0.9576 | 36.42 | 0.9713 | DeblurGANv2 [37] | 23.88 | 0.8059 | 23.67 | 0.8359 |
| RIDNet [2] | 33.29 | 0.9462 | 35.55 | 0.9621 | DMPHN [87] | 21.73 | 0.7807 | 22.38 | 0.8447 |
| MIRNet [84] | 33.98 | 0.9565 | 36.36 | 0.9708 | MPRNet [85] | 22.97 | 0.8072 | 22.61 | 0.8438 |
| REDI [38] | 28.60 | 0.8964 | 31.54 | 0.9431 | HINet [12] | 22.39 | 0.7586 | 21.93 | 0.7879 |
| DeamNet [55] | 33.78 | 0.9531 | 36.26 | 0.9685 | MIMOUNet [15] | 21.11 | 0.7756 | 21.19 | 0.8355 |
| MPRNet [85] | 34.00 | 0.9568 | 36.25 | 0.9712 | MIMOUNet++ [15] | 21.10 | 0.7753 | 21.25 | 0.8373 |
| D2HNet | 34.67 | 0.9639 | 36.85 | 0.9767 | D2HNet | 34.67 | 0.9639 | 36.85 | 0.9767 |
+
+# 5.3 Single-image Denoising and Deblurring Method Experiments
+
+We compare D2HNet and SOTA image denoising [2,25,38,43,55,65,84,85,90] and deblurring [12,15,36,37,51,66,85,87] methods. Short-exposure images serve as inputs for denoising methods and $s_{\text{first}}$ is ground truth. Long-exposure images serve as inputs for deblurring methods and $l_{\text{last}}$ is ground truth.
+
+We illustrate the generated samples on real photos in Figure 7. From $\sharp 1$ and $\sharp 2$ , single image denoising methods cannot restore details of the roof ( $\sharp 1$ ) and the textures of curtains ( $\sharp 2$ ). However, D2HNet produces richer details since it fuses the information from the long-exposure input, where the textures are more distinguishable than the highly noisy short-exposure input. From $\sharp 3$ and $\sharp 4$ , single image deblurring methods cannot recover either small blur or severe blur. The superiority of D2HNet comes from two reasons. On one hand, although the other methods estimate motion fields from a single long-exposure input, D2HNet utilizes the position information from the short-exposure input to guide the deblurring. On the other hand, a domain gap exists between training and testing data. Without proper handling, these methods degrade to mainly removing noises when encountering very large blurs in the testing images. Whereas, our architecture involves the DeblurNet which operates on a fixed resolution to better generalize on large blur. We also report the quantitative performance of all methods on the validation set in Table 3 and 4. Compared with single-image-based methods, D2HNet obtains giant increases on both metrics since it fuses more information from both long- and short-exposure inputs.
+
+# 5.4 Ablation Study
+
+We conduct the ablation study for the D2HNet, where the benchmark results are concluded in Table 5 and visual results are illustrated in Figure $8^{1}$ . The analysis for different ablation study items is as follows:
+
+Training Strategy. Dual inputs are significant for D2HNet to get more performance gain. Compared with only using long- or short-exposure input (settings 1)
+
+
+Fig. 7. Visual comparisons of the proposed D2HNet with single image denoising methods (upper #1 and #2) and single image deblurring methods (lower #3 and #4).
+
+and 2)), two inputs improve PSNR by 9.68dB and 0.59dB, respectively. Aligning the long-exposure input with short-exposure input (i.e., $s_{first}$ as GT) also helps transfer textures from long-exposure input, which brings 4.51dB gain compared with $l_{last}$ as GT (setting 3). We can also see settings 1-3) cannot recover the details and remove artifacts (e.g., the face contour and eyes in #1).
+
+Network Components. Alignment block makes the D2HNet better fuses features from the long-exposure input. In setting 4), we replace deformable convolutions with ordinary convolutions, forcing the network to apply rigid filters at all the spatial locations in the features, which brings a decrease of $0.24\mathrm{dB}$ . In setting 5), we remove all Alignment and Feature fusion blocks, leading to a notable performance decrease of EnhanceNet (1.4dB) since the hierarchical information is excluded. From settings 6) and 7), the tail Residual block brings $0.5\mathrm{dB}$ gain, while the full EnhanceNet brings 4.19dB gain since it learns rich textures and details. In addition, settings 4-7) produce blurry outputs and vague details (i.e., the billboard in $\sharp 2$ ), which show the importance of every component.
+
+Data Processing Schemes. VarmapSelection balances the training data distribution, where D2HNet better generalizes to blurry or misaligned long-exposure inputs and learns to extract textures from them, e.g., D2HNet produces sharper results than setting 8) in $\sharp 2$ . Illumination Adjustment generates more low-brightness training images, helping the D2HNet obtain better performance in dark regions.
+
+
+Fig. 8. Visual comparisons of D2HNet ablation study.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Table 5. Comparisons of D2HNet and ablation settings on 1440p validation data.
+
+| Ablation Study Setting | PSNR | SSIM | Ablation Study Setting | PSNR | SSIM |
| 1) Only long input, \(l_{last}\) as ground truth | 24.99 | 0.8610 | 7) w/o EnhanceNet (only DeblurNet) | 30.48 | 0.9259 |
| 2) Only short input | 34.08 | 0.9579 | 8) w/o VarmapSelection | 34.24 | 0.9604 |
| 3) Long-short inputs, \(l_{last}\) as ground truth | 30.16 | 0.9293 | 9) w/o Illumination Adjustment | 34.31 | 0.9596 |
| 4) Replacing EnhanceNet Alignment block | 34.43 | 0.9610 | 10) w/o Color Adjustment | 34.58 | 0.9620 |
| 5) w/o EnhanceNet feature-level short-cuts | 33.27 | 0.9530 | 11) w/o CutNoise | 34.42 | 0.9616 |
| 6) w/o EnhanceNet tail Residual block | 34.17 | 0.9602 | D2HNet (full) | 34.67 | 0.9639 |
+
+Color Adjustment and CutNoise balance the usage of long-short inputs, encouraging sharper results. As shown in §3, if dropping each of them (settings 9-11)), the network cannot recover clear details of the black hair. Also, settings 8-11) result in the decreases of PSNR by $0.43\mathrm{dB}$ , $0.36\mathrm{dB}$ , $0.09\mathrm{dB}$ , and $0.25\mathrm{dB}$ , respectively. It is obvious that every data processing scheme is significant.
+
+# 6 Conclusion
+
+In this paper, we present a D2HNet framework for robust night image restoration based on long- and short-exposure inputs. It deblurs and restores sharp outputs from the long-exposure image under the guidance of the short-exposure image to obtain accurate colors, trivial noises, and sharp edges. It includes two sequential subnets: DeblurNet to remove blur on a fixed size and EnhanceNet to refine and sharpen the output of DeblurNet. For training, we synthesize the D2-Dataset including 6853 high-quality image tuples with multiple types and levels of blur. We propose a VarmapSelection scheme to generate highly blurry patches and assist the convergence of D2HNet. We also use a CutNoise scheme to enhance textures and details by enforcing D2HNet to learn how and where to deblur. For evaluation, we compare the proposed D2HNet with SOTA long-short fusion methods, and single image denoising and deblurring methods on the D2-Dataset validation set and real-world photos. The experimental results on both validation set and real-world photos show better performance achieved by the D2HNet.
+
+# References
+
+1. Abdelhamed, A., Brubaker, M.A., Brown, M.S.: Noise flow: Noise modeling with conditional normalizing flows. In: Proc. ICCV. pp. 3165-3173 (2019)
+2. Anwar, S., Barnes, N.: Real image denoising with feature attention. In: Proc. ICCV. pp. 3155-3164 (2019)
+3. Brooks, T., Mildenhall, B., Xue, T., Chen, J., Sharlet, D., Barron, J.T.: Unprocessing images for learned raw denoising. In: Proc. CVPR. pp. 11036-11045 (2019)
+4. Buades, A., Coll, B., Morel, J.M.: A non-local algorithm for image denoising. In: Proc. CVPR. vol. 2, pp. 60-65 (2005)
+5. Byun, J., Cha, S., Moon, T.: Fbi-denoiser: Fast blind image denoiser for poisson-gaussian noise. In: Proc. CVPR. pp. 5768-5777 (2021)
+6. Chakrabarti, A.: A neural approach to blind motion deblurring. In: Proc. ECCV pp. 221-235 (2016)
+7. Chan, K.C., Wang, X., Yu, K., Dong, C., Loy, C.C.: Basicvsr: The search for essential components in video super-resolution and beyond. In: Proc. CVPR. pp 4947-4956 (2021)
+8. Chan, K.C., Zhou, S., Xu, X., Loy, C.C.: Basicvsr++: Improving video superresolution with enhanced propagation and alignment. In: Proc. CVPR. pp. 5972-5981 (2022)
+9. Chang, M., Feng, H., Xu, Z., Li, Q.: Low-light image restoration with short-and long-exposure raw pairs. IEEE Trans. Multimedia 24, 702-714 (2021)
+0. Chen, C., Chen, Q., Xu, J., Koltun, V.: Learning to see in the dark. In: Proc CVPR. pp. 3291-3300 (2018)
+1. Chen, J., Chen, J., Chao, H., Yang, M.: Image blind denoising with generative adversarial network based noise modeling. In: Proc. CVPR. pp. 3155-3164 (2018)
+2. Chen, L., Lu, X., Zhang, J., Chu, X., Chen, C.: Hinet: Half instance normalization network for image restoration. In: Proc. CVPRW. pp. 182-192 (2021)
+3. Chen, Y., Pock, T.: Trainable nonlinear reaction diffusion: A flexible framework for fast and effective image restoration. IEEE Trans. Pattern Anal. Mach. Intell 39(6), 1256-1272 (2016)
+4. Cheng, S., Wang, Y., Huang, H., Liu, D., Fan, H., Liu, S.: Nbnet: Noise basis learning for image denoising with subspace projection. In: Proc. CVPR. pp. 4896-4906 (2021)
+5. Cho, S.J., Ji, S.W., Hong, J.P., Jung, S.W., Ko, S.J.: Rethinking coarse-to-fine approach in single image deblurring. In: Proc. ICCV. pp. 4641-4650 (2021)
+6. Choi, B.D., Jung, S.W., Ko, S.J.: Motion-blur-free camera system splitting exposure time. IEEE Trans. Consum. Electron. 54(3), 981-986 (2008)
+7. Dabov, K., Foi, A., Katkovnik, V., Egiazarian, K.: Image denoising by sparse 3-d transform-domain collaborative filtering. IEEE Trans. Image Process. 16(8), 2080-2095 (2007)
+8. Dai, J., Qi, H., Xiong, Y., Li, Y., Zhang, G., Hu, H., Wei, Y.: Deformable convolutional networks. In: Proc. ICCV. pp. 764-773 (2017)
+19. Deng, J., Wang, L., Pu, S., Zhuo, C.: Spatio-temporal deformable convolution for compressed video quality enhancement. In: Proc. AAAI. vol. 34, pp. 10696-10703 (2020)
+20. Dudhane, A., Zamir, S.W., Khan, S., Khan, F.S., Yang, M.H.: Burst image restoration and enhancement. In: Proc. CVPR. pp. 5759-5768 (2022)
+21. Gao, H., Tao, X., Shen, X., Jia, J.: Dynamic scene deblurring with parameter-selective sharing and nested skip connections. In: Proc. CVPR. pp. 3848-3856 (2019)
+
+22. Godard, C., Matzen, K., Uytendaele, M.: Deep burst denoising. In: Proc. ECCV. pp. 538-554 (2018)
+23. Gong, D., Yang, J., Liu, L., Zhang, Y., Reid, I., Shen, C., Van Den Hengel, A., Shi, Q.: From motion blur to motion flow: a deep learning solution for removing heterogeneous motion blur. In: Proc. CVPR. pp. 2319-2328 (2017)
+24. Gu, C., Lu, X., He, Y., Zhang, C.: Blur removal via blurred-noisy image pair. IEEE Trans. Image Process. 30, 345-359 (2020)
+25. Gu, S., Li, Y., Gool, L.V., Timofte, R.: Self-guided network for fast image denoising. In: Proc. ICCV. pp. 2511-2520 (2019)
+26. Guo, S., Yan, Z., Zhang, K., Zuo, W., Zhang, L.: Toward convolutional blind denoising of real photographs. In: Proc. CVPR. pp. 1712-1722 (2019)
+27. Guo, S., Yang, X., Ma, J., Ren, G., Zhang, L.: A differentiable two-stage alignment scheme for burst image reconstruction with large shift. In: Proc. CVPR. pp. 17472-17481 (2022)
+28. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proc. CVPR. pp. 770-778 (2016)
+29. Hu, X., Ma, R., Liu, Z., Cai, Y., Zhao, X., Zhang, Y., Wang, H.: Pseudo 3d autocorrelation network for real image denoising. In: Proc. CVPR. pp. 16175-16184 (2021)
+30. Ji, S.W., Lee, J., Kim, S.W., Hong, J.P., Baek, S.J., Jung, S.W., Ko, S.J.: Xydeblur: Divide and conquer for single image deblurring. In: Proc. CVPR. pp. 17421-17430 (2022)
+31. Jiang, H., Sun, D., Jampani, V., Yang, M.H., Learned-Miller, E., Kautz, J.: Super slomo: High quality estimation of multiple intermediate frames for video interpolation. In: Proc. CVPR. pp. 9000-9008 (2018)
+32. Karadeniz, A.S., Erdem, E., Erdem, A.: Burst photography for learning to enhance extremely dark images. IEEE Trans. Image Process. 30, 9372-9385 (2021)
+33. Kim, Y., Soh, J.W., Park, G.Y., Cho, N.I.: Transfer learning from synthetic to real-noise denoising with adaptive instance normalization. In: Proc. CVPR. pp. 3482-3492 (2020)
+34. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: Proc. ICLR (2014)
+35. Krishnan, D., Fergus, R.: Fast image deconvolution using hyper-laplacian priors. In: Proc. NeurIPS. pp. 1033-1041 (2009)
+36. Kupyn, O., Budzan, V., Mykhailych, M., Mishkin, D., Matas, J.: Deblurgan: Blind motion deblurring using conditional adversarial networks. In: Proc. CVPR. pp. 8183-8192 (2018)
+37. Kupyn, O., Martyniuk, T., Wu, J., Wang, Z.: Deblurgan-v2: Deblurring (orders-of-magnitude) faster and better. In: Proc. ICCV. pp. 8878-8887 (2019)
+38. Lamba, M., Mitra, K.: Restoring extremely dark images in real time. In: Proc. CVPR. pp. 3487-3497 (2021)
+39. Levin, A., Weiss, Y., Durand, F., Freeman, W.T.: Efficient marginal likelihood optimization in blind deconvolution. In: Proc. CVPR. pp. 2657-2664 (2011)
+40. Li, H., Wu, X.J.: Densefuse: A fusion approach to infrared and visible images. IEEE Trans. Image Process. 28(5), 2614-2623 (2018)
+41. Li, M., Liu, J., Yang, W., Sun, X., Guo, Z.: Structure-revealing low-light image enhancement via robust retina model. IEEE Trans. Image Process. 27(6), 2828-2841 (2018)
+42. Liba, O., Murthy, K., Tsai, Y.T., Brooks, T., Xue, T., Karnad, N., He, Q., Barron, J.T., Sharlet, D., Geiss, R., et al.: Handheld mobile photography in very low light. ACM Trans. on Graphics 38(6), 1-16 (2019)
+
+43. Liu, P., Zhang, H., Zhang, K., Lin, L., Zuo, W.: Multi-level wavelet-cnn for image restoration. In: Proc. CVPRW. pp. 773-782 (2018)
+44. Liu, W., Yan, Q., Zhao, Y.: Densely self-guided wavelet network for image denoising. In: Proc. CVPRW. pp. 432-433 (2020)
+45. Liu, Y., Qin, Z., Anwar, S., Ji, P., Kim, D., Caldwell, S., Gedeon, T.: Invertible denoising network: A light solution for real noise removal. In: Proc. CVPR. pp. 13365-13374 (2021)
+46. Liu, Z., Yuan, L., Tang, X., Uysettendaele, M., Sun, J.: Fast burst images denoising. ACM Trans. on Graphics 33(6), 1-9 (2014)
+47. Luo, Z., Yu, L., Mo, X., Li, Y., Jia, L., Fan, H., Sun, J., Liu, S.: Ebsr: Feature enhanced burst super-resolution with deformable alignment. In: Proc. CVPRW. pp. 471-478 (2021)
+48. Mao, X., Shen, C., Yang, Y.B.: Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections. In: Proc. NeurIPS. pp. 2802-2810 (2016)
+49. Mildenhall, B., Barron, J.T., Chen, J., Sharlet, D., Ng, R., Carroll, R.: Burst denoising with kernel prediction networks. In: Proc. CVPR. pp. 2502-2510 (2018)
+50. Mustaniemi, J., Kannala, J., Matas, J., Särkkä, S., Heikkilä, J.: Lsd2 - joint denoising and deblurring of short and long exposure images with convolutional neural networks. In: Proc. BMVC (2020)
+51. Nah, S., Hyun Kim, T., Mu Lee, K.: Deep multi-scale convolutional neural network for dynamic scene deblurring. In: Proc. CVPR. pp. 3883-3891 (2017)
+52. Nimisha, T.M., Kumar Singh, A., Rajagopalan, A.N.: Blur-invariant deep learning for blind-deblurring. In: Proc. ICCV. pp. 4752-4760 (2017)
+53. Park, D., Kang, D.U., Kim, J., Chun, S.Y.: Multi-temporal recurrent neural networks for progressive non-uniform single image deblurring with incremental temporal training. In: Proc. ECCV. pp. 327-343 (2020)
+54. Purohit, K., Rajagopalan, A.: Region-adaptive dense network for efficient motion deblurring. In: Proc. AAAI. vol. 34, pp. 11882-11889 (2020)
+55. Ren, C., He, X., Wang, C., Zhao, Z.: Adaptive consistency prior based deep network for image denoising. In: Proc. CVPR. pp. 8596-8606 (2021)
+56. Richardson, W.H.: Bayesian-based iterative method of image restoration. JoSA 62(1), 55-59 (1972)
+57. Rim, J., Lee, H., Won, J., Cho, S.: Real-world blur dataset for learning and benchmarking deblurring algorithms. In: Proc. ECCV. pp. 184-201 (2020)
+58. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. In: Proc. MICCAI. pp. 234-241 (2015)
+59. Rudin, L.I., Osher, S., Fatemi, E.: Nonlinear total variation based noise removal algorithms. Physica D: nonlinear phenomena 60(1-4), 259-268 (1992)
+60. Simoncelli, E.P., Adelson, E.H.: Noise removal via bayesian wavelet coring. In: Proc. ICIP. vol. 1, pp. 379-382 (1996)
+61. Son, C.H., Choo, H., Park, H.M.: Image-pair-based deblurring with spatially varying norms and noisy image updating. Journal of Visual Comm. and Image Rep. 24(8), 1303-1315 (2013)
+62. Son, C.H., Park, H.M.: A pair of noisy/blurry patches-based psf estimation and channel-dependent deblurring. IEEE Trans. Consum. Electron. 57(4), 1791-1799 (2011)
+63. Suin, M., Purohit, K., Rajagopalan, A.: Spatially-attentive patch-hierarchical network for adaptive motion deblurring. In: Proc. CVPR. pp. 3606-3615 (2020)
+64. Sun, J., Cao, W., Xu, Z., Ponce, J.: Learning a convolutional neural network for non-uniform motion blur removal. In: Proc. CVPR. pp. 769-777 (2015)
+
+65. Tai, Y., Yang, J., Liu, X., Xu, C.: Memnet: A persistent memory network for image restoration. In: Proc. ICCV. pp. 4539-4547 (2017)
+66. Tao, X., Gao, H., Shen, X., Wang, J., Jia, J.: Scale-recurrent network for deep image deblurring. In: Proc. CVPR. pp. 8174-8182 (2018)
+67. Tian, Y., Zhang, Y., Fu, Y., Xu, C.: Tdan: Temporally-deformable alignment network for video super-resolution. In: Proc. CVPR. pp. 3360-3369 (2020)
+68. Tico, M., Gelfand, N., Pulli, K.: Motion-blur-free exposure fusion. In: Proc. ICIP. pp. 3321-3324 (2010)
+69. Wang, X., Chan, K.C., Yu, K., Dong, C., Change Loy, C.: Edvr: Video restoration with enhanced deformable convolutional networks. In: Proc. CVPRW. pp. 1-10 (2019)
+70. Wang, Y., Cao, Y., Zha, Z.J., Zhang, J., Xiong, Z., Zhang, W., Wu, F.: Progressive retina: Mutually reinforced illumination-noise perception network for low-light image enhancement. In: Proc. ACM MM. pp. 2015-2023 (2019)
+71. Wang, Y., Huang, H., Xu, Q., Liu, J., Liu, Y., Wang, J.: Practical deep raw image denoising on mobile devices. In: Proc. ECCV. pp. 1-16 (2020)
+72. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process. 13(4), 600-612 (2004)
+73. Wei, K., Fu, Y., Yang, J., Huang, H.: A physics-based noise formation model for extreme low-light raw denoising. In: Proc. CVPR. pp. 2758-2767 (2020)
+74. Whang, J., Delbracio, M., Talebi, H., Sahara, C., Dimakis, A.G., Milanfar, P.: Deblurring via stochastic refinement. In: Proc. CVPR. pp. 16293-16303 (2022)
+75. Whyte, O., Sivic, J., Zisserman, A., Ponce, J.: Non-uniform deblurring for shaken images. Int. J. Comput. Vis. 98(2), 168-186 (2012)
+76. Xia, Z., Perazzi, F., Gharbi, M., Sunkavalli, K., Chakrabarti, A.: Basis prediction networks for effective burst denoising with large kernels. In: Proc. CVPR. pp. 11844-11853 (2020)
+77. Xing, Y., Qian, Z., Chen, Q.: Invertible image signal processing. In: Proc. CVPR. pp. 6287-6296 (2021)
+78. Xu, X., Li, M., Sun, W.: Learning deformable kernels for image and video denoising. arXiv preprint arXiv:1904.06903 (2019)
+79. Yoo, J., Ahn, N., Sohn, K.A.: Rethinking data augmentation for image superresolution: A comprehensive analysis and a new strategy. In: Proc. CVPR. pp. 8375-8384 (2020)
+80. Yuan, L., Sun, J., Quan, L., Shum, H.Y.: Image deblurring with blurred/noisy image pairs. ACM Trans. on Graphics 26(3), 1-es (2007)
+81. Yuan, Y., Su, W., Ma, D.: Efficient dynamic scene deblurring using spatially variant deconvolution network with optical flow guided training. In: Proc. CVPR. pp. 3555-3564 (2020)
+82. Yue, Z., Yong, H., Zhao, Q., Meng, D., Zhang, L.: Variational denoising network: Toward blind noise modeling and removal. Proc. NeurIPS 32, 1690-1701 (2019)
+83. Zamir, S.W., Arora, A., Khan, S., Hayat, M., Khan, F.S., Yang, M.H., Shao, L.: Cycleisp: Real image restoration via improved data synthesis. In: Proc. CVPR. pp. 2696-2705 (2020)
+84. Zamir, S.W., Arora, A., Khan, S., Hayat, M., Khan, F.S., Yang, M.H., Shao, L.: Learning enriched features for real image restoration and enhancement. In: Proc. ECCV. pp. 492-511 (2020)
+85. Zamir, S.W., Arora, A., Khan, S., Hayat, M., Khan, F.S., Yang, M.H., Shao, L.: Multi-stage progressive image restoration. In: Proc. CVPR. pp. 14821-14831 (2021)
+
+86. Zhang, B., Jin, S., Xia, Y., Huang, Y., Xiong, Z.: Attention mechanism enhanced kernel prediction networks for denoising of burst images. In: Proc. ICASSP. pp. 2083-2087 (2020)
+87. Zhang, H., Dai, Y., Li, H., Koniusz, P.: Deep stacked hierarchical multi-patch network for image deblurring. In: Proc. CVPR. pp. 5978-5986 (2019)
+88. Zhang, J., Pan, J., Ren, J., Song, Y., Bao, L., Lau, R.W., Yang, M.H.: Dynamic scene deblurring using spatially variant recurrent neural networks. In: Proc. CVPR. pp. 2521-2529 (2018)
+89. Zhang, J., Cao, Y., Fang, S., Kang, Y., Wen Chen, C.: Fast haze removal for nighttime image using maximum reflectance prior. In: Proc. CVPR. pp. 7418-7426 (2017)
+90. Zhang, K., Zuo, W., Chen, Y., Meng, D., Zhang, L.: Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Trans. Image Process. 26(7), 3142-3155 (2017)
+91. Zhang, K., Zuo, W., Zhang, L.: Ffdnet: Toward a fast and flexible solution for cnn-based image denoising. IEEE Trans. Image Process. 27(9), 4608-4622 (2018)
+92. Zhang, Y., Wang, C., Maybank, S.J., Tao, D.: Exposure trajectory recovery from motion blur. IEEE Trans. Pattern Anal. Mach. Intell. (2021)
+93. Zhang, Y., Tian, Y., Kong, Y., Zhong, B., Fu, Y.: Residual dense network for image restoration. IEEE Trans. Pattern Anal. Mach. Intell. 43(7), 2480-2495 (2020)
+94. Zhu, X., Hu, H., Lin, S., Dai, J.: Deformable convnets v2: More deformable, better results. In: Proc. CVPR. pp. 9308-9316 (2019)
\ No newline at end of file
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/images.zip b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d8306aa36598e87ac2c1f5acd4317326387d3eec
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c01b6dfba5efc89c8466daf9cec9689c8cb9b4f568f291545e4ffe5531d0b8da
+size 788828
diff --git a/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/layout.json b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f9568401da8a44861fff14a1430d98816014ad3c
--- /dev/null
+++ b/d2hnetjointdenoisinganddeblurringwithhierarchicalnetworkforrobustnightimagerestoration/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:64e75cbd0208b3c33f7fa29a54f34715f0762fb2078e8791dd562aff746c73ec
+size 526360
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_content_list.json b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a773e650156c77954f1e0a433c1cb339e8925509
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3fea10c7a8e466a31c8140185a5ea9d23b2787aff48b7289c341d9c757ca703f
+size 83852
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_model.json b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..557badc31ade73c058fa5258062b299bf4e6a74a
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dbcbad7234f74d9b8e8f2eb42415dfd678cb931f9a8ece7571a4b579e8a59737
+size 104787
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_origin.pdf b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7ed5e5cf2bbcfd9242223e86a7797fa950494ac5
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/531d6043-a1b1-49dc-a15c-a62d829d5b9e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bd54a4f06ee5c011fa96002a77a0e61b5960fb3f1ce2cc2f6b324edc1d422860
+size 4486996
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/full.md b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..aae296e280f5166b3f1cbae5367e78890b137f06
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/full.md
@@ -0,0 +1,295 @@
+# D2-TPred: Discontinuous Dependency for Trajectory Prediction under Traffic Lights
+
+Yuzhen Zhang $^{1}$ , Wentong Wang $^{2}$ , Weizhi Guo $^{1}$ , Pei Lv $^{1\boxtimes}$ , Mingliang Xu $^{1}$ , Wei Chen $^{3}$ , and Dinesh Manocha $^{4}$
+
+1 School of Computer and Artificial Intelligence, Zhengzhou University, Zhengzhou, China. zyzzhang@gs.zzu.edu.cn, {ielppei, iexumingliang}@zzu.edu.cn, ieguoweozhi@163.com
+
+$^{2}$ Henan Institute of Advanced Technology, Zhengzhou University, Zhengzhou, China. wangwentong@gs.zzu.edu.cn
+
+3 State Key Lab of CAD&CG, Zhejiang University, Zhejiang, China. chenwei@cad.zju.edu.cn
+
+$^{4}$ Department of Computer Science, University of Maryland, College Park, MD, USA. dmanocha@umd.edu
+
+Abstract. A profound understanding of inter-agent relationships and motion behaviors is important to achieve high-quality planning when navigating in complex scenarios, especially at urban traffic intersections. We present a trajectory prediction approach with respect to traffic lights, D2-TPred, which uses a spatial dynamic interaction graph (SDG) and a behavior dependency graph (BDG) to handle the problem of discontinuous dependency in the spatial-temporal space. Specifically, the SDG is used to capture spatial interactions by reconstructing sub-graphs for different agents with dynamic and changeable characteristics during each frame. The BDG is used to infer motion tendency by modeling the implicit dependency of the current state on priors behaviors, especially the discontinuous motions corresponding to acceleration, deceleration, or turning direction. Moreover, we present a new dataset for vehicle trajectory prediction under traffic lights called VTP-TL. Our experimental results show that our model achieves more than $20.45\%$ and $20.78\%$ improvement in terms of ADE and FDE, respectively, on VTP-TL as compared to other trajectory prediction algorithms. The dataset and code are available at: https://github.com/VTP-TL/D2-TPred.
+
+Keywords: Spatial dynamic interaction graph, behavior dependency graph, discontinuous dependency, traffic lights
+
+# 1 Introduction
+
+The interaction relationships and behavioral intentions of vehicles or agents are frequently used for autonomous driving [4,27,32]. A key problem is to predict the future trajectory of each vehicle or road agent, which is used to perform safe navigation or traffic forecasting [1,40,6,48]. Existing trajectory prediction methods are mainly designed to extract the spatial-temporal information from
+
+
+Fig. 1. Illustration of discontinuous dependency among vehicles at crossroad intersection near traffic lights. We highlight the local trajectories of four vehicles, $v_{1} \ldots v_{4}$ using black directed curves. The orange boxes represent the influence area of the corresponding traffic lights, which are fixed regions and restrict the motion behavior of vehicles while they are passing. We show the position of three vehicles, $v_{1}, v_{2}, v_{3}$ at time $t_{1}$ and $t_{5}$ , along with the corresponding green boxes which show the dynamic interaction area determined by the moving vehicles. The purple directed edges within each green box represent the interactions among vehicles. In this case, $v_{3}$ interacts with $v_{1}$ and $v_{2}$ at time $t_{1}$ . However, $v_{3}$ is not affected by $v_{1}$ at time $t_{5}$ , even though it is located in the same region. This indicates the discontinuity in the interaction between $v_{1}$ and $v_{3}$ during this time period. The vehicle $v_{4}$ located in the influence areas is not constrained by the red light because it is right-turning.
+
+spatial interactions and behavior modeling. In terms of spatial interaction, most previous works determine the interaction among objects according to the predefined interaction areas, such as the entire scene [1,40,36,42,48], localized regions [2,12,6], and the area corresponding to visual attention [19]. However, these methods do not fully consider the varying interactions and dependency between neighbors that occur due to different behaviors, such as changing lanes or turning directions that can lead to new pairwise interactions. In terms of behavior dependency, these prediction algorithms obtain the relevant information of the current state from previous states based on LSTM-based methods [23,48] or graph-based approaches [29,38].
+
+In this paper, we address the problem of trajectory prediction in areas close to traffic lights or intersections. Due to the constraints of traffic signs and traffic lights with red, green, and yellow states labeled by discrete indexes, the vehicles usually do not exhibit the first-order continuity in their movement behaviors with stopping, going straight, turning right, and turning left. Instead, their trajectory is governed by the discontinuous effects from the environment or other agents. For example, in the green boxes of Figure 1, the interactions among vehicle $v_{1}$ , $v_{2}$ and $v_{3}$ change from time $t_{1}$ to $t_{5}$ . Even though these vehicles are within the same interaction regions determined by distance which shown using green boxes,
+
+the spatial and behavior interaction between the vehicles changes considerably and we need to model such changes. For vehicle $v_{4}$ , the most important influence on its current state is the change in its behavior due to the right-turn, rather than the movement state in adjacent timestamp. We refer to these phenomena as discontinuous dependency (D2), which makes accurate spatial-temporal feature extraction extremely challenging. Current trajectory prediction methods do not fully account for this property that the trajectories of traffic agents are usually not first-order continuous due to the frequent starting and stopping motions.
+
+Main Results: In order to model the discontinuous dependency between traffic agents, we present a new trajectory prediction approach (D2-TPred). In our formulation, we construct a spatial dynamic interaction graph (SDG) for different traffic agents in one frame. Each traffic agent is regarded as a graph node and we compute appropriate edges to model its interactions with other changing neighboring agents determined by visual scope, distance, and lane index as well as discontinuous dependencies in terms of their relative positions. Moreover, a behavior dependency graph (BDG) is computed for each agent to model the discontinuities with respect to their behaviors at previous time instances, rather than only adjacent timestamp. Specifically, to avoid the key behavioral features such as acceleration, deceleration, or turning direction, may be filtered by forget gates or the error will be accumulated in sequential prediction by RNN network, the way of dependency information passing between adjacent frames is replaced by a GAT (graph attention network) [31], and the behavior dependency is modeled along the edges in the BDG. The SDG and BDG are used as part of a graph-based network for trajectory prediction.
+
+We also present a new dataset for vehicle trajectory prediction, VTP-TL. Our dataset consists of traffic pattern at urban intersections with different traffic rules, such as crossroads, T-junctions intersections, and roundabouts, containing 2D coordinates of vehicle trajectory and more than 1000 annotated vehicles at each traffic intersection. The novel components of our work include:
+
+1. We propose a novel trajectory prediction approach, D2-TPred, that accounts for various discontinuities in the vehicle trajectories and pairwise interactions near traffic lights and intersections.
+2. We present two types of data structure to improve the performance of graph-based networks to model dynamic interactions and vehicle behaviors. SDG is used to model spatial interactions by reconstructing appropriate sub-graphs for dynamic agents with constantly changing neighbors in each frame. BDG is used to model the dynamically changing behaviors dependency of current state on previous behaviors. The usage of SDG and BDG improves the prediction accuracy by $22.45\%$ and $29.39\%$ in ADE and FDE.
+3. We present a new dataset VTP-TL that corresponds to traffic video data near traffic lights and interactions. This includes 150 minutes of video clips at 30fps corresponding to challenging urban scenarios. They are captured using drones at $70 - 120$ meters above the traffic intersections.
+
+# 2 Related Work
+
+A brief overview of prior work on graph neural networks, interaction models, and motion pattern dependency is given.
+
+Graph Neural Networks: Graph Neural Network (GNN) [58] can model social or other interactions between agents. Prior trajectory prediction methods based on GNN can be divided into two categories. The first is based on undirected graphs, which utilize the graph structure to explicitly construct interactions and assign the same weight for each pair of nodes, e.g., STUGCN [55], Social-STGCNN [29]. The second is based on Graph attention networks (GAT) [31], which introduces an attention mechanism into the undirected graph to calculate asymmetric influence weights for interactive agents. The GAT-based approaches, such as Social-BiGAT [43], STGAT [23], EvolveGraph [24], and SGCN [38], can flexibly model asymmetric interactions to compute spatial-temporal features and improve the prediction accuracy. Meanwhile, EvolveGraph [24] and SGCN [38] introduce graph structure inference to generate dynamic and sparse interaction. Different from these methods, we directly construct one directed graph according to interactive objects determined by the visual scope, distance, and traffic rules, and use GATs to represent the asymmetric interactions among agents.
+
+Social Interaction Models: Social interactions and related information are used by traffic agents to make reasonable decisions to avoid potential collisions. Social force-based methods [13,33,49] use different types of force to model acceleration and deceleration forces. Social pooling based approaches [2,12,1,40] try to integrate motion information of neighbors within a radius. GNN-based techniques [42,43,24,29,41,23,46] use graph structures to directly model the interactions among near and far agents. These methods assume that the underlying agents interact with all other agents in a predefined or nearby regions. They do not account for those neighbors need to be pruned, especially moving along the opposite lanes.
+
+Motion Models: Motion models are used to infer the motion information as part of trajectory prediction. Early studies have focused on forecasting future trajectories based on a linear model, constant velocity model, or constant acceleration model [52]. However, these simple models can not handle complex traffic patterns. Furthermore, LSTM-based approaches [2,1,23,39] and graph structure-based approaches [54,55,29,38] are proposed to model the motion trajectories. Other techniques take into account driver behavior patterns [7,3]. Giuliani et al. [17] perform precise trajectory prediction using transformer networks. Here, the states of an agent in temporal sequence are regarded as nodes to construct directed graph, further achieve the direct influence between discontinuous timestamps, rather than only adjacent one.
+
+# 3 D2-TPred
+
+In this section, we present our novel learning-based trajectory prediction algorithm, which involves the influence of traffic lights on motion behaviors, and the architecture is shown in Figure 2.
+
+
+Fig. 2. Architecture of our proposed D2-TPred model. The spatial dynamic interaction graph is used to represent the dynamic interactions and we reconstruct the sub-graphs. The behavior dependency graph learns the movement features by estimating the effect of agent behavior. The discriminator is used to refine the predicted trajectories. The traffic light module is used to predict the trajectories at urban intersections.
+
+# 3.1 Problem Formulation
+
+Given spatial coordinate and traffic light state of $N$ agents in each scenario, we aim to predict the most likely trajectories of these agents in the future. At any time $t$ , the state of the $i$ th agent $Sq_{i}$ at time $t$ can be denoted as $Sq_{i}^{t} = (Fid, Aid, x_{i}^{t}, y_{i}^{t}, Lid, pa_{i}^{t}, f_{i}^{t}, mb_{i}^{t}, lid_{i}^{t}, ls_{i}^{t}, lt_{i}^{t})$ , where $p_{i}^{t} = (x_{i}^{t}, y_{i}^{t})$ represents the position coordinate and the other symbols represent the corresponding traffic light information described with more detail in Section 3.3. According to the inputs of all agents in the interval $[1:t_{obs}]$ , our method can predict their position at next moment $t_{pred} \in [t_{obs} + 1:T]$ . Different from the ground truth trajectory $Lq_{i}^{t_{pred}}$ , $\hat{L} q_{i}^{t_{pred}}$ notates the predicted trajectory.
+
+# 3.2 Spatio-Temporal Dependency
+
+Spatial Dynamic Interaction Graph. Unlike prior methods [23,29], we reconstruct the sub-graphs to model all the interactions in each frame. We illustrate our approach to model discontinuous dependency by highlighting one scenario with 7 vehicles and appropriate trajectories in Figure 3. Similar to [19], the visual area of a subject is treated as frustum, where different visual ranges are set between road and intersection by considering the characteristics of human visual system. At time $t_1$ , $v_2$ , $v_3$ , and $v_7$ are located in the visual area of neighborhood of $v_1$ . However, the motion behavior of $v_1$ is not affected by $v_7$ , which moves in the opposite lane. Hence, we construct sub-graph $G_1$ corresponding to the interactions among vehicles $v_1$ , $v_2$ , and $v_3$ , and sub-graph $G_3$ for vehicles $v_5$ and $v_6$ . Moreover, for vehicles $v_4$ and $v_7$ without nearby neighbors, we compute
+
+
+Fig. 3. The spatial dynamic interaction graph (SDG). The left part of the figure shows the scene from time $t_1$ to $t_5$ , and the right part represents the reconstructed interaction sub-graphs at different time instances.
+
+sub-graphs $G_{2}$ and $G_{4}$ , respectively. Based on these sub-graphs, the intermediate states of these vehicles are updated. Since the interactions between the vehicles change dynamically, vehicle $v_{1}$ is not affected by vehicle $v_{3}$ at time $t_{2}$ . Even though they are within the same interaction region determined by distance, the influence of vehicle $v_{3}$ on vehicle $v_{1}$ is not the same between adjacent frames. In this manner, we reconstruct the corresponding sub-graphs $G_{5}$ , $G_{13}$ to represent these varying interactions between the vehicles.
+
+Considering the asymmetry of interactions among agents, we use a self-attention mechanism into these constructed directed graphs to model the spatial interactions. For agent $i$ at time $t$ , we first determine its interactive objects $j$ according to the visual scope $\theta$ , distance $d$ , and lane index $Lid$ , and the corresponding matrix $V$ , $D$ , and $L$ respectively.
+
+$$
+\left\{ \begin{array}{l} V [ i, j ] = 1, \quad i f \theta (\vec {i j}) \in \theta , \\ D [ i, j ] = 1, \quad i f \left\| p _ {j} ^ {t} - p _ {i} ^ {t} \right\| _ {2} \leq d, \\ L [ i, j ] = 1, \quad i f L i d _ {i} ^ {t} = L i d _ {j} ^ {t}, \\ R = V \times D \times L \end{array} \right. \tag {1}
+$$
+
+where $R$ filled with 0 and 1 represents adjacency matrix among agents, and we further construct sub-graph based on it. We then calculate the spatial state $h s_{i}^{t}$ by integrating the hidden states $h_{j}^{t}$ from interactive objects.
+
+$$
+e _ {i} ^ {t} = \varPhi (p _ {i} ^ {t}, W _ {p}), h _ {i} ^ {t} = L S T M (h _ {i} ^ {t - 1}, e _ {i} ^ {t}, W _ {l}), \qquad \qquad (2)
+$$
+
+$$
+h s _ {i} ^ {t} = \sum_ {j \in \mathcal {N} _ {i} ^ {t}} \left(a _ {i j} ^ {t} R _ {i j} ^ {t}\right) h _ {j} ^ {t}, \tag {3}
+$$
+
+where $\varPhi(\cdot)$ is an embedding function, and $e_i^t$ is the state vector of agent $i$ at time $t$ . Similar to method [14], $a_{ij}^{t}$ represents the attention coefficient of agent $j$ to $i$ at timestamp $t$ , $W_{p}$ and $W_{l}$ are embedding matrix and LSTM cell weight.
+
+
+Fig. 4. The behavior dependency graph (BDG). The lower part refers to the encoding process of trajectories and traffic light signals. The upper part describes behavior dependency, where segments with the same color refer to a temporal dependency graph.
+
+Behavior Dependency Graph. To avoid the key behavioral features may be filtered by forget gate of RNN network in process of information passing, we model the discontinuous dependency from previous behaviors to the current state by using GATs, rather than only adjacent timestamps. Specifically, for a given vehicle, its states updated by SDG are regarded as nodes. We model discontinuous dependency in the temporal sequence as edges and construct a directed graph, where the behavior information is transferred along the directed edges. The detailed architecture of the BDG for a given agent is shown in Figure 4.
+
+Specifically, for agent $i$ , we use directed segments with the same color to constitute an unfolded BDG, and different colors represent the behavior dependency graphs at different time instances. The BDG uses the state $hs_i^t$ generated by the SDG. Its current state is updated and embed into the behavior dependency graph at the next time instance, where dependency weights among nodes are calculated by using a self-attention mechanism. As shown in the dashed box of Figure 4, the motion state of agent $i$ at current moment $t + 2$ is governed by the previous behaviors at time $t + 1$ , $t$ , $t - 1$ , $t - 2$ , $t - 3$ , and $t - 4$ , etc., whereas the next instance $t + 3$ is governed by $t + 2$ , $t + 1$ , $t$ , $t - 1$ , $t - 2$ , and $t - 3$ . In this way, the updated hidden state $hb_i^t$ for agent $i$ at time $t$ is calculated as follows:
+
+$$
+\begin{array}{l} a _ {i} ^ {t t ^ {\prime}} = \operatorname {s o f t m a x} \left(\frac {\exp \left(\text {L e a k y R e L U} ^ {*} \left(\beta^ {T} \left[ \text {W h s} _ {i} ^ {t} \| \text {W h b} _ {i} ^ {t ^ {\prime}} \right]\right)\right)}{\sum_ {t ^ {\prime}} ^ {t} \exp \left(\text {L e a k y R e L U} ^ {*} \left(\beta^ {T} \left[ \text {W h s} _ {i} ^ {t} \| \text {W h b} _ {i} ^ {t ^ {\prime}} \right]\right)\right)}\right), \tag {4} \\ h b _ {i} ^ {t} = \sum_ {t ^ {\prime} \in (t - k) a n d t ^ {\prime} \geq 0} ^ {t} a _ {i} ^ {t t ^ {\prime}} (h b _ {i} ^ {t ^ {\prime}}, h s _ {i} ^ {t}), \\ \end{array}
+$$
+
+where $k$ represents the experimental estimated time window whose quantitative results have the lowest prediction error by obtaining more effective behavior feature. $\beta^T$ is the weight vector of a single-layer feedforward neural network. $t'$ denotes a specific time instance in the previous frames from $t - k$ to $t$ .
+
+# 3.3 Trajectory Prediction near Traffic Lights
+
+In this section, we present two prediction schemes for the vehicle trajectory prediction. The first scheme considers the discontinuous constraints on vehicles' behaviors caused by the alternation of traffic light states, where the traffic lights are regarded as indicator signals with fixed position and alternating states. The second scheme is designed for scenarios without traffic lights, which is described in detail in the supplementary material https://github.com/VTP-TL/D2-TPred.
+
+Given the observed sequence: $Sq_{i}^{t} = (Fid, Aid, x, y, Lid, pa, f, mb, lid, ls, lt)$ , which is divided by the vehicle trajectory $q = (Fid, Aid, x, y, Lid, pa, f, mb)$ and the corresponding traffic light states sequence $LS = (Fid, lid, ls, lt)$ . $Fid$ , $Aid$ , and $Lid$ are the index of frame, vehicle, and lane where the vehicle located, respectively. $lid_{i}^{t}$ is the traffic light index. $pa_{i}^{t}$ describes whether vehicle $v_{i}$ is within the influence area of corresponding traffic light. $f_{i}^{t}$ indicates whether vehicle $v_{i}$ is closest to the parking line in the influence area. $mb_{i}^{t}$ represents the movement behavior of one agent, such as turning-left, turning-right, or going-straight. $ls_{i}^{t}$ and $lt_{i}^{t}$ respectively describe the state and duration of traffic light. We take into account that the vehicle trajectory is continuous and the traffic light states sequence is periodic and discontinuous. Therefore, the two different encoders, LSTM and MLP, are utilized to handle them and compute the corresponding hidden states $h_{i}^{t}$ and $lh_{i}^{t} = MLP(LS_{i}^{t}, W_{M})$ , respectively. In SDG, we use GAT to integrate influencing features from nearby interacting agents and then compute the updated state $hs_{i}^{t}$ of agent $i$ . In terms of behavior dependency, we first concatenate the state $hs_{i}^{t}$ (Eq. 4) and traffic lights state $lh_{i}^{t}$ as input $\tilde{H}L_{i}^{t}$ , and then use these results to construct BDG. Based on the BDG, we can model discontinuous constraints of traffic lights on the movement behaviors of vehicles, as shown in Figure 4. In this stage, hidden state $HLB_{i}^{t}$ is computed as a weighted sum of $HLB_{i}^{1:(t-1)}$ , where the dependency weights are calculated by a self-attention mechanism. The resulting equations:
+
+$$
+\tilde {H} L _ {i} ^ {t} = i n t e g r a t e (h s _ {i} ^ {t}, l h _ {i} ^ {t}, W _ {l}), H L b _ {i} ^ {t} = G A T (\tilde {H} L _ {i} ^ {t}, H L b _ {i} ^ {1: t}, W _ {\tilde {\theta}}), \quad (5)
+$$
+
+where $\text{integrate}(\cdot)$ is concatenation operation. $W_{l}$ , and $W_{\tilde{\theta}}$ are the embedding weights. To augment behavior feature and avoid the feature loss filtered by forget gates in process of sequence, the intermediate state are generated by integrating the sate $H L b_{i}^{t}$ and original state $h_{i}^{t}$ . The predicted position is given by:
+
+$$
+\hat {L} q _ {i} ^ {t _ {p r e d}} = \sigma \left(D _ {L S T M} \left(\left[ H L b _ {i} ^ {t}, h _ {i} ^ {t} \right], W _ {d}\right)\right). \tag {6}
+$$
+
+where $D_{LSTM}$ and $W_{d}$ are the decoder based LSTM and corresponding weight respectively. $\sigma (\cdot)$ represents a linear layer. Our method is also GAN-based model integrating a discriminator $D_{cls}$ into the predicted approach, which utilizes LSTM and MLP to respectively encode the complete trajectory $([Sq_i^{T_{obs}},\hat{L} p_i^{T_{pred}}])$ and traffic light sequence $LS$ , and then concatenate them as the input into the Discriminator to output a real/fake probability $probL_{i}$ by by a linear network.
+
+$$
+p r o b L _ {i} = D _ {c l s} (L S T M ([ S q _ {i} ^ {t _ {o b s}}, \hat {L} q _ {i} ^ {t _ {p r e d}} ], W _ {l}), M L P (L S _ {i}, W _ {M})) \qquad (7)
+$$
+
+Table 1. VTP-TL vs other state-of-the-art traffic datasets. Size represents the number of annotated frames. $E_V$ and $B_V$ represent the egocentric vision and bird's view.
+
+| Datasets | Location | View | Night | Road type | Size | Traffic lights |
| CityScapes [10] | Europe | \(E_V\) | × | urban | 25K | × |
| Argoverse [9] | USA | \(E_V\) | √ | urban | 22K | × |
| INTERACTION [45] | International | \(B_V\) | × | urban | - | × |
| ApolloScape [50] | China | \(E_V\) | √ | urban + rural | 144K | × |
| TRAF [6] | India | \(E_V\) | √ | urban + rural | 72K | × |
| D2-city [57] | China | \(E_V\) | × | urban | 700K | × |
| inD [5] | Germany | \(B_V\) | × | urban | - | × |
| Lyft Level5 [21] | USA | \(E_V\) | × | urban | 46K | × |
| nuScenes [20] | USA/Singapore | \(E_V\) | √ | urban | 40K | × |
| Waymo [37] | USA | \(E_V\) | √ | urban | 200K | √ |
| Waterloo [44] | Canada | \(B_V\) | × | urban | - | √ |
| IDD [16] | India | \(E_V\) | × | urban + rural | 10K | × |
| METEOR [35] | India | \(E_V\) | √ | urban + rural | 2027K | × |
| VTP-TL | China | \(B_V\) | √ | urban | 270K | √ |
+
+For each vehicle, we calculate displacement error by variety loss in [1]. The model predicts multiple trajectories $K$ , and chooses the trajectory with the lowest distance error between them and ground-truth trajectory as the model output.
+
+$$
+L o s s _ {v a r i e t y} = \min _ {K} \left\| L q _ {i} - \hat {L} q _ {i} ^ {K} \right\| _ {2}. \tag {8}
+$$
+
+Through considering the best trajectory, the loss encourages network to cover the space of outputs that conform to the past trajectory.
+
+# 3.4 VTP-TL Dataset
+
+Although plenty of datasets have been constructed to evaluate the performance of trajectory prediction (Table 1), they rarely contained the important attributes of traffic lights except for Waymo and Waterloo. More details and their differences are described in our supplementary materials. For our new traffic dataset, VTP-TL, we use drones to hover at 70 to 120 meters above the traffic intersections in an urban setting, as statically as possible, to record vehicle trajectories passing through the area with a bird's-eye view in the daytime corresponding to non-rush hours, rush hours, and during the evening. The dataset contains more than 150 minutes video clips, over $270k$ annotated frames, and more than 4 million bounding boxes for traffic vehicles at three typical urban scenarios: crossroads, T-junctions, and roundabouts intersections. Specifically, according to these recorded videos including traffic lights when they are visible, we infer the invisible state in the videos since the pattern of traffic lights are fixed. Therefore, we manually mark the related attributes of traffic light signals as discrete index, such as the index, state, duration, and position coordinate, and high definition maps such as lanes, crosswalks, and stop lines. Compared with Waymo, the traffic lights are annotated as independent objects, and modeled as agents with fixed position and changeable states in our prediction framework.
+
+
+(a)The total number of vehicles at each scenes
+
+
+(b)The number range of vehicles per frame
+
+
+(c)The time proportion of each traffic light
+(d) The number of passing vehicles at rush and non-rush hour
+Fig. 5. We highlight the traffic light states and vehicles behaviors in various videos in VTP-TL. The detailed descriptions are given in the appendix.
+
+
+
+The center of bounding box is regarded as the position coordinates of vehicle. Finally, we obtain a new dataset of vehicles trajectory prediction containing over 1288 vehicles driving straight, 801 vehicles turning left, and 2584 vehicles turning right. Our dataset is divided into training, validation, and testing sets at a ratio of 4:1:1, and down-sampled to 3 frames per second for experiments.
+
+We also perform statistical analysis on the VTP-TL dataset, and the corresponding results are shown in Figure 5. The number of vehicles with different motion behaviors at each urban intersection are shown in Figure 5(a). Considering different traffic rules at various urban intersections, we also count the number range of passing vehicles per frame as Figure 5(b). Meanwhile, to ensure the effective passing of vehicles, different cycle time for traffic lights is set at different intersections (shown in Figure 5(c)). In Figure 5(d), we count the number of vehicles in the daytime of the rush and non-rush hours in 10 minutes. These descriptions can fully represent a large number of vehicles' behaviors are constrained by traffic lights. The user identifiers and exact date of publication have been masked off to protect privacy. The dataset would only be available for research purposes. More details are given in the supplementary materials.
+
+# 4 Experimental Evaluation
+
+In our experiments, the dimension of the embedding layer and the hidden state are set as 16 and 32, respectively. We also set the fixed input dimension as 64 and use the attention layer of 64. During training, the Adam optimizer is applied with a learning rate of 0.01 and batch size of 64.
+
+Table 2. Quantitative results of prediction performance on traffic datasets. The ADE/FDE are calculated for each dataset. The bold fonts correspond to the best results with the lowest error among predicted 20 possible trajectories for each agent, except INTER (INTERACTION) where the lowest error among predicted 6 possible trajectories. For Waymo, we implement those baseline methods according to their open source code, while the other experimental values of comparison methods are all described in open papers. - denotes methods have not been validated on those datasets.
+
+| Method | Apolloscape | Method | SDD | INTER | Method | Waymo |
| TPNet [15] | 2.23/4.70 | EvolveGraph [24] | 13.9/22.9 | - | SGAN [1] | 6.01/11.40 |
| CS-LSTM [12] | 2.14/11.70 | Goal-Gan [11] | 12.2/22.1 | - | Social-LSTM [2] | 4.05/7.59 |
| G-LSTMS[8] | 1.12/2.05 | SimAug [26] | 10.27/19.71 | - | STGAT [23] | 1.68/3.70 |
| SGAN [1] | 3.98/6.75 | LB-EBM [30] | 8.87/15.61 | - | SGCN [38] | 1.02/2.26 |
| TraPHic [6] | 1.28/11.67 | DESEIRE [25] | 19.3/34.1 | 0.32/0.88 | | |
| NLNI [56] | 1.09/1.55 | HEAT [28] | - | 0.19/0.66 | | |
| AI-TP [53] | 1.16/2.13 | TNT [18] | - | 0.21/0.67 | | |
| GRIP++ [47] | 1.25/2.34 | MultiPath [51] | - | 0.30/0.99 | | |
| D2-TPred | 1.02/1.69 | D2-TPred | 8.24/15.89 | 0.29/0.62 | D2-TPred | 0.85/1.89 |
+
+Evaluation Datasets. We evaluate proposed model on four traffic datasets, Apolloscape [50], SDD [34], INTERACTION [45], and Waymo [37]. In addition, we also report the experiments on our new dataset VTP-TL.
+
+Evaluation Metrics. We use the same evaluating metrics as [23,41,22]. Average displacement error (ADE) represents the average square error between the predicted trajectory and the ground truth trajectory for all agents at all frames. Final displacement error (FDE) represents the mean distance between the predicted path and ground truth trajectory for all agents at the final frame.
+
+Comparable methods. Social-LSTM [2] models spatial interaction by pooling mechanism. CS-LSTM [12], TraPHic [6] and GRAPH-LSTM [8] combine CNN with LSTM to perform trajectory prediction. SGAN [1], SGCN [38], and Goal-Gan [11] use GAN to model spatial interactions and physical attentions. Social Attention [42], AI-TP [53], Trajectron++ [41], GRIP++ [47], NLNI [56], EvolveGraph [24], and STGAT [23] integrate graph structure and attention mechanism to extract spatial-temporal interaction features. TPNet [15] and DESIRE [25], integrate scene context into prediction framework. NMMP [22] models the directed interaction with the neural motion message passing strategy. SimAug [26] is trained only on 3D simulation data to predict future trajectories. LB-EBM [30] is a probabilistic model with cost function defined in the latent space to account for the movement history and social context for diverse human trajectories. HEAT [28], TNT [18], and MultiPath [51] are used on INTERACTION and reported in [18].
+
+# 4.1 Quantitative Evaluation
+
+We have performed the detailed quantitative evaluation. On traffic datasets Apolliscape, SDD, INTERACTION, Waymo, and VTP-TL, the quantitative results of prediction performance for D2-TPred and other trajectory prediction methods are shown in Table 2 and Table 3.
+
+Table 3. Quantitative results on VTP-TL dataset. We compare with the baseline methods and compute the ADE and FDE metrics by using 8 time steps to predict 12 future frames. +TL represents that traffic light states is embedded into the trajectory prediction system. The bold fonts correspond to the best results, which are the lowest error among predicted 20 possible trajectories for each agent.
+
+| Metrics | Comparable models (in pixels) |
| Social Lstm | Social Attention | SGAN | STGAT | Trajectory++ | NMMP | D2-TPred |
| ADE | 54.328 | 43.648 | 37.63 | 28.279 | 39.01 | 35.15 | 20.685 |
| FDE | 112.635 | 97.614 | 75.35 | 61.762 | 118.37 | 70.35 | 47.296 |
| Metrics | Comparable models+TL (in pixels) |
| Social Lstm | Social Attention | SGAN | STGAT | Trajectory++ | NMMP | D2-TPred |
| ADE | 45.04 | 34.460 | 31.56 | 21.245 | 35.456 | 32.33 | 16.900 |
| FDE | 78.52 | 75.825 | 65.67 | 43.620 | 114.365 | 66.35 | 34.553 |
+
+Traffic datasets without traffic lights: Taking benefits from the SDG and BDG to extract spatio-temporal features, our method achieves competitive performance in the datasets shown in Table 2. Specifically, the performance of our method significantly outperforms comparative methods on Apolloscape. In SDD dataset with a large number of different scenarios, we observe the lowest error on ADE and the third-lowest error on FDE, as well as the lowest error on the FDE on INTER (INTERACTION). Moreover, we also achieve the best performance on Waymo Open Motion dataset by observing 8 frames to predict the next 12 frames. These demonstrate that our model can effectively capture the dynamic changeable interaction features and behavior dependency in complex traffic scenarios. More experimental results on other datasets such as ETH-UCY, Argoverse, nuScenes and inD are described in our supplementary materials.
+
+VTP-TL dataset with traffic lights: In this section, we describe D2-TPred+TL, which introduces traffic light states into D2-TPred approach. In Table 3, we evaluate our model against comparable methods, and all these methods against themselves with traffic lights. The experimental results show our method outperforms all other methods on the VTP-TL dataset in terms of ADE and FDE. Notably, compared with STGAT with the lowest prediction error, the ADE and FDE of D2-TPred+TL are reduced by $20.45\%$ and $20.78\%$ . This illustrates we can effectively model constraints of traffic lights on motion behaviors.
+
+# 4.2 Ablation Studies
+
+We present the ablation studies on VTP-TL with traffic light. This not only demonstrates the significance of each component but also highlights the benefits of modeling discontinuity due to traffic lights on vehicle movement behavior.
+
+Evaluation of the SDG and BDG: To show the effectiveness of the SDG and BDG, we compare $S_{G} + B_{B} + TL_{M} + D$ , $S_{S} + B_{L} + TL_{M} + D$ with $S_{S} + B_{B} + TL_{M} + D$ in Table 4. $S_{S} + B_{B} + TL_{M} + D$ can reduce ADE by $13.93\%$ and $15.85\%$ , and FDE by $17.34\%$ and $22.46\%$ , respectively. This directly illustrates that the SDG and BDG can effectively capture discontinuous dependency in spatial-temporal space to further improve the accuracy of prediction trajectories.
+
+Table 4. The ablation results on VTP-TL dataset. S denotes spatial interaction achieved by GAT $(S_G)$ or SDG $(S_S)$ . B denotes behavior dependency achieved by LSTM $(B_L)$ or BDG $(B_B)$ . TL denotes traffic light encoder as LSTM $(TL_L)$ or MLP $(TL_M)$ . D denotes the discriminator. The bold fonts correspond to the best results.
+
+| Setting | S | B | TL | D | Metrics |
| GAT | SDG | LSTM | BDG | LSTM | MLP | D | ADE / FDE |
| SG+BL+TLM+D | ✓ | | ✓ | | | ✓ | ✓ | 21.792 / 48.936 |
| SG+BB+TLM+D | ✓ | | | ✓ | | ✓ | ✓ | 19.635 / 41.804 |
| SS+BL+TLM+D | | ✓ | ✓ | | | ✓ | ✓ | 20.082 / 44.560 |
| SS+BB+TLL+D | | ✓ | | ✓ | ✓ | | ✓ | 17.896 / 37.629 |
| SS+BB+TLM | | ✓ | | ✓ | | ✓ | | 18.626 / 39.598 |
| SS+BB+TLM+D | | ✓ | | ✓ | | ✓ | ✓ | 16.900 / 34.553 |
+
+Evaluation of the discriminator: We introduce a discriminator to refine the predicted trajectories. By comparing $S_{S} + B_{B} + TL_{M}$ with $S_{S} + B_{B} + TL_{M} + D$ in Table 4, the performances of the latter are increased by $9.26\%$ and $12.74\%$ in ADE and FDE, respectively. Moreover, the discriminator contributes to improving the accuracy of predicted trajectory.
+
+Evaluation of different encoders: Due to the distinctive characteristics of traffic light states, we use the MLP and LSTM to encode them. By comparing $S_{S} + B_{B} + TL_{L} + D$ and $S_{S} + B_{B} + TL_{M} + D$ in Table 4, utilizing MLP to capture features of traffic light states can be further improved by $5.56\%$ and $8.17\%$ on ADE and FDE, respectively. This illustrates that a discontinuous sequence may not be suitable for being encoded by LSTM with strong context correlation.
+
+Evaluation of the Function of Traffic Lights: For traffic lights, we compare the methods+TL with the corresponding baseline methods. The former directly uses the VTP-TL dataset, and the latter uses a dataset that consists of $\text{Fid}$ , $\text{Aid}$ , $x$ , and $y$ attributes split from the VTP-TL dataset. As shown in Table 3, it can further increase the performance by $8.02\%$ to $24.87\%$ and $3.38\%$ to $30.29\%$ in ADE and FDE, respectively. Therefore, we can clearly validate the necessity of traffic lights in trajectory prediction at urban intersections.
+
+# 4.3 Qualitative Evaluation
+
+In Figure 6, the images of first two columns show the qualitative results derived from the Argoverse and Apolloscape. It can be seen our method without traffic lights also predicts acceptable future paths at urban intersections.
+
+In the third column, we show the qualitative results on the VTP-TL dataset. For the first row, the current traffic light state is red on the vertical road. We only show five vehicles' trajectories, where vehicle $v_{1}$ drives straight, $v_{2}$ turns right under the red traffic light, $v_{3}$ goes straight under the green light, $v_{4}$ and $v_{5}$ are not in the influence area of traffic light signals. For $v_{1}$ , the predicted trajectory of our method is closest to the ground truth. Although the trajectories of $v_{2}, v_{3}, v_{4}$ , and $v_{5}$ are not affected by traffic light signals, our method also predicts acceptable trajectories. The next two images show the predicted trajectory at T-junctions and roundabout intersections, where the states of vehicles located
+
+
+
+
+
+
+
+
+
+
+
+
+
+Argoverse
+
+Ground Truth Observation - - - Social-LSTM - - - Social-Attention - - - SGAN - - - STGAT - - - Trajectory++ - - - NMMP - - - CS-LSTM - - - GRAPH-LSTMS - - - TraPHic - - - MATF-GAN - - - GRIP++ - - - D2-TPred (Ours)
+
+
+Apolloscape
+
+
+VTP-TL
+Fig. 6. The visualization results at urban intersections on traffic datasets and VTP-TL dataset. Note that the compared methods are not the same in different datasets.
+
+in the former are changing from parking to driving under the traffic light states from red to green. This illustrates our model can flexibly respond to the dynamic changes of surrounding agents and traffic light states. Limited by the pages, more results and failure case are listed in supplementary materials.
+
+# 5 Conclusions
+
+We present $D2$ -TPred, a new trajectory prediction approach by taking into traffic lights. The approach can not only model the dynamic interactions by reconstructing sub-graphs for all agents with constantly changing interaction objects (SDG), but also captures discontinuous behavior dependency by modeling the direct effects of behaviors at prior instances on the current state (BDG). Moreover, one new dataset VTP-TL for vehicles trajectory prediction with traffic lights is also released. Based on it, we describe two trajectory forecasting schemes and obtain competitive performance against other state-of-the-art.
+
+Acknowledgments. This work was supported in part by the National Natural Science Foundation of China with Grant No.61772474 and 62036010, Zhengzhou Major Science and Technology Project with Grant No.2021KJZX0060-6. We thank all the reviewers for their valuable suggestions.
+
+# References
+
+1. Agrim, G., Justin, J., Li, F.F., Silvio, S.: Social gan: Socially acceptable trajectories with generative adversarial networks. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 2255-2264 (2018)
+2. Alahi, A., Goel, K., Ramanathan, V., Robicquet, A., Fei-Fei, L., Savarese, S.: Social lstm: Human trajectory prediction in crowded spaces. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 961-971 (2016). https://doi.org/10.1109/CVPR.2016.110
+3. Angelos, M., Rohan, C., Dinesh, M.: B-gap: Behavior-guided action prediction for autonomous navigation. arXiv preprint arXiv:2011.03748 (2020)
+4. Bai, H., Cai, S., Ye, N., Hsu, D., Lee, W.S.: Intention-aware online pomdp planning for autonomous driving in a crowd. In: 2015 IEEE International Conference on Robotics and Automation (ICRA). pp. 454-460 (2015)
+5. Bock, J., Krajewski, R., Moers, T., Runde, S., Vater, L., Eckstein, L.: The ind dataset: A drone dataset of naturalistic road user trajectories at german intersections. In: 2020 IEEE Intelligent Vehicles Symposium (IV). pp. 1929-1934 (2019). https://doi.org/10.1109/IV47402.2020.9304839
+6. Chandra, R., Bhattacharya, U., Bera, A., Manocha, D.: Traphic: Trajectory prediction in dense and heterogeneous traffic using weighted interactions. In: 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 8475-8484 (2019). https://doi.org/10.1109/CVPR.2019.00868
+7. Chandra, R., Bhattacharya, U., Mittal, T., Bera, A., Manocha, D.: Cmetric: A driving behavior measure using centrality functions. In: 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). pp. 2035-2042 (2020)
+8. Chandra, R., Guan, T., Panuganti, S., Mittal, T., Bhattacharya, U., Bera, A., Manocha, D.: Forecasting trajectory and behavior of road-agents using spectral clustering in graph-lstms. IEEE Robotics and Automation Letters 5(3), 4882-4890 (2020)
+9. Chang, M.F., Lambert, J., Sangkloy, P., Singh, J., Bak, S., Hartnett, A., Wang, D., Carr, P., Lucey, S., Ramanan, D., Hays, J.: Argoverse: 3d tracking and forecasting with rich maps. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition pp. 8748-8757 (2019)
+0. Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., Schiele, B.: The cityscapes dataset for semantic urban scene understanding. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 3213-3223 (2016)
+1. Dendorfer, P., Oep, A., Laura, L.T.: Goal-GAN: Multimodal Trajectory Prediction Based on Goal Position Estimation. Computer Vision - ACCV 2020 (2021)
+2. Deo, N., Trivedi, M.M.: Convolutional social pooling for vehicle trajectory prediction. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). pp. 1468-1476 (2018)
+3. Dirk, H., Peter, M.: Social force model for pedestrian dynamics. Physical review E 51(5), 4282-4286 (1995)
+4. Dzmitry, B., Kyunghyun, C., Yoshua, B.: Neural machine translation by jointly learning to align and translate. arXiv:1409.0473v7 (2014)
+5. Fang, L., Jiang, Q., Shi, J., Zhou, B.: Tpnet: Trajectory proposal network for motion prediction. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6796-6805 (2020). https://doi.org/10.1109/CVPR42600.2020.00683
+
+16. Girish, V., Anbumani, S., Anoop, N., Manmohan, C., CV, J.: Idd: A dataset for exploring problems of autonomous navigation in unconstrained environments. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV) pp. 1743-1751 (2021)
+17. Giuliari, F., Hasan, I., Cristani, M., Galasso, F.: Transformer networks for trajectory forecasting. In: 2020 25th International Conference on Pattern Recognition (ICPR). pp. 10335-10342 (2020)
+18. Hang, Z., Jiyang, G., Tian, L., Chen, S., Benjamin, S., Balakrishnan, V.: Tnt: Target-driven trajectory prediction. arXiv:2008.08294v2 (2020)
+19. Hasan, I., Setti, F., Tsesmelis, T., Belagiannis, V., Amin, S., Del Bue, A., Cristani, M., Galasso, F.: Forecasting people trajectories and head poses by jointly reasoning on tracklets and vislets. IEEE Transactions on Pattern Analysis and Machine Intelligence 43(4), 1267-1278 (2021)
+20. Holger, C., Varun, K.R.B., Lang, A.H., Sourabh, V.: nuscenes: A multimodal dataset for autonomous driving. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 11621-11631 (2020)
+21. Houston, J., Zuidhof, G., Bergamini, L., Ye, Y., Ondruska, P.: One thousand and one hours: Self-driving motion prediction dataset. Conference on Robot Learning (CoRL) (2020)
+22. Hu, Y., Chen, S., Zhang, Y., Gu, X.: Collaborative motion prediction via neural motion message passing. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 6318-6327 (2020)
+23. Huang, Y., Bi, H., Li, Z., Mao, T., Wang, Z.: Stgat: Modeling spatial-temporal interactions for human trajectory prediction. In: 2019 International Conference in Computer Vision. pp. 6272-6281 (2019)
+24. Jiachen, L., Fan, Y., Tomizuka, M., Choi., C.: Evolvegraph: Multi-agent trajectory prediction with dynamic relational reasoning. In: Proceedings of the Neural Information Processing Systems (NeurIPS). pp. 1-18 (2020)
+25. Lee, N., Choi, W., Vernaza, P., Choy, C.B., Torr, P.H.S., Chandraker, M.: Desire: Distant future prediction in dynamic scenes with interacting agents. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 2165-2174 (2017). https://doi.org/10.1109/CVPR.2017.233
+26. Liang, J., Jiang, L., Hauptmann, A.: Simaug: Learning robust representations from 3d simulation for pedestrian trajectory prediction in unseen cameras. arXiv preprint arXiv:2004.02022 2 (2020)
+27. Luo, Y., Cai, P., Bera, A., Hsu, D., Lee, W.S., Manocha, D.: Porca: Modeling and planning for autonomous driving among many pedestrians. IEEE Robotics and Automation Letters 3(4), 3418-3425 (2018)
+28. Mo, X., Huang, Z., Xing, Y., Lv, C.: Multi-agent trajectory prediction with heterogeneous edge-enhanced graph attention network. IEEE Transactions on Intelligent Transportation Systems pp. 1-14 (2022). https://doi.org/10.1109/TITS.2022.3146300
+29. Mohamed, A., Qian, K., Elhoseiny, M., Claudel, C.: Social-stgcnn: A social spatiotemporal graph convolutional neural network for human trajectory prediction. In: 2020 IEEE Conference on Computer Vision and Pattern Recognition. pp. 14424-14432 (2020)
+30. Pang, B., Zhao, T., Xie, X., Wu, Y.N.: Trajectory prediction with latent belief energy-based model. In: the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 11814-11824 (June 2021)
+31. Petar, V., Guillem, C., Arantxa, C., Adriana, R.: Graph attention networks. International Conference on Learning Representations (ICLR) (2018)
+
+32. Pongsathorn, R., Takahiro, H., Masao, N.: Motion planning and control of autonomous driving intelligence system based on risk potential optimization framework. International Journal of Automotive Engineering 7(1), 53-60 (2016)
+33. Ramin, M., Alexis, O., Mubarak, S.: Abnormal crowd behavior detection using social force model. In: 2009 IEEE Conference on Computer Vision and Pattern Recognition. pp. 935-942 (2009)
+34. Robicquet, A., Sadeghian, A., Alahi, A., Savarese, S.: Learning social etiquette: Human trajectory understanding in crowded scenes. In: European Conference on Computer Vision. pp. 549-565 (2016)
+35. Rohan, C., Mridul, M., Rahul, K., Rishitha, P., Chandrababu, N., Alok, J., Dinesh, M.: Meteor: A massive dense & heterogeneous behavior dataset for autonomous driving. arXiv preprint arXiv:2109.07648 (2021)
+36. Sadeghian., A.,., V.K., Sadeghian., A., Hirose., N., Rezatofighi, H., Savarese, S.: Sophie: An attentive gan for predicting paths compliant to social and physical constraints. In: 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 1349-1358 (2020)
+37. Scott, E., Shuyang, C., Benjamin, C., Chenxi, L., Hang, Z., Sabeek, P., Yun- ing, C., Ben, S., Charles, Q., Yin, Z.: Large scale interactive motion forecasting for autonomous driving : The waymo open motion dataset. arXiv preprint arXiv:2104.10133 (2021)
+38. Shi, L., Wang, L., Long, C., Zhou, S., Zhou, M., Niu, Z., Hua, G.: Sgn:sparse graph convolution network for pedestrian trajectory prediction. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2021)
+39. Song, X., Chen, K., Li, X., Sun, J., Hou, B., Cui, Y., Zhang, B., Xiong, G., Wang, Z.: Pedestrian trajectory prediction based on deep convolutional LSTM network. IEEE Transactions on Intelligent Transportation Systems 22(6), 3285-3302 (2021)
+40. Song, Y., Bisagno, N., Hassan, S.Z., Concí, N.: Ag-gan: An attentive group-aware gan for pedestrian trajectory prediction. In: 2020 25th International Conference on Pattern Recognition (ICPR). pp. 8703-8710 (2021)
+41. Tim, S., Boris, I., Punarjay, C., Marco, P.: Trajectory++: Multi-agent generative trajectory forecasting with heterogeneous data for control. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) pp. 683-700 (2020)
+42. Vemula, A., Muelling, K., Oh, J.: Social attention: Modeling attention in human crowds pp. 1-7 (2018)
+43. Vineet, K., Amir, S., Roberto, M.M., Lan, R.: Social-bigat: Multimodal trajectory forecasting using bicycle-gan and graph attention networks. In Advances in Neural Information Processing Systems (NeurIPS) pp. 137-146 (2019)
+44. of Waterloo, U.: uwaterloo (2021), http://wiselab.uwaterloo.ca/ waterloo-multi-agent-traffic-dataset/
+45. Wei, Z., Liting, S., Di, W., Haojie, S., Aubrey, C., Maximilian, N., Julius, K., Hendrik, K., Christoph, S., Arnaud, d.L.F., Masayoshi, T.: Interaction dataset: An international, adversarial and cooperative motion dataset in interactive driving scenarios with semantic maps. arXiv preprint arXiv:1910.03088 (2019)
+46. Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., Yu, P.S.: A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems pp. 4-24 (2019)
+47. Xin, L., Xiaowen, Y., Chuah, M.C.: Grip++: Enhanced graph-based interaction-aware trajectory prediction for autonomous driving. arXiv preprint arXiv:1907.07792 (2020)
+
+48. Xu, Y., Ren, D., Li, M., Chen, Y., Fan, M., Xia, H.: Tra2tra: Trajectory-to-trajectory prediction with a global social spatial-temporal attentive neural network. IEEE Robotics and Automation Letters 6(2), 1574-1581 (2021)
+49. Yuexin, M., Dinesh, M., Wenping, W.: Autorvo: Local navigation with dynamic constraints in dense heterogeneous traffic. arXiv preprint arXiv:1804.02915 (2018)
+50. Yuexin, M., Xinge, Z., Sibo, Z., Ruigang, Y., Wenping, W., Dinesh, M.: Trafficpredict: Trajectory prediction for heterogeneous traffic-agents. Proceedings of the AAAI Conference on Artificial Intelligence 33(01), 6120-6127 (2019)
+51. Yuning, C., Benjamin, S., Mayank, B., Dragomir, A.: Multipath: Multiple probabilistic anchor trajectory hypotheses for behavior prediction. arXiv:1910.05449 (2019)
+52. Zernetsch, S., Kohnen, S., Goldhammer, M., Doll, K., Sick, B.: Trajectory prediction of cyclists using a physical model and an artificial neural network. In: 2016 IEEE Intelligent Vehicles Symposium (IV). pp. 833-838 (2016)
+53. Zhang, K., Zhao, L., Dong, C., Wu, L., Zheng, L.: Ai-tp: Attention-based interaction-aware trajectory prediction for autonomous driving. IEEE Transactions on Intelligent Vehicles pp. 1-1 (2022). https://doi.org/10.1109/TIV.2022.3155236
+54. Zhao, L., Song, Y., Zhang, C., Liu, Y., Wang, P., Lin, T., Deng, M., Li, H.: T-gcn: A temporal graph convolutional network for traffic prediction. IEEE Transactions on Intelligent Transportation Systems PP(99), 1-11 (2019)
+55. Zhao, Z., Liu, C.: Stugcn:a social spatio-temporal unifying graph convolutional network for trajectory prediction. In: 2021 6th International Conference on Automation, Control and Robotics Engineering (CACRE). pp. 546-550 (2021)
+56. Zheng, F., Wang, L., Zhou, S., Tang, W., Niu, Z., Zheng, N., Hua, G.: Unlimited neighborhood interaction for heterogeneous trajectory prediction. In: 2021 IEEE/CVF International Conference on Computer Vision (ICCV). pp. 13148-13157 (2021). https://doi.org/10.1109/ICCV48922.2021.01292
+57. Zhengping, C., Guangyu, L., Tracy, L., Bo, J., Xuefeng, S., Xinsheng, Z., Ying, L., Guobin, W., Yan, L., Jieping, Y.: $D^2$ -city: A large-scale dashcam video dataset of diverse traffic scenarios. arXiv preprint arXiv:1904.01975 (2019)
+58. Zhou, J., Cui, G., Hu, S., Zhang, Z., Yang, C., Liu, Z., Wang, L., Li, C., Sun, M.: Graph neural networks: A review of methods and applications. AI Open 1, 57-81 (2020). https://doi.org/https://doi.org/10.1016/j.aiopen.2021.01.001
\ No newline at end of file
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/images.zip b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..87be830a228bfadf8698ea15e778dad6625f6e64
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:872982ac47d1628fa1439cc6ed91cbdb914618156736aaf6540bd1acd6a82b7f
+size 578940
diff --git a/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/layout.json b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..fcc0aa514460c01c6a3d5f36caa3f9bfa65f60f4
--- /dev/null
+++ b/d2tpreddiscontinuousdependencyfortrajectorypredictionundertrafficlights/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4edc86a649fcf15c74fe7b05acaa6509222ec327530554495fd7bc8b8f1362b3
+size 512087
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_content_list.json b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..fce2466946945b335990254de74d8179e06486b2
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d5714ce6b79d6c5371f9e0d2890ffcf851c2438003ccf7dd02ed313b6c88e1d
+size 84966
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_model.json b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e79a97c75f2940603d2ab6c586de0ffb8add5f8f
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8fe5df80e4db4a51e92df8b9178089d8cd9e23ce7478d14c66f1da6043b43f56
+size 110295
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_origin.pdf b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7f0f0463f002bb3cb158b60b047f8d64ad12dff6
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/ec0a8b14-eb33-486a-8438-e1c868014267_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b77653ce7de8bb66de372781626dbcb750facfd629e73c63197bbb1f8c657de7
+size 4098798
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/full.md b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..9a62e73c5b8f44fb98d6cb65488f4ab298301579
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/full.md
@@ -0,0 +1,301 @@
+# D³Net: A Unified Speaker-Listener Architecture for 3D Dense Captioning and Visual Grounding
+
+Dave Zhenyu Chen $^{1}$ Qirui Wu $^{2}$ Matthias Nießner $^{1}$ Angel X. Chang $^{2}$
+
+$^{1}$ Technical University of Munich $^{2}$ Simon Fraser University
+
+https://daveredrum.github.io/D3Net/
+
+
+Fig.1: We introduce D $^3$ Net, an end-to-end neural speaker-listener architecture that can detect, describe and discriminate. D $^3$ Net also enables semi-supervised training on ScanNet data with partially annotated descriptions.
+
+Abstract. Recent work on dense captioning and visual grounding in 3D have achieved impressive results. Despite developments in both areas, the limited amount of available 3D vision-language data causes overfitting issues for 3D visual grounding and 3D dense captioning methods. Also, how to discriminatively describe objects in complex 3D environments is not fully studied yet. To address these challenges, we present $\mathrm{D}^3\mathrm{Net}$ , an end-to-end neural speaker-listener architecture that can detect, describe and discriminate. Our $\mathrm{D}^3\mathrm{Net}$ unifies dense captioning and visual grounding in 3D in a self-critical manner. This self-critical property of $\mathrm{D}^3\mathrm{Net}$ encourages generation of discriminative object captions and enables semisupervised training on scan data with partially annotated descriptions. Our method outperforms SOTA methods in both tasks on the Scan-Refer dataset, surpassing the SOTA 3D dense captioning method by a significant margin.
+
+# 1 Introduction
+
+Recently, there has been increasing interest in bridging 3D visual scene understanding [41, 18, 19, 5, 11, 22, 46] and natural language processing [48, 13, 4, 34, 55]. The task of 3D visual grounding [6, 59, 60] localizes 3D objects described by natural language queries. 3D dense captioning proposed by Chen et al. [7] is
+
+
+Detections
+Descriptions
+Fig.2: Prior work [7] struggle to produce discriminative object captions. Also, captions often appear to be template-based. In contrast, our D $^3$ Net generates discriminative object captions.
+
+Human: the couch is located in the corner of the room. it is to the right side of the door.
+
+Scan2Cap: this is a dark couch. it is to the right of a table
+
+D3Net: the black couch is under a whiteboard. there is a door on its left.
+
+the reverse task where we generate descriptions for 3D objects in RGB-D scans. Both tasks enable applications such as assistive robots and natural language control in AR/VR systems.
+
+However, existing work on 3D visual grounding [6, 1, 59, 23, 60] and dense captioning [7, 58] treats the two problems as separate, with detect-then-discriminate or detect-then-describe being the common strategies for tackling the two tasks. Separating the two complementary tasks hinders holistic 3D scene understanding where the ultimate goal is to create models that can infer: 1) what are the objects; 2) how to describe each object; 3) what object is being referred to through natural language. The disadvantages of having separated strategies are twofold. First, the detect-then-describe strategy often struggles to describe target objects in a discriminative way. In Fig. 2, the generated descriptions from Scan2Cap [7] fail to uniquely describe the target objects, especially in scenes with several similar objects. Second, existing 3D visual grounding methods [6, 60] in the detect-then-discriminate strategy suffer from severe overfitting issue, partly due to the small amount of 3D vision-language data [6, 1] which is limited compared to counterpart 2D datasets such as MSCOCO [32].
+
+To address these issues, we propose an end-to-end self-critical solution, D3Net, to enable discriminability in dense caption generation and utilize the generated captions improve localization. Relevant work in image captioning [36, 33] tackles similar issues where the generated captions are indiscriminative and repetitive by explicitly reinforcing discriminative caption generation with an image retrieval loss. Inspired by this scheme, we introduce a speaker-listener strategy, where the captioning module "speaks" about the 3D objects, while the localization module "listens" and finds the targets. Our proposed speaker-listener architecture can detect, describe and discriminate, as illustrated in Fig. 1. The key idea is to reinforce the speaker to generate discriminative descriptions so that the listener can better localize the described targets given those descriptions.
+
+This approach brings another benefit. Since the speaker-listener architecture self-critically generates and discriminates descriptions, we can train on scenes without any object descriptions. We see further improvements in 3D dense captioning and 3D visual grounding performance when using this additional data
+
+alongside annotated scenes. This can allow for semi-supervised training on RGB-D scans beyond the ScanNet dataset. To summarize, our contributions are:
+
+- We introduce a unified speaker-listener architecture to generate discriminative object descriptions in RGB-D scans. Our architecture allows for a semi-supervised training scheme that can alleviate data shortage in the 3D vision-language field.
+- We study how the different components impact performance and find that having a strong detector is essential, and that by jointly optimizing the detector, speaker, and listener we can improve detection as well as 3D dense captioning and visual grounding.
+- We show that our method outperforms the state-of-the-art for both 3D dense captioning and 3D visual grounding method by a significant margin.
+
+# 2 Related Work
+
+Vision and language in 3D. Recently, there has been growing interest in grounding language to 3D data [8, 2, 6, 1, 52, 44, 47]. Chen et al. [6] and Achlioptas et al. [1] introduce two complementary datasets consisting of descriptions of real-world 3D objects from ScanNet [11] reconstructions, named ScanRefer and ReferIt3D, respectively. ScanRefer proposes the joint task of detecting and localizing objects in a 3D scan based on a textual description, while ReferIt3D is focused on distinguishing 3D objects from the same semantic class given ground-truth bounding boxes. Yuan et al. [59] localize objects by decomposing input queries into fine-grained aspects, and use PointGroup [25] as their visual backbone. However, the frozen detection backbone is not fine-tuned together with the localization module. Zhao et al. [60] propose a transformer-based architecture with a VoteNet [41] backbone to handle multimodal contexts during localization. Despite the improved matching module, their work still suffers from poor quality detections due to the weak 3D detector. We show that fine-tuning an improved 3D detector is essential to getting good predictions and good localization performance. Chen et al. [7] introduce the task of densely detecting and captioning objects in RGB-D scans. Recently, Yuan et al. [58] aggregate the 2D features to point cloud to generate faithful object descriptions. Although their methods can effectively detect objects and generate captions w.r.t. their attributes, the quality of the bounding boxes and the discriminability of the captions are inadequate. Our method explicitly handles the discriminability of the generated captions through a self-critical speaker-listener architecture, resulting in the state-of-the-art performance in both 3D dense captioning and 3D visual grounding tasks.
+
+Generating captions in images. Image captioning has attracted a great deal of interest [50, 53, 14, 28, 35, 3, 26, 43, 45]. Recent work [36, 33] suggest that traditional encoder-decoder-based image captioning methods suffer from the discriminability issues. Luo et al. [36] propose an additional image retrieval branch to reinforce discriminative caption generation. Liu et al. [33] propose a reinforcement learning method to train not only on annotated web images, but also
+
+images without any paired captions. In contrast to generating captions for the entire image, in the dense captioning task we densely generate captions for each detected object in the input image [27, 54, 30]. Although such methods are effective for generating captions in 2D images, directly applying such training techniques on 3D dense captioning can lead to unsatisfactory results, since the captions involve 3D geometric relationships. In contrast, we work directly on 3D scene input dealing with object attributes as well as 3D spatial relationships.
+
+Grounding referential expressions in images. There has been tremendous progress in the task of grounding referential expressions in images, also known as visual grounding [29, 40, 38, 21, 56, 20]. Given an image and a natural language text query as input, the target object is either localized by a bounding box [21, 56], or a segmentation mask [20]. These methods have achieved great success in the image domain. However, they are not designed to deal with 3D geometry inputs and handle complex 3D spatial relationships. Our proposed method directly decomposes the 3D input data with a sparse convolutional detection backbone, which produces accurate object proposals as well as semantically rich features.
+
+Speaker-listener models for grounding. The speaker-listener model is a popular architecture for pragmatic language understanding, where a line of research explores how the context and communicative goals affect the linguistics [10, 16]. Recent work use neural speaker-listener architectures to tackle referring expression generation [38, 57, 37], vision-language navigation [15], and shape differentiation [2]. Mao et al. [38] construct a CNN-LSTM architecture optimized by a softmax loss to directly discriminate the generated referential expressions. There is no separate neural listener module compared with our method. Luo and Shakhnarovich [37] and Yu et al. [57] introduce a LSTM-based neural listener in the speaker-listener pipeline, but generating the referential expression is not directly supervised via the listener model, but rather trained via a proxy objective. In contrast, our method directly optimizes the Transformer-based neural listener for the visual grounding task by discriminating the generated object captions without any proxy training objective. Similarly, Achlioptas et al. [2] includes a pretrained and frozen listener in the training objective, while ours enables joint end-to-end optimization for both the speaker and listener via policy gradient algorithm. We experimentally show our method to be effective for semi-supervised learning in the two 3D vision-language tasks.
+
+# 3 Method
+
+$\mathrm{D}^3\mathrm{Net}$ has three components: a 3D object detector, the speaker (captioning) module, and the listener (localization) module. Fig. 3 shows the overall architecture and training flow. The point clouds are fed into the detector to predict object proposals. The speaker takes object proposals as input to produce captions. To increase caption discriminability, we match these captions with object proposals via the listener. Caption quality is measured by the CIDEr [49] scores and the listener loss, which are back-propagated via REINFORCE [51] as re
+
+
+Fig. 3: D $^{3}$ Net architecture. We input point clouds into the detector to predict object proposals. Then, those proposals are fed into the speaker to generate captions that describes each object. To discriminate the object described by each caption, the listener matches the generated captions with object proposals. The captioning and localization results are back-propagated via REINFORCE [51] as rewards through the dashed lines. D $^{3}$ Net also enables end-to-end training on point clouds with no GT object descriptions (bottom blue block).
+
+wards to the speaker. Our architecture can handle scenes without ground-truth (GT) object descriptions by reinforcing the speaker with the listener loss only.
+
+# 3.1 Modules
+
+Detector. We use PointGroup [25] as our detector module. PointGroup is a relatively simple model for 3D instance segmentation that achieves competitive performance on the ScanNet benchmark. We use ENet to augment the point clouds with multi-view features, following Dai and Nießner [12]. PointGroup uses a U-Net architecture with a SparseConvNet backbone to encode point features, cluster the points, and uses ScoreNet, another U-Net structure, to score each cluster. We take the cluster features after ScoreNet as the encoded object features. We refer readers to the original paper [25] for more details. The object bounding boxes are determined by taking the minimum and maximum points in the point clusters, and are produced as final outputs of our detector module.
+
+Speaker. We base our speaker on the dense captioning method introduced by Chen et al. [7]. Our speaker module has two submodules: 1) a relational graph module, which is responsible for learning object-to-object spatial location relationships; 2) a context-aware attention captioning module, which attentively generates descriptive tokens with respect to the object attributes as well as the object-to-object spatial relationships.
+
+Listener. For the listener, we follow the architecture introduced by Chen et al. [6] but replace the multi-modal fusion module with the transformer-based multimodal fusion module of Zhao et al. [60]. Our listener module has two submodules: 1) a language encoding module with a GRU cell; 2) a transformer-based multimodal fusion module similar to Zhao et al. [60], which attends to elements in the input query descriptions and the detected object proposals. As in Chen et al.
+
+[6], we also incorporate a language object classifier to discriminate the semantics of the target objects in the input query descriptions.
+
+# 3.2 Training Objective
+
+The three modules are designed to be trained in an end-to-end fashion (see Figure 3). In this section, we describe the loss for each module, and how they are combined for the overall loss.
+
+Detection loss. We use the instance segmentation loss introduced in Point-Group [25] to train the 3D backbone. The detection loss is composed of four parts: $L_{\mathrm{det}} = L_{\mathrm{sem}} + L_{\mathrm{o\_reg}} + L_{\mathrm{o\_dir}} + L_{\mathrm{c\_score}}$ . $L_{\mathrm{sem}}$ is a cross-entropy loss supervising semantic label prediction for each point. $L_{\mathrm{o\_reg}}$ is a $L_{1}$ regression loss constraining the learned point offsets belonging to the same cluster. $L_{\mathrm{o\_dir}}$ constrains the direction of predicted offset vectors, defined as the means of minus cosine similarities. It helps regress precise offsets, particularly for boundary points of large-size objects, since these points are relatively far from the instance centroids. $L_{\mathrm{c\_score}}$ is another binary cross-entropy loss supervising the predicted objectness scores.
+
+Listener loss. The listener loss is composed of a localization loss $L_{\mathrm{loc}}$ and a language-based object classification loss $L_{\mathrm{objcls}}$ . To obtain the localization loss $L_{\mathrm{loc}}$ , we first require a target bounding box. We use the detected bounding box with the highest IoU with the GT bounding box as the target bounding box. Then, a cross-entropy loss $L_{\mathrm{loc}}$ is applied to supervise the matching score prediction. In the end-to-end training scenario, the detected bounding boxes associated with the generated descriptions from the speaker are treated as the target bounding boxes. The language object classification loss is a cross-entropy loss $L_{\mathrm{objcls}}$ to supervise the classification based on the input description. The target classes are consistent with the ScanNet 18 classes, excluding structural objects such as "floor" and "wall".
+
+Speaker loss using MLE training objective. The speaker loss is a standard captioning loss from maximum likelihood estimation (MLE). During training, provided with a pair of GT bounding box and the associated GT description, we optimize the description associated with the predicted bounding box which has the highest IoU score with the current GT bounding box. We first treat the description generation task as a sequence prediction task, factorized as: $L_{\mathrm{spk - XE}}(\theta) = -\sum_{t = 1}^{T}\log p(\hat{c}_t|\hat{c}_1,\dots,c_{t - 1};I,\theta)$ , where $\hat{c}_t$ denotes the generated token at step $t$ ; $I$ and $\theta$ represent the visual signal and model parameter, respectively. The token $\hat{c}_t$ is sampled from the probability distribution over the pre-defined vocabulary. The generation process is performed by greedy decoding or beam search in an autoregressive manner, and we use the argmax function to sample each token.
+
+Joint loss using REINFORCE training objective. We use REINFORCE to train the detector-speaker-listener jointly. We first describe the enhanced speaker-loss, $L_{\mathrm{spk - R}}$ that is trained using reinforcement learning to produce discriminative captions. We then describe the overall loss used in end-to-end training. Following prior work [36, 33, 42, 17, 57, 43], generating descriptions is
+
+treated as a reinforcement learning task. In the setting of reinforcement learning, the speaker module is treated as the "agent", while the previously generated words and the input visual signal $I$ are the "environment". At step $t$ , generating word $\hat{c}_t$ by the speaker module is deemed as the "action" taken with the policy $p_{\theta}$ , which is defined by the speaker module parameters $\theta$ . Specifically, with the generated description $\hat{C} = \{c_1, \dots, c_T\}$ , the objective is to maximize the reward function $R(\hat{C}, I)$ . We apply the "REINFORCE with baseline" algorithm following Rennie et al. [43] to reduce the variance of this loss function, where a baseline reward $R(C^*, I)$ of the description $C^*$ independent of $\hat{C}$ is introduced. We apply beam search to sample descriptions and choose the greedily decoded descriptions as the baseline. The simplified policy gradient is:
+
+$$
+L _ {\mathrm {s p k - R}} (\theta) \approx - \left(R (\hat {C}, I) - R \left(C ^ {*}, I\right)\right) \sum_ {t = 1} ^ {T} \log p \left(\hat {c} _ {t} \mid I, \theta\right) \tag {1}
+$$
+
+Rewards. As the word-level sampling through the argmax function is non-differentiable, the subsequent listener loss cannot be directly back-propagated through the speaker module. A workaround is to use the gumbel softmax reparametrization trick [24]. Following the training scheme of Liu et al. [33] and Luo et al. [36], the listener loss can be inserted into the REINFORCE reward function to increase the discriminability of generated referential descriptions. Specifically, given the localization loss $L_{\mathrm{loc}}$ and the language object classification loss $L_{\mathrm{objects}}$ , the reward function $R(\hat{C})$ is the weighted sum of the CIDEr score of the sampled description and the listener-related losses:
+
+$$
+R (\hat {C}, I) = R ^ {\mathrm {C I D E r}} (\hat {C}, I) - \alpha [ L _ {\mathrm {l o c}} (\hat {C}) + \beta L _ {\mathrm {l o b j c l s}} (\hat {C}) ] \tag {2}
+$$
+
+where $\alpha$ and $\beta$ are the weights balancing the CIDEr reward and the listener rewards. We empirically set them to 0.1 and 1 in our experiments, respectively. To stabilize the training, the reward related to the baseline description $R(C^{*})$ should be formulated analogously. Note that there should be no gradient calculation and back-propagation for the baseline $C^{*}$ . For scenes with no GT descriptions provided, the CIDEr reward is cancelled in the reward function, which in this case becomes $R(\hat{C},I) = -\alpha [L_{\mathrm{loc}}(\hat{C}) + \beta L_{\mathrm{objcls}}(\hat{C})]$ .
+
+Relative orientation loss. Following Chen et al. [7], we adopt the relative orientation loss on the message passing module as a proxy loss. The object-to-object relative orientations ranging from $0^{\circ}$ to $180^{\circ}$ are discretized into 6 classes. We apply a simple cross-entropy loss $L_{\mathrm{ori}}$ to supervise the relative orientation predictions.
+
+Overall loss. We combine loss terms in our end-to-end joint training objective as: $L = L_{\mathrm{det}} + L_{\mathrm{spk - R}} + 0.3L_{\mathrm{ori}}$ .
+
+# 3.3 Training
+
+We use a stage-wise training strategy for stable training. We first pretrain the detector backbone on all training scans in ScanNet via the detector loss $L_{\mathrm{det}}$ .
+
+We then train the dense captioning pipeline with the pretrained detector and a newly initialized speaker end-to-end via the detector loss and the speaker MLE loss $L_{\mathrm{spk - XE}}$ . After the speaker MLE loss converges, we train the visual grounding pipeline with the fine-tuned frozen detector and the listener via the listener loss $L_{\mathrm{loc}}$ . Finally, we fine-tune the entire speaker-listener architecture with the overall loss $L$ .
+
+# 3.4 Inference
+
+During inference, we use the detector and the speaker to do 3D dense captioning and the listener to do visual grounding. The detector first produces object proposals, and the speaker generates a description for each object proposal. We take the minimum and maximum coordinates in the predicted object instance masks to construct the bounding boxes. For the object proposals that are assigned to the same ground truth, we keep only the one with the highest IoU with the GT bounding box. When evaluating the detector itself, the non-maximum suppression is applied.
+
+# 4 Experiments
+
+# 4.1 Dataset
+
+We use the ScanRefer [6] dataset consisting of around 51k descriptions for over 11k objects in 800 ScanNet [11] scans. The descriptions include information about the appearance of the objects, as well as the object-to-object spatial relationships. We follow the official split from the ScanRefer benchmark for training and validation. We report our visual grounding results on the validation split and benchmark results on the hidden test set1. Our dense captioning results are on the validation split due to the lack of the test grounding truth. We also conduct experiments on the ReferIt3D dataset [1] (please see the supplemental).
+
+# 4.2 Semi-supervised Training with Extra Data
+
+As the scans in ScanRefer dataset are only a subset of scans in ScanNet, we extend the training set by including all re-scans of the same scenes for semi-supervised training. Unlike the scans in ScanRefer, these re-scans do not have per object descriptions. We can control how much extra data to use by randomly sampling (with replacement) from the set of re-scans. We experiment with augmenting our data with 0.1 to 1 times the amount of annotated data as extra data. During training, we randomly select detected objects in the sampled extra scans for subsequent dense captioning and visual grounding. For the complete 'extra' scenario, we use a comparable amount (1x) of extra data as the annotated data in ScanRefer.
+
+Table 1: Quantitative results on 3D dense captioning and object detection. As in Chen et al. [7], we average the conventional captioning evaluation metrics with the percentage of the predicted bounding boxes whose IoU with the GTs are higher than 0.5. Our speaker model outperforms the baseline Scan2Cap without training via REINFORCE, while training with CIDEr reward further boosts the dense captioning performance. We also showcase the effectiveness of training with additional scans with no description annotations. Our speaker-listener architecture trained with 1x extra data achieves the best performance.
+
+ | C@0.5IoU | B-4@0.5IoU | M@0.5IoU | R@0.5IoU | mAP@0.5 |
| Scan2Cap [7] | 39.08 | 23.32 | 21.97 | 44.78 | 32.21 |
| X-Trans2Cap [58] | 43.87 | 25.05 | 22.46 | 44.97 | 35.31 |
| Ours (MLE) | 46.07 | 30.29 | 24.35 | 51.67 | 50.93 |
| Ours (CIDEr) | 57.88 | 32.64 | 24.86 | 52.26 | 51.01 |
| Ours (CIDEr+fixed loc.) | 58.93 | 33.36 | 25.12 | 52.62 | 51.04 |
| Ours (CIDEr+loc.) | 61.30 | 34.50 | 25.25 | 52.80 | 52.07 |
| Ours (CIDEr+loc.+lobjcls.) | 61.50 | 35.05 | 25.48 | 53.31 | 52.58 |
| Ours (w/ 0.1x extra data) | 61.91 | 35.03 | 25.38 | 53.25 | 52.64 |
| Ours (w/ 0.5x extra data) | 62.36 | 35.54 | 25.43 | 53.67 | 53.17 |
| Ours (w/ 1x extra data) | 62.64 | 35.68 | 25.72 | 53.90 | 53.95 |
+
+# 4.3 Implementation Details
+
+We implement the PointGroup backbone using the Minkowski Engine [9] (see supplement). For the backbone, we train using Adam [31] with a learning rate of 2e-3, on the ScanNet train split with batch size 4 for 140k iterations, until convergence. For data augmentation, we follow Jiang et al. [25], randomly applying jitter, mirroring about the YZ-plane, and rotation about the Z axis (up-axis) to each point cloud scene. We then use the Adam optimizer with learning rate 1e-3 to train the detector and the listener on the ScanRefer dataset with batch size 4 for 60k iterations, until convergence. Each scan is paired with 8 descriptions (i.e. 4 scans and 32 descriptions per batch iteration). Then, we combine the trained detector with the newly initialized speaker on the ScanRefer dataset for the 3D dense captioning task, where the weights of the detector are frozen. We again use Adam with learning rate 1e-3, with the training process converging within 14k iterations. All our experiments are conducted on a RTX 3090, and all neural modules are implemented using PyTorch [39].
+
+# 4.4 Quantitative Results
+
+3D dense captioning and detection Tab. 1 compares our 3D dense captioning and object detection results against the baseline methods Scan2Cap [7] and X-Trans2Cap [58]. Leveraging the improved PointGroup based detector, our speaker model trained with the conventional MLE objective (Ours (MLE)) outperforms Scan2Cap and X-Trans2Cap by a large margin in all metrics. As expected, training with the CIDEr reward (Ours (CIDEr)) significantly improves the CIDEr score. We note that other captioning metrics are also improved, but
+
+Table 2: Quantitative results on 3D visual grounding. We adapt the evaluation setting as in Chen et al. [6]. "Unique" means there is only one object belongs to a specific class in the scene, while "multiple" represents the cases where more than one object from a specific class can be found in the scene. Clearly, our base visual grounding network outperforms all baselines even before being put into the speaker-listener architecture. After the speaker-listener fine-tuning, our method achieves the state-of-the-art performance on the ScanRefer validation set and the public benchmark. Note that 3DVG-Trans+ is an unpublished extension of 3DVG-Trans [60] which appears only on the public benchmark.
+
+ | Val Acc@0.5IoU | Test Acc@0.5IoU |
| Unique | Multiple | Overall | Unique | Multiple | Overall |
| ScanRefer [6] | 53.51 | 21.11 | 27.40 | 43.53 | 20.97 | 26.03 |
| TGNN [23] | 56.80 | 23.18 | 29.70 | 58.90 | 25.30 | 32.80 |
| InstanceRefer [59] | 66.83 | 24.77 | 32.93 | 66.69 | 26.88 | 35.80 |
| 3DVG-Trans [60] | 60.64 | 28.42 | 34.67 | 55.15 | 29.33 | 35.12 |
| 3DVG-Trans+ [60] | - | - | - | 57.87 | 31.02 | 37.04 |
| Ours (w/o fine-tuning) | 70.35 | 27.11 | 35.58 | 65.79 | 27.26 | 35.90 |
| Ours | 72.04 | 30.05 | 37.87 | 68.43 | 30.74 | 39.19 |
+
+the detection mAP@0.5 remains similar. Training with object localization reward (Ours (CIDEr+loc.)) improves both captioning and detection further due to the improved discriminability during description generation. Note that if we use a frozen pretrained listener (Ours (CIDEr+fixed loc.), the improvement is not as significant as when we allow the listener weights to be fine-tuned (Ours (CIDEr+loc.). Our full model with the full listener reward incorporates an additional language object classification loss (Ours (CIDEr+loc.+lobjcls.)) and further improves the performance for both tasks.
+
+Does additional data help? As our method allows for training the listener with scans without language data, we investigate the effectiveness of training with additional ScanNet data that have not been annotated with descriptions. We vary the amount of extra scan data (without descriptions) from 0.1x to 1x of fully annotated data and train our full model with CIDEr and full listener reward (loc.+lobjcls.). Our results (last three rows of Tab. 1), show that our semi-supervised training strategy can leverage the extra data to improve both dense captioning and object detection.
+
+3D visual grounding Tab. 2 compares our results against prior 3D visual grounding methods ScanRefer [6], TGNN [23], InstanceRefer [59] and 3DVG-Transformer [60], and 3DVG-Trans+, an unpublished extension. Our method trained only with the detection loss and the listener loss ("Ours w/o finetuning"), i.e. without the speaker-listener setting, outperforms all the previous methods in the "Unique" and "Overall" scenarios. We find the improved fusion module together with the improved detector is sufficient to outperform 3DVG-Trans. Due to the improved detector, our method can distinguish objects in the "Unique" case, where the semantic labels play an important role. Meanwhile, 3DVG-Trans [60] still outperforms our base listener when discriminating objects
+
+
+Scan2Cap: this is a brown table . it isto the right of another whiteboard
+
+
+Scan2Cap: this is a black lamp . it ison a dresser .
+Ours: this is brown wooden table. it is under a black tv.
+Ours: this is a black tv above the nightstand. it is next to the bed.
+Ours: this is a brown coffee table. it is in front of the couch.
+
+
+Scan2Cap: this is a brown couch, it is to the right of the table.
+
+
+Scan2Cap: this is a black monitor. it is on a desk.
+Ours: this is a monitor . it is on theright of the monitor near the window
+
+
+GT: it is a narrow wood console table.
+it sits under the tv.
+Scan2Cap: this is a bathroom cabinet. it is to the right of the sink.
+Ours: there is a tan bathroom vanity .it is to the right of the toilet .
+GT: it is a long wooden cabinet . it isalong the wall in the bathroom .
+Fig. 4: Qualitative results in 3D dense captioning task from Scan2Cap [7] and our method. We underline the inaccurate words and mark the spatially discriminative phrases in bold. Our method qualitatively outperforms Scan2Cap in producing better object bounding boxes and more discriminative descriptions.
+
+
+GT: this is a tv hanging the cabinets and the wall . it is above the bed .
+Scan2Cap: this is a black chair. It is facing a desk.
+Ours: this is a white chair. It is between the bed and another chair
+GT: there is a chair to the right of a bed. It is to the left of another chair.
+
+
+GT: the brown ottoman is in front of abrown sofa . it has a black backpack .
+Scan2Cap: this is a brown chair. it is to the right of the room.
+Ours: this is a brown armchair . It isbehind the white chair facing a desk
+GT: there is a chair to the right of a bed. It is to the left of another chair.
+
+
+GT: the monitor is on the table. The monitor is the closest to the window
+Scan2Cap: this is a gray couch . it isfacing a table .
+Ours: this is a brown couch. it is to the left of the table against the wall.
+GT: there is a brown couch . it isbetween the wall and the table
+
+from the same class ("Multiple" case). Our end-to-end speaker-listener (last row) outperforms all previous method including 3DVG-Trans.
+
+# 4.5 Qualitative Analysis
+
+3D dense captioning Fig. 4 compares our results with object captions from Scan2Cap [7]. Descriptions generated by Scan2Cap cannot uniquely identify the target object in the input scenes (see the yellow block on the bottom right). Also, Scan2Cap produces inaccurate object bounding boxes, which affects the quality of object captions (see the yellow block on the top left). Compared to captions from Scan2Cap, our method produces more discriminative object captions that specifies more spatial relations (see bolded phrases in the blue blocks).
+
+3D visual grounding Fig. 5 compares our results with 3DVG-Transformer [60]. Though 3DVG-Transformer is able to pick the correct object, it suffers from poor object detections and is constrained by the performance of the VoteNet-based detection backbone (see the first column). Our method is capable of selecting the queried objects while also predicting more accurate object bounding boxes.
+
+# 4.6 Analysis and Ablation Studies
+
+Does better detection backbone help? From Tab. 1, we see that using a better detector can significant improve performance. We further examine the ef-
+
+
+Fig.5: 3D visual grounding results using 3DVG-Transformer [60] and our method. 3DVG-Transformer fails to accurately predict object bounding boxes, while our method produces accurate bounding boxes and correctly distinguishes target objects from distractors.
+
+fect of using different detection backbones (VoteNet and PointGroup) compared to GT bounding boxes in Tab. 3. For each detection backbone, we use four variants of our method: the models trained without the joint speaker-listener architecture, and the speaker-listener architecture trained with CIDEr reward, listener reward and extra ScanNet data. The results with GT boxes show the effectiveness of our speaker-listener architecture, when detections are perfect. The large improvement from VoteNet [41] to PointGroup [25] show the importance of a better detection backbone. The gap between GT and VoteNet/PointGroup shows there is room for further improvement.
+
+Are the generated descriptions more discriminative? To check whether the speaker-listener architecture generates more discriminative descriptions, we conduct an automatic evaluation via a reverse task. In this task, we feed the generated descriptions and GT bounding boxes into a pretrained neural listener model similar to Zhao et al. [60]. The predicted visual grounding results are evaluated in the same way as in our 3D visual grounding experiments. Higher grounding accuracy indicates better discrimination, especially in the "Multiple" case. Results (Tab. 4) show that our speaker-listener architecture generates more discriminative descriptions compared to Scan2Cap [7]. The discrimination is further improved when training with extra ScanNet data. To disentangle the affect of imperfectly predicted bounding boxes, we also train and evaluate our method with GT boxes (see last two rows in Tab. 4). We see that our semi-supervised speaker-listener architecture generates more discriminative descriptions.
+
+Does the listener help with captioning? The third to the sixth rows in Tab. 1 measure the benefit of training the speaker together with the listener (Ours (CIDEr+loc.) and Ours (CIDEr+loc.+lobjcls.)) rather than training the speaker alone (Ours (CIDEr)). Training with the listener improves all captioning metrics. Also, training jointly with an unfrozen listener (Ours (CIDEr+loc.)
+
+Table 3: Quantitative results on object detection, dense captioning and visual grounding in RGB-D scans. We train our method using different detection backbones as well as the ground truth bounding boxes. Our method trained with CIDEr and listener reward as well as the additional data outperforms the pretrained speaker and listener models.
+
+| Method | Detection | mAP@0.5 | C@0.5IoU | B-4@0.5IoU | M@0.5IoU | R@0.5IoU | Unique Acc@0.5IoU | Multiple Acc@0.5IoU | Overall Acc@0.5IoU |
| Ours (MLE) | GT | 100.00 | 71.41 | 42.95 | 29.67 | 64.93 | 88.45 | 36.46 | 46.03 |
| Ours (CIDEr) | GT | 100.00 | 94.80 | 47.92 | 30.80 | 66.34 | - | - | - |
| Ours (CIDEr+lis.) | GT | 100.00 | 95.62 | 47.65 | 30.93 | 66.31 | 89.76 | 36.85 | 47.14 |
| Ours (CIDEr+lis.+extra) | GT | 100.00 | 96.31 | 48.20 | 30.80 | 66.10 | 89.86 | 40.66 | 48.17 |
| Ours (MLE) | VoteNet | 32.21 | 39.08 | 23.32 | 21.97 | 44.78 | 56.41 | 21.11 | 27.95 |
| Ours (CIDEr) | VoteNet | 37.66 | 46.88 | 25.96 | 22.10 | 44.69 | - | - | - |
| Ours (CIDEr+lis.) | VoteNet | 38.03 | 47.32 | 24.76 | 21.66 | 43.62 | 57.90 | 20.73 | 28.03 |
| Ours (CIDEr+lis.+extra) | VoteNet | 38.82 | 48.38 | 26.09 | 22.15 | 44.74 | 58.40 | 21.66 | 29.25 |
| Ours (MLE) | PointGroup | 47.19 | 46.07 | 30.29 | 24.35 | 51.67 | 70.35 | 27.11 | 35.58 |
| Ours (CIDEr) | PointGroup | 52.44 | 57.88 | 32.64 | 24.86 | 52.26 | - | - | - |
| Ours (CIDEr+lis.) | PointGroup | 52.58 | 61.50 | 35.05 | 25.48 | 53.31 | 71.04 | 27.40 | 35.62 |
| Ours (CIDEr+lis.+extra) | PointGroup | 53.95 | 62.64 | 35.68 | 25.72 | 53.90 | 72.04 | 30.05 | 37.87 |
+
+Table 4: We automatically evaluate the discriminability of the generated object descriptions. A pretrained neural listener similar to Zhao et al. [60] is fed with the GT object features and the descriptions generated by Scan2Cap [7] as well as our method. Higher grounding accuracy indicates better discriminability, especially in the "multiple" case. To alleviate noisy detections, the evaluation results on the descriptions generated from the GT object features are also presented. Our method generates more discriminative descriptions compared to Scan2Cap.
+
+ | detection | Unique Acc@0.5IoU | Multiple Acc@0.5IoU | Overall Acc@0.5IoU |
| Scan2Cap [7] | VN [41] | 80.52 | 29.95 | 39.08 |
| Ours (w/ CIDEr & lis.) | PG [25] | 81.16 | 30.22 | 41.62 |
| Ours (w/ CIDEr & lis. & extra) | PG [25] | 81.27 | 30.33 | 41.73 |
| Ours (w/ CIDEr & lis.) | GT | 89.76 | 38.53 | 48.07 |
| Ours (w/ CIDEr & lis. & extra) | GT | 90.29 | 40.66 | 49.71 |
+
+leads to a better performance when compared with the variant with a pretrained and frozen listener (Ours (CIDEr+fixed loc.), which is similar to Achlioptas et al. [2]. Additionally, as the detector is not only fine-tuned with the speaker but also with the listener, the additional supervision from the listener helps with the detection performance as well.
+
+To analyze the quality of the generated object captions, we asked 5 students to perform a fine-grained manual analysis of the captions. Each student was presented with a batch of 100 randomly selected object captions with associated objects highlighted in the 3D scene. The student are then asked to indicate if the respective aspects were included and correctly described. The manual analysis results in Tab. 5 shows that our method generates more accurate descriptions compared to Scan2Cap. In particular, training with the listener and extra ScanNet data produces more accurate spatial relations in the descriptions. The results
+
+Table 5: Manual analysis of captions generated by Scan2Cap [7] and variants of our method. We measure accuracy in three different aspects: object categories, appearance attributes and spatial relations. Our method generates more accurate descriptions in all aspects, especially for describing spatial relations.
+
+ | Acc (Category) | Acc (Attribute) | Acc (Relation) |
| Scan2Cap [7] | 84.10 | 64.21 | 69.00 |
| Ours (MLE) | 88.00 (+3.84) | 74.73 (+10.53) | 69.00 (+0.00) |
| Ours (CIDEr) | 88.89 (+4.73) | 75.00 (+10.79) | 68.00 (-1.00) |
| Ours (CIDEr+lis.) | 90.91 (+6.75) | 77.38 (+13.17) | 75.00 (+6.00) |
| Ours (CIDEr+lis.+extra) | 92.93 (+8.77) | 80.95 (+16.74) | 78.57 (+9.57) |
+
+of fine-grained manual analysis complements the automatic captioning evaluation metric. While metrics such as CIDEr captures the overall similarity of the generated sentences against the references, the accuracies in Tab. 5 measures the correctness of the decomposed visual attributes.
+
+Does the speaker help with grounding? Tab. 2 compares grounding results between a pretrained listener (Ours w/o fine-tuning) and a fine-tuned speaker-listener model (Ours). Although the grounding performance drops in the "Unique" subset, the improvements in "Multiple" suggests better discriminability in tougher and ambiguous scenarios.
+
+# 5 Conclusion
+
+We present D $^3$ Net, an end-to-end speaker-listener architecture that can detect, describe and discriminate. Specifically, the speaker iteratively generates descriptive tokens given the object proposals detected by the detector, while the listener discriminates the object proposals in the scene with the generated captions. The self-discriminative property of D $^3$ Net also enables semi-supervised training on ScanNet data without the annotated descriptions. Our method outperforms the previous SOTA methods in both tasks on ScanRefer, surpassing the previous SOTA 3D dense captioning method by a significant margin. Our architecture can serve as an initial step towards leveraging unannotated 3D data for language and 3D vision. Overall, we hope that our work will encourage more future research in 3D vision and language.
+
+# Acknowledgements
+
+This work is funded by Google (AugmentedPerception), the ERC Starting Grant Scan2CAD (804724), and a Google Faculty Award. We would also like to thank the support of the TUM-IAS Rudolf Moßbauer and Hans Fischer Fellowships (Focus Group Visual Computing), as well as the German Research Foundation (DFG) under the Grant Making Machine Learning on Static and Dynamic 3D Data Practical. This work is also supported in part by the Canada CIFAR AI Chair program and an NSERC Discovery Grant.
+
+# References
+
+1. Achlioptas, P., Abdelreheem, A., Xia, F., Elhoseiny, M., Guibas, L.: ReferIt3D: Neural listeners for fine-grained 3D object identification in real-world scenes. In: European Conference on Computer Vision, pp. 422-440, Springer (2020) 2, 3, 8
+2. Achlioptas, P., Fan, J., Hawkins, R., Goodman, N., Guibas, L.J.: ShapeGlot: Learning language for shape differentiation. In: Proceedings of the IEEE international conference on computer vision (2019) 3, 4, 13
+3. Anderson, P., He, X., Buehler, C., Teney, D., Johnson, M., Gould, S., Zhang, L.: Bottom-up and top-down attention for image captioning and visual question answering. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6077-6086 (2018) 3
+4. Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al.: Language models are few-shot learners. arXiv preprint arXiv:2005.14165 (2020) 1
+5. Chang, A., Dai, A., Funkhouser, T., Halber, M., Niebner, M., Savva, M., Song, S., Zeng, A., Zhang, Y.: Matterport3D: Learning from RGB-D data in indoor environments. In: Proceedings of the International Conference on 3D Vision, pp. 667-676, IEEE (2017) 1
+6. Chen, D.Z., Chang, A.X., Nießner, M.: ScanRefer: 3D object localization in RGB-D scans using natural language. In: Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XX 16, pp. 202-221, Springer (2020) 1, 2, 3, 5, 6, 8, 10
+7. Chen, D.Z., Gholami, A., Nießner, M., Chang, A.X.: Scan2Cap: Context-aware dense captioning in RGB-D scans. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3193-3203 (2021) 1, 2, 3, 5, 7, 9, 11, 12, 13, 14
+8. Chen, K., Choy, C.B., Savva, M., Chang, A.X., Funkhouser, T., Savarese, S.: Text2shape: Generating shapes from natural language by learning joint embeddings. In: Asian Conference on Computer Vision, pp. 100-116, Springer (2018) 3
+9. Choy, C., Gwak, J., Savarese, S.: 4D spatio-temporal ConvNets: Minkowski convolutional neural networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3075-3084 (2019) 9
+0. Cole, P., Morgan, J.L.: Syntax and semantics. volume 3: Speech acts. Tijdschrift Voor Filosofie 39(3) (1977) 4
+1. Dai, A., Chang, A.X., Savva, M., Halber, M., Funkhouser, T., Nießner, M.: ScanNet: Richly-annotated 3D reconstructions of indoor scenes. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5828-5839 (2017) 1, 3, 8
+2. Dai, A., Nießner, M.: 3DMV: Joint 3D-multi-view prediction for 3D semantic scene segmentation. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 452-468 (2018) 5
+3. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018) 1
+4. Donahue, J., Anne Hendricks, L., Guadarrama, S., Rohrbach, M., Venugopalan, S., Saenko, K., Darrell, T.: Long-term recurrent convolutional networks for visual recognition and description. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2625-2634 (2015) 3
+
+15. Fried, D., Hu, R., Cirik, V., Rohrbach, A., Andreas, J., Morency, L.P., Berg-Kirkpatrick, T., Saenko, K., Klein, D., Darrell, T.: Speaker-follower models for vision-and-language navigation. In: Advances in Neural Information Processing Systems (2018) 4
+16. Golland, D., Liang, P., Klein, D.: A game-theoretic approach to generating spatial descriptions. In: Proceedings of the 2010 conference on empirical methods in natural language processing, pp. 410-419 (2010) 4
+17. Hendricks, L.A., Akata, Z., Rohrbach, M., Donahue, J., Schiele, B., Darrell, T.: Generating visual explanations. In: European conference on computer vision, pp. 3-19, Springer (2016) 6
+18. Hou, J., Dai, A., Nießner, M.: 3D-SIS: 3D semantic instance segmentation of RGB-D scans. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4421-4430 (2019) 1
+19. Hou, J., Dai, A., Nießner, M.: **RevealNet:** Seeing behind objects in RGB-D scans. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2098-2107 (2020) 1
+20. Hu, R., Rohrbach, M., Darrell, T.: Segmentation from natural language expressions. In: European Conference on Computer Vision, pp. 108-124, Springer (2016) 4
+21. Hu, R., Xu, H., Rohrbach, M., Feng, J., Saenko, K., Darrell, T.: Natural language object retrieval. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4555-4564 (2016) 4
+22. Hua, B.S., Pham, Q.H., Nguyen, D.T., Tran, M.K., Yu, L.F., Yeung, S.K.: Scenenn: A scene meshes dataset with annotations. In: 2016 Fourth International Conference on 3D Vision (3DV), pp. 92-101, IEEE (2016) 1
+23. Huang, P.H., Lee, H.H., Chen, H.T., Liu, T.L.: Text-guided graph neural networks for referring 3D instance segmentation. In: Proceedings of the AAAI Conference on Artificial Intelligence (2021) 2, 10
+24. Jang, E., Gu, S., Poole, B.: Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144 (2016) 7
+25. Jiang, L., Zhao, H., Shi, S., Liu, S., Fu, C.W., Jia, J.: PointGroup: Dual-set point grouping for 3D instance segmentation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4867-4876 (2020) 3, 5, 6, 9, 12, 13
+26. Jiang, W., Ma, L., Jiang, Y.G., Liu, W., Zhang, T.: Recurrent fusion network for image captioning. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 499-515 (2018) 3
+27. Johnson, J., Karpathy, A., Fei-Fei, L.: Densecap: Fully convolutional localization networks for dense captioning. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4565-4574 (2016) 4
+28. Karpathy, A., Fei-Fei, L.: Deep visual-semantic alignments for generating image descriptions. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3128-3137 (2015) 3
+29. Kazemzadeh, S., Ordonez, V., Matten, M., Berg, T.: Referitgame: Referring to objects in photographs of natural scenes. In: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 787-798 (2014) 4
+30. Kim, D.J., Choi, J., Oh, T.H., Kweon, I.S.: Dense relational captioning: Triple-stream networks for relationship-based captioning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6271-6280 (2019) 4
+
+31. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014) 9
+32. Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: European conference on computer vision, pp. 740-755, Springer (2014) 2
+33. Liu, X., Li, H., Shao, J., Chen, D., Wang, X.: Show, tell and discriminate: Image captioning by self-retrieval with partially labeled data. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 338-354 (2018) 2, 3, 6, 7
+34. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., Stoyanov, V.: Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692 (2019) 1
+35. Lu, J., Xiong, C., Parikh, D., Socher, R.: Knowing when to look: Adaptive attention via a visual sentinel for image captioning. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 375-383 (2017) 3
+36. Luo, R., Price, B., Cohen, S., Shakhnarovich, G.: Discriminability objective for training descriptive captions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6964-6974 (2018) 2, 3, 6, 7
+37. Luo, R., Shakhnarovich, G.: Comprehension-guided referring expressions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7102-7111 (2017) 4
+38. Mao, J., Huang, J., Toshev, A., Camburu, O., Yuille, A.L., Murphy, K.: Generation and comprehension of unambiguous object descriptions. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 11-20 (2016) 4
+39. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., Chintala, S.: Pytorch: An imperative style, high-performance deep learning library. In: Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., Garnett, R. (eds.) Advances in Neural Information Processing Systems 32, pp. 8024-8035, Curran Associates, Inc. (2019) 9
+40. Plummer, B.A., Wang, L., Cervantes, C.M., Caicedo, J.C., Hockenmaier, J., Lazebnik, S.: Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In: Proceedings of the IEEE international conference on computer vision, pp. 2641–2649 (2015) 4
+41. Qi, C.R., Litany, O., He, K., Guibas, L.J.: Deep Hough voting for 3D object detection in point clouds. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9277-9286 (2019) 1, 3, 12, 13
+42. Ranzato, M., Chopra, S., Auli, M., Zaremba, W.: Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732 (2015) 6
+43. Rennie, S.J., Marcheret, E., Mroueh, Y., Ross, J., Goel, V.: Self-critical sequence training for image captioning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7008-7024 (2017) 3, 6, 7
+44. Roh, J., Desingh, K., Farhadi, A., Fox, D.: LanguageRefer: Spatial-language model for 3D visual grounding. In: Proceedings of the Conference on Robot Learning (2021) 3
+45. Sidorov, O., Hu, R., Rohrbach, M., Singh, A.: Textcaps: a dataset for image captioning with reading comprehension. In: European Conference on Computer Vision, pp. 742-758, Springer (2020) 3
+46. Song, S., Lichtenberg, S.P., Xiao, J.: SUN RGB-D: A RGB-D scene understanding benchmark suite. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 567-576 (2015) 1
+
+47. Thomason, J., Shridhar, M., Bisk, Y., Paxton, C., Zettlemoyer, L.: Language grounding with 3D objects. In: Proceedings of the Conference on Robot Learning (2021) 3
+48. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in neural information processing systems, pp. 5998-6008 (2017) 1
+49. Vedantam, R., Lawrence Zitnick, C., Parikh, D.: Cider: Consensus-based image description evaluation. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4566-4575 (2015) 4
+50. Vinyals, O., Toshev, A., Bengio, S., Erhan, D.: Show and tell: A neural image caption generator. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3156-3164 (2015) 3
+51. Williams, R.J.: Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning 8(3), 229-256 (1992) 4, 5
+52. Wu, X., Averbuch-Elor, H., Sun, J., Snavely, N.: Towers of babel: Combining images, language, and 3D geometry for learning multimodal vision. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (2021) 3
+53. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., Bengio, Y.: Show, attend and tell: Neural image caption generation with visual attention. In: International conference on machine learning, pp. 2048-2057 (2015) 3
+54. Yang, L., Tang, K., Yang, J., Li, L.J.: Dense captioning with joint inference and visual context. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2193-2202 (2017) 4
+55. Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R.R., Le, Q.V.: XLNet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems 32 (2019) 1
+56. Yu, L., Lin, Z., Shen, X., Yang, J., Lu, X., Bansal, M., Berg, T.L.: MatttNet: Modular attention network for referring expression comprehension. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1307-1315 (2018) 4
+57. Yu, L., Tan, H., Bansal, M., Berg, T.L.: A joint speaker-listener-reinforcer model for referring expressions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7282-7290 (2017) 4, 6
+58. Yuan, Z., Yan, X., Liao, Y., Guo, Y., Li, G., Li, Z., Cui, S.: X-Trans2Cap: Cross-modal knowledge transfer using transformer for 3D dense captioning (2022), arXiv:2203.00843 2, 3, 9
+59. Yuan, Z., Yan, X., Liao, Y., Zhang, R., Wang, S., Li, Z., Cui, S.: InstanceRefer: Cooperative holistic understanding for visual grounding on point clouds through instance multi-level contextual referring. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1791-1800 (2021) 1, 2, 3, 10
+60. Zhao, L., Cai, D., Sheng, L., Xu, D.: 3DVG-Transformer: Relation modeling for visual grounding on point clouds. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2928-2937 (2021) 1, 2, 3, 5, 10, 11, 12, 13
\ No newline at end of file
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/images.zip b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..5c2365bb1854dc848bef2f757d1c66ab92e78410
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a68431654f4b7667488c6ba623d76a80c91df834c9a98acde6cd10457d58d7a1
+size 451152
diff --git a/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/layout.json b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..60bc2f397145fd1e6f134bd3a81681df7ceb7d7d
--- /dev/null
+++ b/d3netaunifiedspeakerlistenerarchitecturefor3ddensecaptioningandvisualgrounding/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3cb63a3163bb814b09a9842331e96d816e91e7d0b46b3db0600e1990b0a8fdd4
+size 409736
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_content_list.json b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ce31ccf2261eeb317b3446261f04e21bec8250b8
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f7058f90ee6eb6904f3f41d141ed27429d872be42af561ae544114c88aae4690
+size 91067
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_model.json b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..d59e7eca9fa50da4f3644acd33a23deac061a38d
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6694f7de3360ea9b27153f04efad87357d14e33eb3498b1c024b78d87a1903f8
+size 119944
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_origin.pdf b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..bdeafef76544280fbc28feecadc58f96c0175c47
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/b3e479f1-6e77-4242-80e0-2befbcbd70ea_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ae40efeb4d35d7d1152f3a36e9723efeda0e46698ca61623f90ba2041d4b693
+size 8838051
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/full.md b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..d6d93ca416a3f6f06ed0cdda633e7298a3332f09
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/full.md
@@ -0,0 +1,442 @@
+# DANBO: Disentangled Articulated Neural Body Representations via Graph Neural Networks
+
+Shih-Yang Su
+
+Timur Bagautdinov2
+
+Helge Rhodin
+
+1 University of British Columbia
+
+$^{2}$ Reality Labs Research
+
+
+Fig.1: DANBO enables learning volumetric body models from scratch, only requiring a single video as input, yet enable driving by unseen poses (inset) that are out of the training distribution, showing better robustness than existing surface-free approaches. Real faces are blurred for anonymity.
+
+Abstract. Deep learning greatly improved the realism of animatable human models by learning geometry and appearance from collections of 3D scans, template meshes, and multi-view imagery. High-resolution models enable photo-realistic avatars but at the cost of requiring studio settings not available to end users. Our goal is to create avatars directly from raw images without relying on expensive studio setups and surface tracking. While a few such approaches exist, those have limited generalization capabilities and are prone to learning spurious (chance) correlations between irrelevant body parts, resulting in implausible deformations and missing body parts on unseen poses. We introduce a three-stage method that induces two inductive biases to better disentangled pose-dependent deformation. First, we model correlations of body parts explicitly with a graph neural network. Second, to further reduce the effect of chance correlations, we introduce localized per-bone features that use a factorized volumetric representation and a new aggregation function. We demonstrate that our model produces realistic body shapes under challenging unseen poses and shows high-quality image synthesis. Our proposed representation strikes a better trade-off between model capacity, expressiveness, and robustness than competing methods. Project website: https://lemonatsu.github.io/danbo.
+
+Keywords: 3D computer vision, body models, monocular, neural fields, deformation
+
+# 1 Introduction
+
+Animating real-life objects in the digital world is a long-pursued goal in computer vision and graphics, and recent advances already enable 3D free-viewpoint video, animation, and human performance retargeting [17,41,53]. Nevertheless, animating high-definition virtual avatars with user-specific appearance and dynamic motion still remains a challenge: human body and clothing deformation are inherently complex, unique, and modeling their intricate effects require dedicated approaches. Recent solutions achieve astonishing results [10,29,44,47,48] when grounding on 3D data capture in designated studio settings, e.g., with multi-camera capture systems and controlled illumination—inaccessible to the general public for building personalized models.
+
+Less restrictive are methods relying on parametric body models [31] that learn plausible body shape, pose, and deformation from a collection of 3D scans. These methods can thereby adapt to a wide range of body shapes [4,11,36], in particular when using neural approaches to model details as a dynamic corrective [6,8,14]. Even though subject-specific details such as clothing can be learned, it remains difficult to generalize to shapes vastly different from the original scans. Moreover, the most widely used body models have restrictive commercial licenses [31] and 3D scan datasets to train these afresh are expensive.
+
+Our goal is to learn a high-quality model with subject-specific details directly from images. Recent approaches in this class [35,46] use a neural radiance field (NeRF) that is attached to a human skeleton initialized with an off-the-shelf 3D human pose estimator. Similar to the original NeRF, the shape and appearance are modeled implicitly with a neural network that takes as input a query location and outputs density and radiance, and is only supervised with images through differentiable volume rendering. However, unlike the original that models static scenes, articulated NeRFs model time-varying body shape deformations by conditioning on per-frame body pose and representing each frame with the same underlying body model albeit in a different state. This results in an animatable full-body model that is trained directly from videos and can then be driven with novel skeleton poses.
+
+Not using an explicit surface poses a major difficulty as surface-based solutions exploit surface points to anchor neural features locally as vertex attributes [41], and leverage skinning weights to associate points on or close to the surface to nearby body parts [29,40]. In absence of such constraints, A-NeRF [46] uses an overparametrization by encoding 3D position relative to all body parts. Thereby dependencies between a point and body parts are learned implicitly. By contrast, NARF [35] explicitly predicts probabilities for the association of 3D points to body parts, similar to NASA [15]. However, this probability predictor is conditioned on the entire skeleton pose and is itself prone to poor generalization. Therefore, both approaches rely on large training datasets and generalization to unseen poses is limited—in particular because unrelated body parts remain weakly entangled.
+
+In this paper, we introduce Disentangled Articulated Neural BOdy (DANBO), a surface-free approach that explicitly disentangles independent body parts for
+
+learning a generalizable personalized human model from unlabelled videos. It extends the established articulated NeRF-based body modeling with two additional stages, a body part-specific volumetric encoding that exploits human skeleton structure as a prior using Graph Neural Networks (GNN) [23], and a new aggregation module. Both designs are tailored for learning from few examples and optimized to be parameter efficient. Our main contributions are the following:
+
+- A surface-free human body model with better texture detail and improved generalization when animated.
+- GNN-based encoding that disentangles features from different body parts and relies on factorized per-bone volumes for efficiency.
+- A part-based feature aggregation strategy that improves on and is informed by a detailed evaluation of existing aggregation functions.
+
+We demonstrate that our proposed DANBO results in a generalizable neural body model, with quality comparable to surface-based approaches.
+
+# 2 Related Work
+
+We start our review with general-purpose neural fields and then turn to human body modeling with a focus on animatable neural representations.
+
+Neural fields. Neural fields [34,37,45] have attracted recent attention due to their ability to capture astonishing levels of detail. Instead of relying on explicit geometry representations such as triangle meshes or voxel grids, these methods represent the scene implicitly - as a continuous function - that maps every point in the 3D space to quantities of interest such as radiance, density, or signed distance. This approach was popularized with Neural Radiance Fields (NeRF) [34] demonstrating impressive results on reconstructing static 3D scene presentation directly from calibrated multi-view images. Various subsequent works focused on improving performance on static scenes in terms of generalization [59], level of detail [5,38], camera self-calibration [27,57], and resource efficiency [28,58]. Most relevant are deformable models that capture non-static scenes with deformation fields [16,17,43,49,53]. However, general deformation fields are unsuitable for animation and no one demonstrated that they can generalize to strongly articulated motion in monocular video.
+
+Template-based body models. The highest level of detail can be attained with specialized performance capture systems, e.g., with dozens of cameras or a laser scanner [19]. The resulting template mesh can then be textured and deformed for capturing high-quality human performances, even from a single video [61]. Neural approaches further enable learning pose-dependent appearance and geometries [3], predict vertex displacements [20] or local primitive volumes [30] for creating fine-grained local geometry and appearance including cloth wrinkles
+
+and freckles. The most recent ones use neural fields to learn implicit body models with the mesh providing strong supervision signals [2,10,44,51,54]. However, template creation is limited to expensive controlled studio environments, often entails manual cleaning, and high-quality ground truth annotations.
+
+Parametric Human Body Models learn common shape and pose properties from a large corpus of 3D scans [4,11,31,36]. For classical approaches the result are factorized parameters for controlling pose, shape [11,31,36,55] and even clothing [47] that can fit to a new subject. Most prevalent is the SMPL [11,31] mesh model with a linear shape space and pose-dependent deformation. However, most existing models have restrictive commercial licenses and modeling person-specific details from images requires additional reconstruction steps.
+
+Personalized Body Models. Learning personalized body models given only videos of a single actor is particularly challenging. Most existing approaches start from estimating a parametric surface model such as SMPL and extend it to learn specifics. For instance, one can anchor neural features spatially by associating each SMPL vertex with a learnable latent feature, and then either diffuse vertex features to the 3D space [26,41] or project the 3D query point to the SMPL surface for feature retrieval. Incorrect shape estimates and missing details can then be corrected by a subsequent neural rendering step. As texturing improves classical approaches, neural texture mapping provides additional rendering quality [29]. Another line of work makes use of SMPL blend skinning weights as initialization for learning deformation fields [40]. The deformation field maps 3D points from 3D world space to canonical space, which enables learning a canonical neural body field that predicts the radiance and density for rendering as for the classical NeRF on static scenes. While the skinning weights in SMPL provide an initialization, [40] showed that fine-tuning the deformation fields via self-supervision helps rendering unseen poses. However, relying on body models imposes the previously discussed limitations.
+
+There are few methods that target learning neural body fields from images without relying on an explicit surface model. Closest to our method are NARF [35] and A-NeRF [46], that learn articulated body models directly from image sequences, leveraging 3D body pose estimates produced by off-the-shelf approaches [25,24]. These methods encode 3D query points with respect to each bone on the posed skeleton, and either explicitly predict blending weights [35] to select the parts of influence or rely on a neural network to learn the assignment implicitly by feeding it a large stack of all relative positions [46]. However, lacking a prior for part assignments leads to spurious dependencies between irrelevant body parts when the training poses are scarce and have low diversity [3,44]. Our approach follows the same surface-free setting but improves upon these by introducing body part disentangled representations and a new aggregation function that achieves better rendering quality and improved generalization on novel body poses. A concurrent work COAP [33] shares a similar part-disentangle concept, but differs significantly. COAP models part geometries separately from 3D scans, whereas DANBO leverages the skeleton structure as a prior to fuse information
+
+
+Fig. 2: Overview. The final image is generated via volume rendering by sampling points $\mathbf{x}$ along the ray $\mathbf{d}$ as in the original NeRF. Different is the conditioning on pose. First, pose features are encoded locally to every bone of a skeleton with a graph neural network using factorized volumes to increase efficiency (green boxes). Second, these disentangled features are queried and aggregated with learned weights (red module). Finally, the body shape and appearance are predicted via density and radiance fields $\sigma$ and $c$ (blue module).
+
+from neighboring body parts, and learns both appearance and body geometry from images without 3D supervisions.
+
+# 3 Method
+
+Our goal is to learn an animatable avatar from a collection of $N$ images $[\mathbf{I}_k]_{k=1}^N$ and the corresponding body pose in terms of skeleton joint angles $[\theta_k]_{k=1}^N$ that can stem from an off-the-shelf estimator [25,24], without using laser scans or surface tracking. We represent the human body as a neural field that moves with the input body pose. The neural field maps each 3D location to color and density to generate a free-viewpoint synthetic image via volume rendering. See Figure 2 for an overview. Our approach consists of three stages that are trained end-to-end. The first stage predicts a localized volumetric representation for each body part with a Graph Neural Network (GNN). GNN has a limited receptive field and encodes only locally relevant pose information—which naturally leads to better disentangling between body parts in the absence of surface priors. This stage is independent of the query locations and is thus executed only once per frame. Additional performance is gained by using a factorized volume and encouraging the volume bounds to be compact. The second stage retrieves a feature code for each query point by sampling volume features for all body parts that enclose the point and then aggregating the relevant ones using a separate network that predicts blend weights. Finally, the third stage maps the resulting per-query feature code to the density and radiance at that location, followed by the volume rendering as in the original NeRF.
+
+# 3.1 Stage I: Part-disentangled Feature Computation
+
+Given a pose $\theta = [\omega_1, \omega_2, \dots, \omega_{24}]$ , where $\omega_i \in \mathbb{R}^6$ [62] defines the rotation of the bone $i = 1, 2, \dots, 24$ , we represent the body part attached to each bone $i$ with
+
+a coarse volume $V$ (green boxes in Fig. 2), predicted by a neural network $G$ ,
+
+$$
+[ V _ {1}, V _ {2}, \dots , V _ {2 4} ] = G (\theta). \tag {1}
+$$
+
+We design $G$ as a GNN operating on the skeleton graph with nodes initialized to the corresponding joint angles in $\theta$ . In practice, we use two graph convolutional layers followed by per-node 2-layer MLPs. Because the human skeleton is irregular, we learn individual MLP weights for every node. See the supplemental for additional details on the graph network.
+
+Factorized volume. A straight-forward way to represent a volume is via a dense voxel grid, which has cubic complexity with respect to its resolution. Instead, we propose to factorize each volume $V_{i} = (v_{i}^{x}, v_{i}^{y}, v_{i}^{z})$ as one vector $v_{i} \in \mathbf{R}^{H \times M}$ for each 3D axis, where $H$ is the voxel feature channel, and is $M$ the volume resolution. This is similar to [42] doing a factorization into 2D planes.
+
+Figure 3 shows how to retrieve a feature for a given 3D point $\hat{\mathbf{x}}_i$ from the volume by projecting to each axis and interpolating,
+
+$$
+h _ {i} ^ {x} = v _ {i} ^ {x} \left[ s _ {i} ^ {x} \hat {\mathbf {x}} _ {i} (x) \right] \in \mathbf {R} ^ {H}, \tag {2}
+$$
+
+
+Fig.3: We retrieve the voxel feature by projecting $\hat{\mathbf{x}}$ to the three axes and linearly interpolating the feature neighboring the projected location.
+
+where $s_i^x$ is a learnable scaling factor to control the volume size along the x-axis, and $v_{i}^{x}[\cdot ]$ returns the interpolated feature when the projected and scaled coordinate falls in $[-1,1]$ , and 0 otherwise. The extraction for y and z axes follows the same procedure.
+
+The GNN attaches one factorized volume to every bone $i$ and is computed only once for every pose.
+
+In Section 4.4, we show that the factorized volumes compare favorably against full 3D volumes on short video sequences with sparse or single views, while having $2\mathrm{x}$ lower parameter counts.
+
+# 3.2 Stage II: Global Feature Aggregation
+
+Given a query location $\mathbf{x} \in \mathbf{R}^3$ in global coordinates, the corresponding voxel feature can be retrieved by first mapping the 3D points to the bone-relative space of $i$ via the world-to-bone coordinates transformation $T(\omega_i)$ ,
+
+$$
+\left[ \begin{array}{c} \hat {\mathbf {x}} _ {i} \\ 1 \end{array} \right] = T (\omega_ {i}) \left[ \begin{array}{c} \mathbf {x} \\ 1 \end{array} \right], \tag {3}
+$$
+
+and then retrieving the factorized features with equation Eq. 2. However, multiple volumes can overlap.
+
+Windowed bounds. To facilitate learning volume dimensions $s_x$ that adapt to the body shape and to mitigate seam artifacts, we apply a window function
+
+$$
+w _ {i} = \exp (- \alpha (\hat {\mathbf {x}} _ {i} (x) ^ {\beta} + \hat {\mathbf {x}} _ {i} (y) ^ {\beta} + \hat {\mathbf {x}} _ {i} (z) ^ {\beta})) \tag {4}
+$$
+
+that attenuates the feature value $h_i = w_i[h_i^x, h_i^y, h_i^z]$ for $\hat{\mathbf{x}}_i$ towards the boundary of the volume, with $\alpha = 2$ and $\beta = 6$ similar to [30]. Still, multiple volumes will overlap near joints and when body parts are in contact. Moreover, the overlap changes with varying skeleton pose, demanding for an explicit aggregation step.
+
+Voxel Aggregation Network. Since an $\mathbf{x}$ that is close to the body falls into multiple volumes, we employ a voxel aggregation network $A$ to decide which per-bone voxel features to pass on to the downstream neural field for rendering. We explore several strategies, and conduct ablation studies on each of the options. Our aggregation network $A$ consists of a graph layer followed by per-node 2-layer MLPs with a small network width (32 per layer). We predict the weight $p_i$ for the feature retrieved from bone $i$ and compute the aggregated features via
+
+$$
+p _ {i} = A _ {i} \left(h _ {i}\right), \text {a n d a g g r e g a t e d f e a t u r e} \hat {h} = \sum_ {i = 1} ^ {2 4} p _ {i} h _ {i}. \tag {5}
+$$
+
+Below, we discuss the three strategies for computing the aggregation weights.
+
+Concatenate. Simply concatenating all features lets the network disentangle individual factors, which is prone to overfitting as no domain knowledge is used.
+
+Softmax-OOB. Instead of simply using Softmax to obtain sparse and normalized weights as in [15,35], we can make use of our volume representation to remove the influence of irrelevant bones
+
+$$
+p _ {i} = \frac {\left(1 - o _ {i}\right) \exp \left(a _ {i}\right)}{\sum_ {j = 1} ^ {2 4} \left(1 - o _ {i}\right) \exp \left(a _ {j}\right)}, \tag {6}
+$$
+
+where $o_i$ is the out-of-bound (OOB) indicator which equals to 1 when $\hat{\mathbf{x}}_i$ is not inside of $V_{i}$ . The potential caveat is that $\hat{h}$ is still susceptible to features from irrelevant volumes. For instance, Figure 4 shows that Softmax-OOB produces artifacts when the hand gets close to the chest.
+
+Soft-softmax Due to the design of $A$ , the output logit $a_{i}$ of bone $i$ is only dependent on itself. We can leverage this design to obtain the weight for each $V_{i}$ independently and normalize their range to $[0,1]$ with a sigmoid function,
+
+$$
+p _ {i} = \left(1 - o _ {i}\right) \cdot S \left(a _ {i}\right), \text {w h e r e} S = \frac {1}{1 + \exp \left(- a _ {i}\right)}. \tag {7}
+$$
+
+
+SoftmaxOOB Soft-softmax
+Fig.4: The influence of aggregation strategies.
+
+To nevertheless ensure that aggregated features are in the same range irrespectively of the number of contributors, we introduce a soft-softmax constraint
+
+$$
+L _ {\mathrm {s}} = \sum_ {\mathbf {x}} \left(\sum_ {i = 1} ^ {2 4} \left(1 - o _ {i}\right) p _ {i} - l _ {\mathbf {x}}\right) ^ {2}, \tag {8}
+$$
+
+that acts as a soft normalization factor opposed to the hard normalization in softmax. By setting $l_{\mathbf{x}} = 1$ if $T_{\mathbf{x}} \cdot \sigma_{\mathbf{x}} > 0$ and 0 otherwise, the loss enforces the sum of weights of the activated bones to be close to 1 when the downstream neural field has positive density prediction $\sigma$ (e.g., when $\mathbf{x}$ belong to the human body), and 0 otherwise. The results is a compromise between an unweighted sum and softmax that attained the best generalization in our experiments. A representative improvement on softmax is shown in Figure 4-right.
+
+# 3.3 Stage III: Neural Field and Volume Rendering
+
+The aggregated features $\hat{h}$ contain the coarse, pose-dependent body features at location $\mathbf{x}$ . To obtain high-quality human body, we learn a neural field $F$ to predict the refined radiance $c$ and density $\sigma$ for $\mathbf{x}$
+
+$$
+(c, \sigma) = F (\hat {h}, \mathbf {d}), \tag {9}
+$$
+
+where $\mathbf{d} \in \mathbf{R}^2$ is the view direction. We can then render the image of the human subject by volume rendering as in the original NeRF [34],
+
+$$
+\hat {\mathbf {I}} (u, v; \theta) = \sum_ {q = 1} ^ {Q} T _ {q} \left(1 - \exp \left(- \sigma_ {q} \delta_ {q}\right)\right) c _ {q}, \quad T _ {q} = \exp \left(- \sum_ {j = 1} ^ {q - 1} \sigma_ {j} \delta_ {j}\right). \tag {10}
+$$
+
+Given the pose $\theta$ , the predicted image color at the 2D pixel location $\hat{\mathbf{I}}(u, v; \theta)$ is computed by integrating the predicted color $c_{q}$ of the $Q$ 3D samples along $\mathbf{d}$ . $\delta_{q}$ is the distance between neighboring samples, and $T_{q}$ represents the accumulated transmittance at sample $q$ .
+
+# 3.4 Training
+
+Our model is directly supervised with ground truth images via photometric loss
+
+$$
+L _ {\mathrm {p}} = \sum_ {(u, v) \in \mathbf {I}} | \hat {\mathbf {I}} (u, v; \theta) - \mathbf {I} (u, v; \theta) |. \tag {11}
+$$
+
+We use L1 loss to avoid overfitting to appearance changes that cannot be explained by pose deformation alone. To prevent the per-bone volumes from growing too large and taking over other volumes, we employ a volume loss on the scaling factors as in [30]
+
+$$
+L _ {\mathrm {v}} = \sum_ {i = 1} ^ {2 4} \left(s ^ {x} \cdot s ^ {y} \cdot s ^ {z}\right). \tag {12}
+$$
+
+For Soft-softmax in Section 3.2, we further regularize the output weights via the self-supervised loss $L_{\mathrm{s}}$ .
+
+To summarize, the training objective of our approach is
+
+$$
+L = L _ {\mathrm {p}} + \lambda_ {\mathrm {v}} L _ {\mathrm {v}} + \lambda_ {\mathrm {s}} L _ {\mathrm {s}}. \tag {13}
+$$
+
+We set both $\lambda_{\mathrm{v}}$ and $\lambda_{\mathrm{s}}$ to 0.001 for all experiments. See the supplemental for more implementation details.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Training view
+
+
+NeuralBody
+
+
+Anim-NeRF
+
+
+A-NeRF
+
+
+DANBO (Ours)
+Fig. 5: Novel-view synthesis results on Human3.6M [21]. DANBO renders more complete limbs and clearer facial features than the baselines.
+
+
+Ground truth
+
+# 4 Experiments
+
+In the following, we evaluate the improvements upon the most recent surface-free neural body model A-NeRF [46], and compare against recent model-based solutions NeuralBody [41] and Anim-NeRF [40]. An ablation study further quantifies the improvement of using the proposed aggregation function, local GNN features, and factorized volumes over simpler and more complex [30] alternatives, including the effects on model capacity. The supplemental materials provide additional quantitative and qualitative results, including videos of retargeting applications. Metrics and protocols. Our goal is to analyze the quality of synthesizing novel views and separately the rendering of previously unseen poses. We quantify improvements by PSNR, SSIM[52], and perceptual metrics KID [7,39] and LPIPS [60] that are resilient to slight misalignments. All scores are computed over frames withheld from training: (1) Novel view synthesis is evaluated on multi-view datasets by learning the body model from a subset of cameras with the remaining ones used as the test set, i.e. rendering the same pose from the unseen view, and (2) novel pose synthesis quality is measured by training on the first part of a video and testing on the latter frames, given their corresponding 3D pose as input. This assumes that only the pose changes as the person moves. Hence, view-dependent illumination changes in (1) but stays similar in (2).
+
+As the background image is not our focus, we report scores on tight bounding boxes either provided by the dataset or computed from the 3D poses.
+
+Datasets. We compare our DANBO using the established benchmarks for neural bodies, covering indoor and outdoor, and single and multi-view settings:
+
+Table 1: Novel-view synthesis comparisons on Human3.6M [21]. The disentangled feature enables DANBO to achieve better novel view synthesis.
+
+ | NeuralBody [41] | Anim-NeRF [40] | A-NeRF [46] | DANBO (Ours) |
| PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ |
| S1 | 22.88 | 0.897 | 0.048 | 0.153 | 22.74 | 0.896 | 0.106 | 0.156 | 23.93 | 0.912 | 0.042 | 0.153 | 23.95 | 0.916 | 0.033 | 0.148 |
| S5 | 24.61 | 0.917 | 0.033 | 0.146 | 23.40 | 0.895 | 0.087 | 0.151 | 24.67 | 0.919 | 0.036 | 0.147 | 24.86 | 0.924 | 0.029 | 0.142 |
| S6 | 22.83 | 0.888 | 0.050 | 0.146 | 22.85 | 0.871 | 0.113 | 0.151 | 23.78 | 0.887 | 0.051 | 0.164 | 24.54 | 0.903 | 0.035 | 0.143 |
| S7 | 23.17 | 0.915 | 0.043 | 0.134 | 21.97 | 0.891 | 0.054 | 0.140 | 24.40 | 0.917 | 0.025 | 0.139 | 24.45 | 0.920 | 0.028 | 0.131 |
| S8 | 21.72 | 0.894 | 0.071 | 0.177 | 22.82 | 0.900 | 0.095 | 0.178 | 22.70 | 0.907 | 0.086 | 0.196 | 23.36 | 0.917 | 0.068 | 0.173 |
| S9 | 24.29 | 0.911 | 0.035 | 0.141 | 24.86 | 0.911 | 0.057 | 0.145 | 25.58 | 0.916 | 0.039 | 0.150 | 26.15 | 0.925 | 0.040 | 0.137 |
| S11 | 23.70 | 0.896 | 0.080 | 0.155 | 24.76 | 0.907 | 0.077 | 0.158 | 24.38 | 0.905 | 0.057 | 0.164 | 25.58 | 0.917 | 0.060 | 0.153 |
| Avg | 23.31 | 0.903 | 0.051 | 0.150 | 23.34 | 0.896 | 0.084 | 0.154 | 24.21 | 0.909 | 0.048 | 0.159 | 24.70 | 0.917 | 0.042 | 0.146 |
+
+
+Ground
+truth
+Neural
+Body
+Anim-
+NeRF
+A-NeRF
+
+DANBO
+(Ours)
+Ground
+truth
+Neural
+Body
+Anim-
+NeRF
+A-NeRF
+DANBO
+(Ours)
+Fig. 6: Unseen pose synthesis on Human3.6M [21] test split. Our disentangled representation enables DANBO to generate plausible geometry and deformation for held-out testing poses, and achieve better visual quality than both surface-free and surface-based baselines. Note that, unlike Anim-NeRF [40], we do not require test-time finetuning for unseen poses.
+
+- Human3.6M $^3$ [21,22]: We follow the same evaluation protocol as in AnimNeRF [40], with a total of 7 subjects for evaluation. The foreground maps are computed using [18].
+- MonoPerfCap [56] features multiple outdoor sequences, recorded using a single high-resolution camera. We use the same two sequences and setting as in A-NeRF [46]: Weipeng_outdoor and Nadia_outdoor with 1151 and 1635 images, respectively, of resolution $1080 \times 1920$ . Human and camera pose is estimated by SPIN [25] and refined with [46]. Foreground masks are obtained by DeepLabv3 [9].
+
+We further include the challenging motion such as dancing and gymnastic poses from Mixamo [1] and Surreal+CMU-Mocap dataset [50,12] for motion retargeting (detailed in the supplemental). In total, we evaluate on 9 different subjects and 11 different sequences.
+
+
+Fig. 7: Motion retargeting on Mixamo [1] and Surreal [12,50] dataset with body models trained on various subjects. DANBO shows better robustness and generalization than the surface-free approach A-NeRF.
+
+# 4.1 Novel View Synthesis
+
+View synthesis of poses seen during training is simpler as the interplay between body parts is observable. Hence, our explicit disentanglement of body parts is less crucial but still beneficial. Compared to the baselines, higher detail is present and body shape is better preserved, such as visible at facial features and arm contours in Figure 5. Anim-NeRF shows slightly distorted arms and cloud-like artifacts, potentially caused by incorrectly estimated deformation fields. Table 1 verifies these improvements on the test set of Anim-NeRF [40].
+
+
+Reference
+
+
+A-NeRF
+
+
+Ours
+
+
+Reference
+
+
+A-NeRF
+
+
+Ours
+
+
+Fig.8: DANBO better preserves body geometry, showing a less noisy surface than A-NeRF. We extract the isosurface using Marching cubes [32] with voxel resolution 256. See the supplemental for more results.
+
+
+Ground
+Truth
+Fig.9: Ablation study on Human3.6M [21] test split novel pose (top row) and novel view (bottom row). Our proposed designs together achieve better results with less distortion on the body parts, particularly in the limbs and face.
+
+
+
+
+W/O
+
+
+
+
+w/o volume
+
+
+
+
+Softmax
+
+
+
+
+Softmax-
+
+
+
+
+Sum-OOB
+
+
+
+
+SlabConv
+
+
+
+
+Ours
+
+Table 2: Novel-posed synthesis comparisons on Human3.6M [21] (row 1-8) and MonoPerfCap [56] (row 9-11). Our part-disentangled design enables DANBO to generalize better to unseen poses with superior perceptual qualities.
+
+ | NeuralBody [41] | Anim-NeRF [40] | A-NeRF [46] | DANBO (Ours) |
| PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | KID ↓ | LPIPS ↓ |
| S1 | 22.10 | 0.878 | 0.110 | 0.140 | 21.37 | 0.868 | 0.163 | 0.141 | 22.67 | 0.883 | 0.178 | 0.143 | 23.03 | 0.895 | 0.081 | 0.135 |
| S5 | 23.52 | 0.897 | 0.039 | 0.151 | 22.29 | 0.875 | 0.123 | 0.155 | 22.96 | 0.888 | 0.081 | 0.157 | 23.66 | 0.903 | 0.049 | 0.147 |
| S6 | 23.42 | 0.892 | 0.095 | 0.165 | 22.59 | 0.884 | 0.131 | 0.172 | 22.77 | 0.869 | 0.169 | 0.198 | 24.57 | 0.906 | 0.052 | 0.158 |
| S7 | 22.59 | 0.893 | 0.046 | 0.140 | 22.22 | 0.878 | 0.066 | 0.143 | 22.80 | 0.880 | 0.059 | 0.152 | 23.08 | 0.897 | 0.036 | 0.136 |
| S8 | 20.94 | 0.876 | 0.137 | 0.173 | 21.78 | 0.882 | 0.107 | 0.172 | 21.95 | 0.886 | 0.142 | 0.203 | 22.60 | 0.904 | 0.092 | 0.167 |
| S9 | 23.05 | 0.885 | 0.043 | 0.141 | 23.73 | 0.886 | 0.068 | 0.141 | 24.16 | 0.889 | 0.074 | 0.152 | 24.79 | 0.904 | 0.042 | 0.136 |
| S11 | 23.72 | 0.884 | 0.060 | 0.148 | 23.92 | 0.889 | 0.087 | 0.149 | 23.40 | 0.880 | 0.079 | 0.164 | 24.57 | 0.901 | 0.040 | 0.144 |
| Avg | 22.76 | 0.886 | 0.076 | 0.151 | 22.56 | 0.880 | 0.106 | 0.153 | 22.96 | 0.882 | 0.112 | 0.167 | 23.76 | 0.902 | 0.056 | 0.146 |
| Nadia | - | - | - | - | - | - | - | - | 24.88 | 0.931 | 0.048 | 0.115 | 24.44 | 0.921 | 0.026 | 0.111 |
| Weipeng | - | - | - | - | - | - | - | - | 22.45 | 0.893 | 0.039 | 0.125 | 22.07 | 0.885 | 0.024 | 0.117 |
| Avg | - | - | - | - | - | - | - | - | 23.67 | 0.912 | 0.044 | 0.120 | 23.25 | 0.903 | 0.025 | 0.114 |
+
+# 4.2 Unseen Pose Synthesis and Animation
+
+Rendering of unseen poses tests how well the learned pose-dependent deformations generalize. Figure 6 shows how differences are most prominent on limbs and faces. DANBO achieves better rendering quality and retains more consistent geometric details, generalizing well to both held out poses and out-of-distribution
+
+Table 3: Ablation on each Table 4: Ablation on different Table 5: Ablation study of of the proposed modules. aggregation methods. different coarse volumes.
+
+| Method variant | PSNR ↑ | SSIM ↑ |
| Ours w/o aggregation | 17.08 | 0.627 |
| Ours w/o volume | 24.24 | 0.892 |
| Ours w/o GNN | 23.87 | 0.896 |
| Ours full | 24.38 | 0.899 |
| Aggregation methods | PSNR ↑ | SSIM ↑ |
| Softmax | 23.80 | 0.896 |
| Softmax-OOB | 24.00 | 0.897 |
| Sum-OOB | 23.22 | 0.890 |
| Sigmoid-OOB | 23.75 | 0.896 |
| Soft-softmax (Ours) | 24.38 | 0.899 |
+
+poses (see Figure 7). Table 2 reports the quantitative results. DANBO consistently outperforms other baselines on Human3.6M. On MonoPerCap, the high-frequency details generated by DANBO yield lower PSNR and SSIM scores, as they penalize slightly misaligned details more than the overly smoothed results by A-NeRF. The perceptual metrics properly capture DANNO's significant quality improvement by $43\%$ on KID and $5\%$ on LPIPS. We attribute the boost in generalization and visual quality to the improved localization via graph neural networks as well as the Soft-softmax that outperforms the default softmax baseline as used in [15,35]. The ablation study below provides further insights.
+
+Manual animation and driving of virtual models, e.g., in VR, requires such pose synthesis, for which Figure 7 provides animation examples. Note that no quantitative evaluation is possible here as no ground truth reference image is available in this mode. Note also that the more difficult outdoor sequences are trained from a monocular video, a setting supported only by few existing approaches. The qualitative examples validate that DANBO achieves better rendering quality on most subjects, and the poses generated by DANBO are sharper, with more consistent body parts, and suffer from less floating artifacts.
+
+# 4.3 Geometry Comparisons
+
+To further validate that DANBO improves the body shape reconstruction, we visualize the learned body geometry of DANBO and A-NeRF on unseen poses of the Human3.6M [21] dataset in Figure 8. DANBO captures better body shapes and per-part geometry despite also being surface-free. A-NeRF suffers from missing and shrinking body parts, and predicts noisy density near the body surface. Besides the improved completeness, DANBO shows a smoother surface, which we attribute to our coarse per-bone volumetric representation.
+
+# 4.4 Ablation Study
+
+We conduct the ablation study on S9 of Human3.6M using the same splits as before. To speed up iteration cycles, we reduce the training iterations to $100\mathrm{k}$ , and use every other pose in the training set from the default configuration. We furthermore decreased the factorized volume resolution to $M = 10$ . Figure 9 shows results on both novel pose and novel view for all variants. Proposed Modules. In Table 3, we report how each of our proposed modules contributes to the final performance. For Ours w/o learned aggregation, we simply concatenate all the retrieved voxel features as inputs to the NeRF network, which is
+
+similar to A-NeRF but using GNN features. This leads to poor generalization, and the w/o aggregation model predicts many floating artifacts in empty space. For Ours w/o volume, the GNN predicts per-bone feature vector instead of factorized volumes. In this variant, the aggregation network takes as input $\hat{\mathbf{x}}_i$ to predict per-bone weights. The feature to neural field $F$ is the aggregated GNN feature and local coordinates. While the w/o volume variant achieves comparable results, the model suffers from overfitting, and produces distorted results on joints. In sum, both our aggregation network and per-bone volume designs provide useful inductive biases for learning robust and expressive models.
+
+Aggregation Strategy. In Table 4, we show the evaluation results with different aggregation methods in Section 3.2. Note that the Softmax variant is equivalent to NARF [35] with our GNN backbone. Strategy with out-of-bound handling shows better robustness to unseen poses, with our Soft-softmax aggregation works better than Softmax-OOB, and the unweighted variant SUM-OOB being the worst. Choice of Volume Representation. In Table 5, we show the results of using both our factorized volumes, and full 3D volume predicted using SlabConv [30]. We observe that SlabConv, while capturing finer texture details as the model is more expressive, is prone to noises in the empty space. We conclude that more views and pose data are required for using SlabConv as the volume representation.
+
+# 5 Limitations and Discussion
+
+Similar to other neural field-based approaches, the computation time for DANBO remains the limiting factor for real-time applications. While DANBO offers better generalization to unseen poses, we show in Figure 10 that in extreme cases it sometimes mixes the parts around joints together leading to deformation and blur. Handling such cases remains
+
+an open problem as also the surface-based method Anim-NeRF produces candy wrap artifacts around the elbow. It is also worth noting that DANBO is a person-specific model that needs to be trained individually for each person, which is desirable so long as sufficient training time and data is available.
+
+
+GT
+
+
+Anim-NeRF
+
+
+Ours
+Fig. 10: Unseen local poses create artifacts around the joints.
+
+# 6 Conclusion
+
+We presented a surface-free approach for learning an animatable human body model from video. This is practical as it applies to monocular recordings, alleviates the restrictions of template or parametric models, and works in indoor and outdoor conditions. Our contributions on encoding pose locally with a GNN, factorized volumes, and a soft aggregation function improve upon existing models in the same class and even rival recent surface-based solutions.
+
+Acknowledgements. Shih-Yang Su and Helge Rhodin were supported by Compute Canada, Advanced Research Computing at UBC [13], and NSERC DC.
+
+# References
+
+1. Adobe: Mixamo. https://www MIXamo.com/ (2020)
+2. Alldieck, T., Xu, H., Sminchisescu, C.: imghum: Implicit generative models of 3d human shape and articulated pose. In: ICCV (2021)
+3. Bagautdinov, T., Wu, C., Simon, T., Prada, F., Shiratori, T., Wei, S.E., Xu, W., Sheikh, Y., Saragih, J.: Driving-signal aware full-body avatars. ACM TOG (Proc. SIGGRAPH) (2021)
+4. Balan, A.O., Sigal, L., Black, M.J., Davis, J.E., Haussecker, H.W.: Detailed human shape and pose from images. In: CVPR. pp. 1-8 (2007)
+5. Barron, J.T., Mildenhall, B., Tancik, M., Hedman, P., Martin-Brualla, R., Srinivasan, P.P.: Mip-nerf: A multiscale representation for anti-aliasing neural radiance fields. ICCV (2021)
+6. Bhatnagar, B.L., Sminchisescu, C., Theobalt, C., Pons-Moll, G.: Combining implicit function learning and parametric models for 3d human reconstruction. In: ECCV (2020)
+7. Binkowski, M., Sutherland, D.J., Arbel, M., Gretton, A.: Demystifying mmd gans. In: ICLR (2018)
+8. Burov, A., Nießner, M., Thies, J.: Dynamic surface function networks for clothed human bodies. In: ICCV (2021)
+9. Chen, L.C., Papandreou, G., Schroff, F., Adam, H.: Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587 (2017)
+0. Chen, X., Zheng, Y., Black, M.J., Hilliges, O., Geiger, A.: Snarf: Differentiable forward skinning for animating non-rigid neural implicit shapes. In: ICCV (2021)
+1. Choutas, V., Pavlakos, G., Bolkart, T., Tzionas, D., Black, M.J.: Monocular expressive body regression through body-driven attention. In: ECCV (2020), https://expose.is.tue.mpg.de
+2. CMU Graphics Lab Motion Capture Database. http://mocap.cs.cmu.edu
+3. Computing, U.A.R.: Ubc arc sockeye (2019). https://doi.org/doi: 10.14288/SOCKEYE.
+4. Corona, E., Pumarola, A., Alenyà, G., Pons-Moll, G., Moreno-Noguer, F.: SMPlicit: Topology-aware generative model for clothed people. In: CVPR (2021)
+5. Deng, B., Lewis, J., Jeruzalski, T., Pons-Moll, G., Hinton, G., Norouzi, M., Tagliasacchi, A.: Nasa: neural articulated shape approximation. arXiv preprint arXiv:1912.03207 (2019)
+6. Gafni, G., Thies, J., Zollhöfer, M., Nießner, M.: Dynamic neural radiance fields for monocular 4d facial avatar reconstruction. In: CVPR (2021)
+7. Gao, C., Saraf, A., Kopf, J., Huang, J.B.: Dynamic view synthesis from dynamic monocular video. In: ICCV (2021)
+8. Gong, K., Liang, X., Li, Y., Chen, Y., Yang, M., Lin, L.: Instance-level human parsing via part grouping network. In: ECCV (2018)
+9. Guo, K., Lincoln, P., Davidson, P., Busch, J., Yu, X., Whalen, M., Harvey, G., Orts-Escalano, S., Pandey, R., Dourgarian, J., et al.: The relightables: Volumetric performance capture of humans with realistic relighting. ACM TOG (Proc. SIGGRAPH) (2019)
+20. Habermann, M., Liu, L., Xu, W., Zollhoefer, M., Pons-Moll, G., Theobalt, C.: Real-time deep dynamic characters. ACM TOG (Proc. SIGGRAPH) (2021)
+21. Ionescu, C., Carreira, J., Sminchisescu, C.: Iterated Second-Order Label Sensitivity Pooling for 3D Human Pose Estimation. In: CVPR (2014)
+
+22. Ionescu, C., Li, F., Sminchisescu, C.: Latent Structured Models for Human Pose Estimation. In: ICCV (2011)
+23. Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: ICLR (2017)
+24. Kocabas, M., Athanasiou, N., Black, M.J.: Vibe: Video inference for human body pose and shape estimation. In: CVPR (2020)
+25. Kolotouros, N., Pavlakos, G., Black, M.J., Daniilidis, K.: Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In: ICCV (2019)
+26. Kwon, Y., Kim, D., Ceylan, D., Fuchs, H.: Neural human performer: Learning generalizable radiance fields for human performance rendering. NeurIPS (2021)
+27. Lin, C.H., Ma, W.C., Torralba, A., Lucey, S.: Barf: Bundle-adjusting neural radiance fields. arXiv preprint arXiv:2104.06405 (2021)
+28. Lindell, D.B., Martel, J.N., Wetzstein, G.: Autoint: Automatic integration for fast neural volume rendering. In: CVPR (2021)
+29. Liu, L., Habermann, M., Rudnev, V., Sarkar, K., Gu, J., Theobalt, C.: Neural actor: Neural free-view synthesis of human actors with pose control. ACM TOG (Proc. SIGGRAPH Asia) (2021)
+30. Lombardi, S., Simon, T., Schwartz, G., Zollhoefer, M., Sheikh, Y., Saragih, J.: Mixture of volumetric primitives for efficient neural rendering. ACM TOG (Proc. SIGGRAPH) (2021)
+31. Loper, M., Mahmood, N., Romero, J., Pons-Moll, G., Black, M.J.: Smpl: A skinned multi-person linear model. ACM TOG (Proc. SIGGRAPH) 34(6), 1-16 (2015)
+32. Lorensen, W.E., Cline, H.E.: Marching cubes: A high resolution 3d surface construction algorithm. ACM TOG (Proc. SIGGRAPH) (1987)
+33. Mihajlovic, M., Saito, S., Bansal, A., Zollhoefer, M., Tang, S.: COAP: Compositional articulated occupancy of people. In: CVPR (Jun 2022)
+34. Mildenhall, B., Srinivasan, P.P., Tancik, M., Barron, J.T., Ramamoorthi, R., Ng, R.: Nerf: Representing scenes as neural radiance fields for view synthesis. In: ECCV (2020)
+35. Noguchi, A., Sun, X., Lin, S., Harada, T.: Neural articulated radiance field. In: ICCV (2021)
+36. Osman, A.A.A., Bolkart, T., Black, M.J.: STAR: A sparse trained articulated human body regressor. In: ECCV (2020)
+37. Park, J.J., Florence, P., Straub, J., Newcombe, R., Lovegrove, S.: Deepsdf: Learning continuous signed distance functions for shape representation. In: CVPR (2019)
+38. Park, K., Sinha, U., Hedman, P., Barron, J.T., Bouaziz, S., Goldman, D.B., Martin-Brualla, R., Seitz, S.M.: Hypernerf: A higher-dimensional representation for topologically varying neural radiance fields. ACM TOG (Proc. SIGGRAPH) (2021)
+39. Parmar, G., Zhang, R., Zhu, J.Y.: On aliased resizing and surprising subtleties in gan evaluation. In: CVPR (2022)
+40. Peng, S., Dong, J., Wang, Q., Zhang, S., Shuai, Q., Zhou, X., Bao, H.: Animatable neural radiance fields for modeling dynamic human bodies. In: ICCV (2021)
+41. Peng, S., Zhang, Y., Xu, Y., Wang, Q., Shuai, Q., Bao, H., Zhou, X.: Neural body: Implicit neural representations with structured latent codes for novel view synthesis of dynamic humans. In: CVPR (2021)
+42. Peng, S., Niemeyer, M., Mescheder, L., Pollefeys, M., Geiger, A.: Convolutional occupancy networks. In: ECCV. Springer (2020)
+43. Pumarola, A., Corona, E., Pons-Moll, G., Moreno-Noguer, F.: D-NeRF: Neural Radiance Fields for Dynamic Scenes. In: CVPR (2020)
+44. Saito, S., Yang, J., Ma, Q., Black, M.J.: SCANimate: Weakly supervised learning of skinned clothed avatar networks. In: CVPR (2021)
+
+45. Sitzmann, V., Martel, J., Bergman, A., Lindell, D., Wetzstein, G.: Implicit neural representations with periodic activation functions. NeurIPS 33 (2020)
+46. Su, S.Y., Yu, F., Zollhöfer, M., Rhodin, H.: A-nerf: Articulated neural radiance fields for learning human shape, appearance, and pose. In: NeurIPS (2021)
+47. Tiwari, G., Bhatnagar, B.L., Tung, T., Pons-Moll, G.: Sizer: A dataset and model for parsing 3d clothing and learning size sensitive 3d clothing. In: ECCV (2020)
+48. Tiwari, G., Sarafianos, N., Tung, T., Pons-Moll, G.: Neural-gif: Neural generalized implicit functions for animating people in clothing. In: ICCV (2021)
+49. Tretschk, E., Tewari, A., Golyanik, V., Zollhöfer, M., Lassner, C., Theobalt, C.: Non-rigid neural radiance fields: Reconstruction and novel view synthesis of a dynamic scene from monocular video. In: ICCV (2021)
+50. Varol, G., Romero, J., Martin, X., Mahmood, N., Black, M.J., Laptev, I., Schmid, C.: Learning from synthetic humans. In: CVPR (2017)
+51. Wang, S., Mihajlovic, M., Ma, Q., Geiger, A., Tang, S.: Meta.
+animatable clothed human models from few depth images. In: NeurIPS (2021)
+52. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. TIP (2004)
+53. Xian, W., Huang, J.B., Kopf, J., Kim, C.: Space-time neural irradiance fields for free-viewpoint video. In: CVPR (2021)
+54. Xu, H., Alldieck, T., Sminchisescu, C.: H-nerf: Neural radiance fields for rendering and temporal reconstruction of humans in motion. NeurIPS (2021)
+55. Xu, H., Bazavan, E.G., Zanfir, A., Freeman, W.T., Sukthankar, R., Sminchisescu, C.: Ghum & ghuml: Generative 3d human shape and articulated pose models. In: CVPR (2020)
+56. Xu, W., Chatterjee, A., Zollhöfer, M., Rhodin, H., Mehta, D., Seidel, H.P., Theobalt, C.: Monoperfcap: Human performance capture from monocular video. TOG 37(2), 27 (2018)
+57. Yen-Chen, L., Florence, P., Barron, J.T., Rodriguez, A., Isola, P., Lin, T.Y.: inerf: Inverting neural radiance fields for pose estimation. In: IROS (2020)
+58. Yu, A., Li, R., Tancik, M., Li, H., Ng, R., Kanazawa, A.: PlenOctrees for real-time rendering of neural radiance fields. In: ICCV (2021)
+59. Yu, A., Ye, V., Tancik, M., Kanazawa, A.: pixelNeRF: Neural radiance fields from one or few images. In: CVPR (2021)
+60. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: CVPR (2018)
+61. Zhou, X., Zhu, M., Pavlakos, G., Leonardos, S., Derpanis, K.G., Daniilidis, K.: Monocap: Monocular human motion capture using a cnn coupled with a geometric prior. PAMI (2018)
+62. Zhou, Y., Barnes, C., Lu, J., Yang, J., Li, H.: On the continuity of rotation representations in neural networks. In: CVPR. pp. 5745-5753 (2019)
\ No newline at end of file
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/images.zip b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..65b99fc3a79c67c4b467afd1b7f5ca02c5eab23b
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dc8894adec7dc083f1ca314fee19c457a0c5ddce257f9517943661f1f612b625
+size 528643
diff --git a/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/layout.json b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0dd0a5053ad7c9d5cc8541e119f19b20afbc82f8
--- /dev/null
+++ b/danbodisentangledarticulatedneuralbodyrepresentationsviagraphneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41793094762b7b3aa5a1292448de0a2c9b70795927157cbf23939d36a7b27517
+size 528953
diff --git a/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_content_list.json b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c7d80e90034b648e446f56894133b399e2d6c2d3
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:175f89218f6af6cb27e63d956ba5e304f21f4d29c4b8d83370c87d2258e6b29e
+size 82607
diff --git a/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_model.json b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..feeab7583a6fc72115b3b75931fcf4ec51efdb88
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3b865faa61a2658c9fcaa9d5648e623d09dfcf7f06f60431acfa6ebd77798c12
+size 104569
diff --git a/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_origin.pdf b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..579ef213536ad510d17b967ab78d6c5296170cd9
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/df6f8b90-37b6-44a0-80e6-6d7a58762a31_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5dc283b5d35bf77127deea3d85d9d4cafb92e60017f118b8613c690936056872
+size 3037339
diff --git a/ddlearninghumandynamicsfromdynamiccamera/full.md b/ddlearninghumandynamicsfromdynamiccamera/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0cb9c38d7245c07f5b5603d5f8779d04a10697e7
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/full.md
@@ -0,0 +1,356 @@
+# D&D: Learning Human Dynamics from Dynamic Camera
+
+Jiefeng Li $^{1}$ , Siyuan Bian $^{1}$ , Chao Xu $^{2}$ , Gang Liu $^{2}$ , Gang Yu $^{2}$ , and Cewu Lu $^{1\star}$
+
+$^{1}$ Shanghai Jiao Tong University $^{2}$ Tencent $\{\text { ljf_likit, biansiyuan, lucewu } \} @sjtu.edu.cn \{\text { dasxu, sylvainliu, skicyyy } \} @tencent.com$
+
+Abstract. 3D human pose estimation from a monocular video has recently seen significant improvements. However, most state-of-the-art methods are kinematics-based, which are prone to physically implausible motions with pronounced artifacts. Current dynamics-based methods can predict physically plausible motion but are restricted to simple scenarios with static camera view. In this work, we present D&D (Learning Human Dynamics from Dynamic Camera), which leverages the laws of physics to reconstruct 3D human motion from the in-the-wild videos with a moving camera. D&D introduces inertial force control (IFC) to explain the 3D human motion in the non-inertial local frame by considering the inertial forces of the dynamic camera. To learn the ground contact with limited annotations, we develop probabilistic contact torque (PCT), which is computed by differentiable sampling from contact probabilities and used to generate motions. The contact state can be weakly supervised by encouraging the model to generate correct motions. Furthermore, we propose an attentive PD controller that adjusts target pose states using temporal information to obtain smooth and accurate pose control. Our approach is entirely neural-based and runs without offline optimization or simulation in physics engines. Experiments on large-scale 3D human motion benchmarks demonstrate the effectiveness of D&D, where we exhibit superior performance against both state-of-the-art kinematics-based and dynamics-based methods. Code is available at https://github.com/Jeffsjtu/DnD.
+
+Keywords: 3D Human Pose Estimation, Physical Awareness, Human Motion Dynamics
+
+# 1 Introduction
+
+Recovering 3D human pose and shape from a monocular image is a challenging problem. It has a wide range of applications in activity recognition [20, 21], character animation, and human-robot interaction. Despite the recent progress,
+
+estimating 3D structure from the 2D observation is still an ill-posed and challenging task due to the inherent ambiguity.
+
+A number of works [13, 14, 23, 6, 50, 62] turn to temporal input to incorporate body motion priors. Most state-of-the-art methods [12, 15, 14, 33, 19, 50, 56] are only based on kinematics modeling, i.e., body motion modeling with body part rotations and joint positions. Kinematics modeling directly captures the geometric information of the 3D human body, which is easy to learn by neural networks. However, methods that entirely rely on kinematics information are prone to physical artifacts, such as motion jitter, abnormal root actuation, and implausible body leaning.
+
+Recent works [40, 44, 43, 59, 7] have started modeling human motion dynamics to improve the physical plausibility of the estimated motion. Dynamics modeling considers physical forces such as contact force and joint torque to control human motion. These physical properties can help analyze the body motion and understand human-scene interaction. Compared to widely adopted kinematics, dynamics gains less attention in 3D human pose estimation. The reason is that there are lots of limitations in current dynamics methods. For example, existing methods fail in daily scenes with dynamic camera movements (e.g., the 3DPW dataset [26]) since they require a static camera view, known ground plane and gravity vector for dynamics modeling. Besides, they are hard to deploy for real-time applications due to the need for highly-complex offline optimization or simulation with physics engines.
+
+In this work, we propose a novel framework, D&D, a 3D human pose estimation approach with learned Human Dynamics from Dynamic Camera. Unlike previous methods that build the dynamics equation in the world frame, we redevise the dynamics equations in the non-inertial camera frame. Specifically, when the camera is moving, we introduce inertial forces in the dynamics equation to relate physical forces to local pose accelerations. We develop dynamics networks that directly estimate physical properties (forces and contact states). Then we can use the physical properties to compute the pose accelerations and obtain final human motion based on the accelerations. To train the dynamics network with only a limited amount of contact annotations, we propose probabilistic contact torque $(PCT)$ for differentiable contact torque estimation. Concretely, we use a neural network to predict contact probabilities and conduct differentiable sampling to draw contact states from the predicted probabilities. Then we use the sampled contact states to compute the torque of the ground reaction forces and control the human motion. In this way, the contact classifier can be weakly supervised by minimizing the difference between the generated human motion and the ground-truth motion. To further improve the smoothness of the estimated motion, we propose a novel control mechanism called attentive PD controller. The output of the conventional PD controller [44, 44, 59] is proportional to the distance of the current pose state from the target state, which is sensitive to the unstable and jittery target. Instead, our attentive PD controller allows accurate control by globally adjusting the target state and is robust to the jittery target.
+
+We benchmark D&D on the 3DPW [26] dataset captured with moving cameras and the Human3.6M [9] dataset captured with static cameras. D&D is compared against both state-of-the-art kinematics-based and dynamics-based methods and obtains state-of-the-art performance.
+
+The contributions of this paper can be summarized as follows:
+
+- We present the idea of inertial force control (IFC) to perform dynamics modeling for 3D human pose estimation from a dynamic camera view.
+- We propose probabilistic contact torque (PCT) that leverages large-scale motion datasets without contact annotations for weakly-supervised training.
+- Our proposed attentive PD controller enables smooth and accurate character control against jittery target motion.
+- Our approach outperforms previous state-of-the-art kinematics-based and dynamics-based methods. It is fully differentiable and runs without offline optimization or simulation in physics engines.
+
+# 2 Related Work
+
+Kinematics-based 3D Human Pose Estimation. Numerous prior works estimate 3D human poses by locating the 3D joint positions [2, 35, 54, 34, 8, 27, 46, 37, 41, 28, 63, 30, 47, 32, 51, 61, 18]. Although these methods obtain impressive performance, they cannot provide physiological and physical constraints of the human pose. Many works [5, 16, 12, 15, 33, 19] adopt parametric statistical human body models [22, 36, 52] to improve physiological plausibility since they provide a well-defined human body structure. Optimization-based approaches [5, 16, 49, 36] automatically fit the SMPL body model to 2D observations, e.g., 2D keypoints and silhouettes. Alternatively, learning-based approaches use a deep neural network to regress the pose and shape parameters directly [12, 15, 14, 33, 19]. Several works [16, 15, 11] combine the optimization-based and learning-based methods to produce pseudo supervision or conduct test-time optimization.
+
+For better temporal consistency, recent works have started to exploit temporal context [31, 13, 4, 48, 29, 14, 6, 50, 39]. Kocabas et al. [14] propose an adversarial framework to leverage motion prior from large-scale motion datasets [25]. Sun et al. [48] model temporal information with a bilinear Transformer. Rempe et al. [39] propose a VAE model to learn motion prior and optimize ground contacts. All the aforementioned methods disregard human dynamics. Although they achieve high accuracy on pose metrics, e.g., Procrustes Aligned MPJPE, the resulting motions are often physically implausible with pronounced physical artifacts such as improper balance and inaccurate body leaning.
+
+Dynamics-based 3D Human Pose Estimation. To reduce physical artifacts, a number of works leverage the laws of physics to estimate human motion [57, 40, 44, 43, 59, 7]. Some of them are optimization-based approaches [40, 44, 7]. They use trajectory optimization to obtain the physical forces that induce
+
+human motion. Shimada et al. [44] consider a complete human motion dynamics equation for optimization and obtain motion with fewer artifacts. Dabral et al. [7] propose a joint 3D human-object optimization framework for human motion capture and object trajectory estimation. Recent works [60, 43] have started to use regression-based methods to estimate human motion dynamics. Shimada et al. [43] propose a fully-differentiable framework for 3D human motion capture with physics constraints. All previous approaches require a static camera, restricting their applications in real-world scenarios.
+
+On the other hand, deep reinforcement learning and motion imitation are widely used for 3D human motion estimation [57, 38, 59, 24, 55]. These works rely on physics engines to learn the control policies. Peng et al. [38] propose a control policy that allows a simulated character to mimic realistic motion capture data. Yuan et al. [59] present a joint kinematics-dynamics reinforcement learning framework that learns motion policy to reconstruct 3D human motion. Luo et al. [24] propose a dynamics-regulated training procedure for egocentric pose estimation. The work of Yu et al. [55] is most related to us. They propose a policy learning algorithm with a scene fitting process to reconstruct 3D human motion from a dynamic camera. Training their RL model and the fitting process is time-consuming. It takes $24\sim 96$ hours to obtain the human motion of one video clip. Unlike previous methods, our regression-based approach is fully differentiable and does not rely on physics engines and offline fitting. It predicts accurate and physically plausible 3D human motion for in-the-wild scenes with dynamic camera movements.
+
+# 3 Method
+
+The overall framework of the proposed D&D (Learning Human Dynamics from Dynamic Camera) is summarized in Fig. 1. The input to D&D is a video $\{\mathbf{I}^t\}_{t=1}^T$ with $T$ frames. Each frame $\mathbf{I}^t$ is fed into the kinematics backbone network to estimate the initial human motion $\widehat{q}^t$ in the local camera frame. The dynamics networks take as input the initial local motion $\{\widehat{q}^t\}_{t=1}^T$ and estimate physical properties (forces and contact states). Then we apply the forward dynamics modules to compute the pose and trajectory accelerations from the estimated physical properties. Finally, we use accelerations to obtain 3D human motion with physical constraints iteratively.
+
+In this section, before introducing our solution, we first review the formulation of current dynamics-based methods in §3.1. In §3.2, we present the formulation of Inertial Force Control (IFC) that introduces inertial forces to explain the human motion in the dynamic camera view. Then we elaborate on the pipeline of D&D: i) learning physical properties with neural networks in §3.3, ii) analytically computing accelerations with forward dynamics in §3.4, iii) obtaining final pose with the constrained update in §3.5. The objective function of training the entire framework is further detailed in §3.6.
+
+
+Fig.1. Overview of the proposed framework. The video clip is fed into the kinematics backbone network to estimate the initial motion $\{\hat{q}^t\}_{t=1}^T$ . The dynamics networks take as input the initial motion and estimate physical properties. Then we compute pose and trajectory accelerations analytically via forward dynamics. Finally, we utilize accelerations to obtain human motion with physical constraints.
+
+# 3.1 Preliminaries
+
+The kinematic state of the human body can be represented by a pose vector $q$ . The pose vector is parameterized as Euler angles with root translation and orientation to build the dynamics formula, i.e., $q \in \mathbb{R}^{3N_j + 6}$ , where $N_{j}$ denotes the total number of human body joints. In previous methods [44, 58, 43], the first six entries of $q$ are set as the root translation and orientation in the world frame. All remaining $3N_{j}$ entries encode joint angles of the human body. The laws of physics are imposed by considering Newtonian rigid body dynamics as:
+
+$$
+\mathrm {M} (q) \ddot {q} - \boldsymbol {\tau} = \mathrm {h} _ {\mathrm {g r f}} (q, \mathbf {b}, \boldsymbol {\lambda}) - \mathrm {h} _ {g} (q, \dot {q}) - \mathrm {h} _ {c} (q, \dot {q}), \tag {1}
+$$
+
+where $\mathbf{M} \in \mathbb{R}^{(3N_j + 6) \times (3N_j + 6)}$ denotes the inertia matrix of the human body; $\dot{q} \in \mathbb{R}^{3N_j + 6}$ and $\ddot{q} \in \mathbb{R}^{3N_j + 6}$ denote the velocity and the acceleration of $q$ , respectively; $\mathrm{h}_{\mathrm{grf}} \in \mathbb{R}^{3N_j + 6}$ denotes the resultant torque of the ground reaction forces; $\mathbf{b} \in \mathbb{R}^{N_c}$ is the discrete contact states vector; $\pmb{\lambda} \in \mathbb{R}^{3N_c}$ is the linear contact forces; $N_{c}$ denotes the number of joints to which the contact forces are applied; $\mathrm{h}_g \in \mathbb{R}^{3N_j + 6}$ is the gravity torque; $\mathrm{h}_c \in \mathbb{R}^{3N_j + 6}$ encompasses Coriolis and centripetal forces; $\pmb{\tau} \in \mathbb{R}^{3N_j + 6}$ represents the internal joint torque of the human body, with the first six entries being the direct root actuation. In this formulation, the translation and orientation must be in the static world frame, which restricts the application of the model in real-world scenarios. Therefore, previous dynamics-based methods are not applicable in current in-the-wild datasets with moving cameras, e.g., the 3DPW dataset [26].
+
+# 3.2 Inertial Force Control
+
+In this work, to facilitate in-the-wild 3D human pose estimation with physics constraints, we reformulate the dynamics equation to impose the laws of physics in the dynamic-view video. When the camera is moving, the local frame is an inertial frame of reference. In order to satisfy the force equilibrium, we introduce the inertial force $\mathcal{I}$ in the dynamics system:
+
+$$
+\mathrm {M} (q) \ddot {q} - \tau = \mathrm {h} _ {\mathrm {g r f}} (q, \mathbf {b}, \boldsymbol {\lambda}) - \mathrm {h} _ {g} (q, \dot {q}) - \mathrm {h} _ {c} (q, \dot {q}) + \mathcal {I} (q, \dot {q}, a _ {\text {i n e}}, \omega_ {\text {i n e}}), \tag {2}
+$$
+
+where the first six entries of $q$ are set as the root translation and orientation in the local camera frame, and the inertial force $\mathcal{I}$ is determined by the current motion state ( $q$ and $\dot{q}$ ) and camera movement state (linear acceleration $a_{\mathrm{ine}} \in \mathbb{R}^3$ and angular velocity $\omega_{\mathrm{ine}} \in \mathbb{R}^3$ ). Specifically, the inertial force encompasses linear, centripetal, and Coriolis forces. It is calculated as follows:
+
+$$
+\mathcal {I} = \sum_ {i} ^ {N _ {j}} \underbrace {m _ {i} J _ {v _ {i}} ^ {\top} a _ {\text {i n e}}} _ {\text {l i n e a r f o r c e}} + \underbrace {m _ {i} J _ {v _ {i}} ^ {\top} \omega_ {\text {i n e}} \times (\omega_ {\text {i n e}} \times r _ {i})} _ {\text {c e n t r i p e t a l f o r c e}} + \underbrace {2 m _ {i} J _ {v _ {i}} ^ {\top} (\omega_ {\text {i n e}} \times v _ {i})} _ {\text {C o r i o l i s f o r c e}}, \tag {3}
+$$
+
+where $J_{v_i} \in \mathbb{R}^{3 \times (3N_j + 6)}$ denotes the linear Jacobian matrix that describes how the linear velocity of the $i$ -th joint changes with pose velocity $\dot{q}$ , $m_i$ denotes the mass of the $i$ -th joint, $r_i$ denotes the position of the $i$ -th joint in the local frame, and $v_i$ is the velocity of the $i$ -th joint. $J_{v_i}$ , $r_i$ , and $v_i$ can be analytically computed using the pose $q$ and the velocity $\dot{q}$ .
+
+The inertial force control (IFC) establishes the relation between the physical properties and the pose acceleration in the local frame. The pose acceleration can be subsequently used to calculate the final motion. In this way, we can estimate physically plausible human motion from forces to accelerations to poses. The generated motion is smooth and natural. Besides, it provides extra physical information to understand human-scene interaction for high-level activity understanding tasks.
+
+Discussion. The concept of residual force [58] is widely adopted in previous works [17, 3, 44, 58, 43] to explain the direct root actuation in the global static frame. Theoretically, we can adopt a residual term to explain the inertia in the local camera frame implicitly. However, we found explicit inertia modeling obtains better estimation results than implicit modeling with a residual term. Detailed comparisons are provided in §4.4.
+
+# 3.3 Learning Physical Properties
+
+In this subsection, we elaborate on the neural networks for physical properties estimation. We first use a kinematics backbone to extract the initial motion $\{\widehat{q}^t\}_{t=1}^T$ . The initial motion is then fed to a dynamics network (DyNet) with probabilistic contact torque for contact, external force, and inertial force estimation and the attentive PD controller for internal joint torque estimation.
+
+Contact, External Force, and Inertial Force Estimation. The root motion of the human character is dependent on external forces and inertial forces. To explain root motion, we propose DyNet that directly regresses the related physical properties, including the ground reaction forces $\pmb{\lambda} = (\lambda_{1},\dots ,\lambda_{N_{c}})$ , the gravity $\pmb{g}$ , the direct root actuation $\pmb{\eta}$ , the contact probabilities $\mathbf{p} = (p_1,p_2,\dots ,p_{N_c})$ , the linear camera acceleration $a_{\mathrm{ine}}$ , and the angular camera velocity $\omega_{\mathrm{ine}}$ . The detailed network structure of DyNet is provided in the supplementary material.
+
+The inertial force $\mathcal{I}$ can be calculated following Eqn. 3 with the estimated $a_{\mathrm{ine}}$ and $\omega_{\mathrm{ine}}$ . The gravity torque $\mathrm{h}_g$ can be calculated as:
+
+$$
+\mathrm {h} _ {g} = - \sum_ {i} ^ {N _ {j}} m _ {i} J _ {v _ {i}} ^ {\mathsf {T}} \boldsymbol {g}. \tag {4}
+$$
+
+When considering gravity, bodyweight will affect human motion. In this paper, we let the shape parameters $\beta$ control the body weight. We assume the standard weight is $75\mathrm{kg}$ when $\beta_0 = 0$ , and there is a linear correlation between the body weight and the bone length. We obtain the corresponding bodyweight based on the bone-length ratio of $\beta$ to $\beta_0$ .
+
+Probabilistic Contact Torque: For the resultant torque of the ground reaction forces, previous methods [44, 58, 43] compute it with the discrete contact states $\mathbf{b} = (b_{1}, b_{2}, \dots, b_{N_{c}})$ of $N_{c}$ joints:
+
+$$
+\mathrm {h} _ {\operatorname {g r f}} (q, \mathbf {b}, \boldsymbol {\lambda}) = \sum_ {j} ^ {N _ {c}} b _ {j} J _ {v _ {j}} ^ {\top} \lambda_ {j}, \tag {5}
+$$
+
+where $b_{j} = 1$ for contact and $b_{j} = 0$ for non-contact. Note that the output probabilities $\mathbf{p}$ are continuous. We need to discretize $p_{j}$ with a threshold of 0.5 to obtain $b_{j}$ . However, the discretization process is not differentiable. Thus the supervision signals for the contact classifier only come from a limited amount of data with contact annotations.
+
+To leverage the large-scale motion dataset without contact annotations, we propose probabilistic contact torque (PCT) for weakly-supervised learning. During training, PCT conducts differentiable sampling [10] to draw a sample $\widehat{\mathbf{b}}$ that follows the predicted contact probabilities $\mathbf{p}$ and computes the corresponding ground reaction torques:
+
+$$
+\widehat {\mathrm {h}} _ {\operatorname {g r f}} (q, \widehat {\mathbf {b}}, \boldsymbol {\lambda}) = \sum_ {j} ^ {N _ {c}} \widehat {b} _ {j} J _ {v _ {j}} ^ {\top} \lambda_ {j} = \sum_ {j} ^ {N _ {c}} \frac {p _ {j} e ^ {g _ {j 1}}}{p _ {j} e ^ {g _ {j 1}} + (1 - p _ {j}) e ^ {g _ {j 2}}} J _ {v _ {j}} ^ {\top} \lambda_ {j}, \tag {6}
+$$
+
+where $g_{j1}, g_{j2} \sim \mathrm{Gumbel}(0,1)$ are i.i.d samples drawn from the Gumbel distribution. When conducting forward dynamics, we use the sampled torque $\widehat{\mathrm{h}}_{\mathrm{grf}}(q,\widehat{\mathbf{b}},\lambda)$ instead of the torque $\mathrm{h}_{\mathrm{grf}}(q,\mathbf{b},\lambda)$ from the discrete contact states $\mathbf{b}$ . To generate accurate motion, DyNet is encouraged to predict higher probabilities for the correct contact states so that PCT can sample the correct states as much as possible. Since PCT is differentiable, the supervision signals for the physical force and contact can be provided by minimizing the motion error. More details of differentiable sampling are provided in the supplementary material.
+
+Internal Joint Torque Estimation. Another key process to generate human motions is internal joint torque estimation. PD controller is widely adopted for physics-based human motion control [44, 43, 59]. It controls the motion by outputting the joint torque $\pmb{\tau}$ in proportion to the difference between the current state and the target state. However, the target pose states estimated by the kinematics backbone are noisy and contain physical artifacts. Previous works [43, 59] adjust the gain parameters dynamically for smooth motion control. However, we find that this local adjustment is still challenging for the model and the output motion is still vulnerable to the jittery and incorrect input motion.
+
+Attentive PD Controller: To address this problem, we propose the attentive PD controller, a method that allows global adjustment of the target pose states. The attentive PD controller is fed with initial motion $\{\widehat{q}^t\}_{t=1}^T$ and dynamically predicts the proportional parameters $\{\mathbf{k}_p^t\}_{t=1}^T$ , derivative parameters $\{\mathbf{k}_d^t\}_{t=1}^T$ , offset torques $\{\alpha^t\}_{t=1}^T$ , and attention weights $\{\mathbf{w}^t\}_{t=1}^T$ . The attention weights $\mathbf{w}^t = (w^{t1}, w^{t2}, \dots, w^{tT})$ denotes how the initial motion contributes to the target pose state at the time step $t$ and $\sum_{j=1}^T w^{tj} = 1$ . We first compute the attentive target pose state $\widetilde{q}^t$ as:
+
+$$
+\widetilde {q} ^ {t} = \sum_ {j = 1} ^ {T} w ^ {t j} \hat {q} ^ {j}, \tag {7}
+$$
+
+where $\widehat{q}^j$ is the initial kinematic pose at the time step $j$ . Then the internal joint torque $\pmb{\tau}^t$ at the time step $t$ can be computed following the PD controller rule with the compensation term $\mathrm{h}_c^t$ [53]:
+
+$$
+\boldsymbol {\tau} ^ {t} = \mathbf {k} _ {p} ^ {t} \circ \left(\tilde {q} ^ {t + 1} - q ^ {t}\right) - \mathbf {k} _ {d} ^ {t} \circ \dot {q} ^ {t} + \boldsymbol {\alpha} ^ {t} + \mathrm {h} _ {c} ^ {t}, \tag {8}
+$$
+
+where $\circ$ denotes Hadamard matrix product and $\mathrm{h}_c^t$ represents the sum of centripetal and Coriolis forces at the time step $t$ . This attention mechanism allows the PD controller to leverage the temporal information to refine the target state and obtain a smooth motion. Details of the network structure are provided in the supplementary material.
+
+# 3.4 Forward Dynamics
+
+To compute the accelerations analytically from physical properties, we build two forward dynamics modules: inertial forward dynamics for the local pose acceleration and trajectory forward dynamics for the global trajectory acceleration.
+
+Inertial Forward Dynamics. Prior works [44, 43, 59] adopt a proxy model to simulate human motion in physics engines or simplify the optimization process. In this work, to seamlessly cooperate with the kinematics-based backbone, we directly build the dynamics equation for the SMPL model [22]. The pose acceleration $\ddot{q}$ can be derived by rewriting Eqn. 2 with PCT:
+
+$$
+\ddot {q} = \mathrm {M} ^ {- 1} (q) \left(\boldsymbol {\tau} + \widehat {\mathrm {h}} _ {\mathrm {g r f}} - \mathrm {h} _ {g} - \mathrm {h} _ {c} + \mathcal {I}\right). \tag {9}
+$$
+
+To obtain $\ddot{q}$ , we need to compute the inertia matrix M and other physical torques in each time step using the current pose $q$ . The time superscript $t$ is omitted for simplicity. M can be computed recursively along the SMPL kinematics tree. The derivation is provided in the supplementary material.
+
+Trajectory Forward Dynamics. To train DyNet without ground-truth force annotations, we leverage a key observation: the gravity and ground reaction forces should explain the global root trajectory. We devise a trajectory forward dynamics module that controls the global root motion with external forces. It plays a central role in the success of weakly supervised learning.
+
+Let $q_{\mathrm{trans}}$ denote the root translation in the world frame. The dynamics equation can be written as:
+
+$$
+\ddot {q} _ {\text {t r a n s}} = \frac {1}{m _ {0}} R _ {\text {c a m}} ^ {\mathsf {T}} \left(\boldsymbol {\eta} + \widehat {\mathrm {h}} _ {\text {g r f}} ^ {\{0: 3 \}} - \mathrm {h} _ {g} ^ {\{0: 3 \}}\right), \tag {10}
+$$
+
+where $m_0$ is the mass of the root joint, $R_{\mathrm{cam}}$ denotes the camera orientation computed from the estimated angular velocity $\omega_{\mathrm{ine}} = (\omega_x,\omega_y,\omega_z)$ , $\pmb{\eta}$ denotes the direct root actuation, and $\widehat{\mathrm{h}}_{\mathrm{grf}}^{[0:3]}$ and $\mathrm{h_g^{[0:3]}}$ denote the first three entries of $\widehat{\mathrm{h}_{\mathrm{grf}}}$ and $\mathrm{h_g}$ , respectively.
+
+# 3.5 Constrained Update
+
+After obtaining the pose and trajectory accelerations via forward dynamics modules, we can control the human motion and global trajectory by discrete simulation. Given the frame rate $1 / \Delta t$ of the input video, we can obtain the kinematic 3D pose using the finite differences:
+
+$$
+\dot {q} ^ {t + 1} = \dot {q} ^ {t} + \Delta t \ddot {q} ^ {t}, \tag {11}
+$$
+
+$$
+q ^ {t + 1} = q ^ {t} + \Delta t \dot {q} ^ {t}. \tag {12}
+$$
+
+Similarly, we can obtain the global root trajectory:
+
+$$
+\dot {q} _ {\text {t r a n s}} ^ {t + 1} = \dot {q} _ {\text {t r a n s}} ^ {t} + \Delta t \ddot {q} _ {\text {t r a n s}} ^ {t}, \tag {13}
+$$
+
+$$
+q _ {\text {t r a n s}} ^ {t + 1} = q _ {\text {t r a n s}} ^ {t} + \Delta t \dot {q} _ {\text {t r a n s}} ^ {t}. \tag {14}
+$$
+
+In practice, since we predict the local and global motions simultaneously, we can impose contact constraints to prevent foot sliding. Therefore, instead of using Eqn. 12 and 14 to update $q^{t + 1}$ and $q_{\mathrm{trans}}^{t + 1}$ directly, we first refine the velocities $\dot{q}^{t + 1}$ and $\dot{q}_{\mathrm{trans}}^{t + 1}$ with contact constraints. For joints in contact with the ground at the time step $t$ , we expect they have zero velocity in the world frame. The velocities of non-contact joints should stay close to the original velocities computed from the accelerations. We adopt the differentiable optimization layer following the formulation of Agrawal et al. [1]. This custom layer can obtain
+
+the solution to the optimization problem and supports backward propagation. However, the optimization problem with zero velocity constraints does not satisfy the DPP rules (Disciplined Parametrized Programming), which means that the custom layer cannot be directly applied. Here, we use soft velocity constraints to follow the DPP rules:
+
+$$
+\dot {q} ^ {*}, \dot {q} _ {\text {t r a n s}} ^ {*} = \underset {\dot {q} ^ {*}, \dot {q} _ {\text {t r a n s}} ^ {*}} {\operatorname {a r g m i n}} \| \dot {q} ^ {*} - \dot {q} \| + \| \dot {q} _ {\text {t r a n s}} ^ {*} - \dot {q} _ {\text {t r a n s}} \|, \tag {15}
+$$
+
+$$
+s. t. \quad \forall i \in \{i | p _ {i} > 0. 5 \}, \| R _ {\text {c a m}} ^ {\mathsf {T}} \left(J _ {v _ {i}} \dot {q} ^ {*} - \dot {q} ^ {* \{0: 3 \}}\right) + \dot {q} _ {\text {t r a n s}} ^ {*} \| \leq \epsilon ,
+$$
+
+where $\epsilon = 0.01$ and $\dot{q}^{*\{0:3\}}$ is the first three entries of $\dot{q}^*$ . We omit the superscript $t$ for simplicity. After solving Eqn. 15, the estimated $\dot{q}^*$ and $\dot{q}_{\mathrm{trans}}^*$ are used to compute the final physically-plausible 3D pose $q$ and the global trajectory $q_{\mathrm{trans}}$ .
+
+# 3.6 Network Training
+
+The overall loss of D&D is defined as:
+
+$$
+\mathcal {L} = \mathcal {L} _ {\mathrm {3 D}} + \mathcal {L} _ {\mathrm {2 D}} + \mathcal {L} _ {\mathrm {c o n}} + \mathcal {L} _ {\mathrm {t r a n s}} + \mathcal {L} _ {\mathrm {r e g}}. \tag {16}
+$$
+
+The 3D loss $\mathcal{L}_{\mathrm{3D}}$ includes the joint error and the pose error:
+
+$$
+\mathcal {L} _ {\mathrm {3 D}} = \| X - \check {X} \| _ {1} + \| q \ominus \check {q} \| _ {2} ^ {2}, \tag {17}
+$$
+
+where $X$ denotes the 3D joints regressed from the SMPL model, “ $\ominus$ ” denotes a difference computation after converting the Euler angle into a rotation matrix, and the symbol “ $\sim$ ” denotes the ground truth. The time superscript $t$ is omitted for simplicity. The 2D loss $\mathcal{L}_{2\mathrm{D}}$ calculates the 2D reprojection error:
+
+$$
+\mathcal {L} _ {2 \mathrm {D}} = \| \Pi (X) - \Pi (\check {X}) \| _ {1}, \tag {18}
+$$
+
+where $\Pi$ denotes the projection function. The loss $\mathcal{L}_{\mathrm{trans}}$ is added for the supervision of the root translation and provides weak supervision signals for external force and contact estimation:
+
+$$
+\mathcal {L} _ {\text {t r a n s}} = \left\| q _ {\text {t r a n s}} - \check {q} _ {\text {t r a n s}} \right\| _ {1}. \tag {19}
+$$
+
+The contact loss is added for the data with contact annotations:
+
+$$
+\mathcal {L} _ {\text {c o n}} = \frac {1}{N _ {c}} \sum_ {i} ^ {N _ {c}} \left[ - \check {b} _ {i} \log p _ {i} - \left(1 - \check {b} _ {i}\right) \log \left(1 - p _ {i}\right) \right]. \tag {20}
+$$
+
+The regularization loss $\mathcal{L}_{\mathrm{reg}}$ is defined as:
+
+$$
+\mathcal {L} _ {\text {r e g}} = \left\| \boldsymbol {\eta} \right\| _ {2} ^ {2} + \frac {1}{N _ {c}} \sum_ {i} ^ {N _ {c}} \left[ - p _ {i} \log p _ {i} - (1 - p _ {i}) \log (1 - p _ {i}) \right], \tag {21}
+$$
+
+where the first term minimizes the direct root actuation, and the second term minimizes the entropy of the contact probability to encourage confident contact predictions.
+
+Table 1. Quantitative comparisons with state-of-the-art methods on the 3DPW dataset. Symbol “-” means results are not available, and “*” means self-implementation.
+
+| Method | Dynamics | MPJPE ↓ | PA-MPJPE ↓ | PVE ↓ | ACCEL ↓ |
| HMR [12] | X | 130.0 | 81.3 | - | 37.4 |
| SPIN [15] | X | 96.9 | 59.2 | 116.4 | 29.8 |
| VIBE [14] | X | 82.9 | 51.9 | 99.1 | 23.4 |
| TCMR [6] | X | 86.5 | 52.7 | 102.9 | 7.1 |
| HybrIK* [19] | X | 76.2 | 45.1 | 89.1 | 22.8 |
| MAED [50] | X | 79.1 | 45.7 | 92.6 | 17.6 |
| Ours | ✓ | 73.7 | 42.7 | 88.6 | 7.0 |
+
+# 4 Experiment
+
+# 4.1 Datasets
+
+We perform experiments on two large-scale human motion datasets. The first dataset is 3DPW [26]. 3DPW is a challenging outdoor benchmark for 3D human motion estimation. It contains 60 video sequences obtained from a hand-held moving camera. The second dataset we use is Human3.6M [9]. Human3.6M is an indoor benchmark for 3D human motion estimation. It includes 7 subjects, and the videos are captured at $50\mathrm{Hz}$ . Following previous works [15, 14, 19, 59], we use 5 subjects (S1, S5, S6, S7, S8) for training and 2 subjects (S9, S11) for evaluation. The videos are subsampled to $25\mathrm{Hz}$ for both training and testing. We further use the AMASS dataset [25] to obtain annotations of foot contact and root translation for training.
+
+# 4.2 Implementation Details
+
+We adopt HybrIK [19] as the kinematics backbone to provide the initial motion. The original HybrIK network only predicts 2.5D keypoints and requires a separate RootNet [32] to obtain the final 3D pose in the camera frame. Here, for integrity and simplicity, we implement an extended version of HybrIK as our kinematics backbone that can directly predict the 3D pose in the camera frame by estimating the camera parameters. The network structures are detailed in the supplementary material. The learning rate is set to $5 \times 10^{-5}$ at first and reduced by a factor of 10 at the 15th and 25th epochs. We use the Adam solver and train for 30 epochs with a mini-batch size of 32. Implementation is in PyTorch. During training on the Human3.6M dataset, we simulate a moving camera by cropping the input video with bounding boxes.
+
+# 4.3 Comparison to state-of-the-art methods
+
+Results on Moving Camera We first compare D&D against state-of-the-art methods on 3DPW, an in-the-wild dataset captured with the hand-held
+
+Table 2. Quantitative comparisons with state-of-the-art methods on the Human3.6M dataset. Symbol “-” means results are not available, “*” means self-implementation, and “†” means the method reports results on 17 joints.
+
+| Method | Dynamics | MPJPE ↓ | PA-MPJPE ↓ | PVE ↓ | ACCEL ↓ | FS ↓ | GP ↓ |
| VIBE [14] | X | 61.3 | 43.1 | - | 15.2 | 15.1 | 12.6 |
| NeurGD [45] | X | 57.3 | 42.2 | - | 14.2 | 16.7 | 24.4 |
| MAED† [50] | X | 56.3 | 38.7 | - | - | - | - |
| HybrIK* [19] | X | 56.4 | 36.7 | - | 10.9 | 18.3 | 10.6 |
| PhysCap [44] | ✓ | 113.0 | 68.9 | - | - | - | - |
| EgoPose [57] | ✓ | 130.3 | 79.2 | - | 31.3 | 5.9 | 3.5 |
| NeurPhys [43] | ✓ | 76.5 | - | - | - | - | - |
| SimPoE [59] | ✓ | 56.7 | 41.6 | - | 6.7 | 3.4 | 1.6 |
| Ours | ✓ | 52.5 | 35.5 | 72.9 | 6.1 | 5.8 | 1.5 |
+
+moving camera. Since previous dynamics-based methods are not applicable in the moving camera, prior arts on the 3DPW dataset are all kinematics-based. Mean per joint position error (MPJPE) and Procrustes-aligned mean per joint position error (PA-MPJPE) are reported to assess the 3D pose accuracy. The acceleration error (ACCEL) is reported to assess the motion smoothness. We also report Per Vertex Error (PVE) to evaluate the entire estimated body mesh.
+
+Tab. 1 summarizes the quantitative results. We can observe that D&D outperforms the most accurate kinematics-based methods, HybrIK and MAED, by 2.5 and $5.4\mathrm{mm}$ on MPJPE, respectively. Besides, D&D improves the motion smoothness significantly by $69.3\%$ and $60.2\%$ relative improvement on ACCEL, respectively. It shows that D&D retains the benefits of the accurate pose in kinematics modeling and physically plausible motion in dynamics modeling.
+
+Results on Static Camera To compare D&D with previous dynamics-based methods, we evaluate D&D on the Human3.6M dataset. Following the previous method [59], we further report two physics-based metrics, foot sliding (FS) and ground penetration (GP), to measure the physical plausibility. To assess the effectiveness of IFC, we simulate a moving camera by cropping the input video with bounding boxes, i.e., the input to D&D is the video from a moving camera. Tab. 2 shows the quantitative comparison against kinematics-based and dynamics-based methods. D&D outperforms previous kinematics-based and dynamics-based methods in pose accuracy. For physics-based metrics (ACCEL, FS, and GP), D&D shows comparable performance to previous methods that require physics simulation engines.
+
+We further follow GLAMR [56] to evaluate the global MPJPE (G-MPJPE) and global PVE (G-PVE) on the Human3.6M dataset with the simulated moving camera. The root translation is aligned with the GT at the first frame of the
+
+
+Fig. 2. Qualitative comparisons on the 3DPW dataset. D&D estimates accurate poses with physically plausible foot contact and global movement.
+
+Table 3. Ablation experiments on 3DPW and Human3.6M dataset.
+
+ | 3DPW | Human3.6M |
| MPJPE ↓ | PA-MPJPE ↓ | ACCEL ↓ | MPJPE ↓ | PA-MPJPE ↓ | ACCEL ↓ |
| w/o IFC | 76.0 | 45.2 | 10.0 | 53.8 | 36.4 | 6.7 |
| w/o PCT | 74.6 | 43.4 | 9.8 | 53.4 | 36.1 | 6.7 |
| w/o Att PD Controller | 73.8 | 42.8 | 8.0 | 52.5 | 35.7 | 6.3 |
| D&D (Ours) | 73.7 | 42.7 | 7.0 | 52.5 | 35.5 | 6.1 |
+
+video sequence. D&D obtains 785.1mm G-MPJPE and 793.3mm G-PVE. More comparisons are reported in the supplementary material.
+
+# 4.4 Ablation Study
+
+Inertial Force vs. Residual Force. In this experiment, we compare the proposed inertial force control (IFC) with residual force control (RFC). To control the human motion with RFC in the local camera frame, we directly estimate the residual force instead of the linear acceleration and angular velocity. Quantitative results are reported in Tab. 3. It shows that explicit modeling of the inertial components can better explain the body movement than implicit modeling with residual force. IFC performs more accurate pose control and significantly reduces the motion jitters, showing a $30\%$ relative improvement of ACCEL on 3DPW.
+
+Effectiveness of PCT. To study the effectiveness of the probabilistic contact torque, we remove PCT in the baseline model. When training the baseline, the output contact probabilities are discretized to 0 or 1 with the threshold of 0.5
+
+and we compute the discrete contact torque instead of the probabilistic contact torque. Quantitative results in Tab. 3 show that PCT is indispensable to have smooth and accurate 3D human motion.
+
+Effectiveness of Attentive PD Controller. To further validate the effectiveness of the attentive mechanism, we report the results of the baseline model without the attentive PD controller. In this baseline, we adopt the meta-PD controller [59, 43] that dynamically predicts the gain parameters based on the state of the character, which only allows local adjustment. Tab. 3 summarizes the quantitative results. The attentive PD controller contributes to a more smooth motion control as indicated by a smaller acceleration error.
+
+# 4.5 Qualitative Results
+
+In Fig. 3, we plot the contact forces estimated by D&D of the walking motion from the Human3.6M test set. Note that our approach does not require any ground-truth force annotations for training. The estimated forces fall into a reasonable force range for walking motions [42]. We also provide qualitative comparisons in Fig. 2. It shows that D&D can estimate physically plausible motions with accurate foot-ground contacts and no ground penetration.
+
+
+Fig. 3. Estimated contact forces of the walking sequences. The forces remain in a reasonable range for walking.
+
+# 5 Conclusion
+
+In this paper, we propose D&D, a physics-aware framework for 3D human motion capture with dynamic camera movements. To impose the laws of physics in the moving camera, we introduce inertial force control that explains the 3D human motion by taking the inertial forces into consideration. We further develop the probabilistic contact torque for weakly-supervised training and the attentive PD controller for smooth and accurate motion control. We demonstrate the effectiveness of our approach on standard 3D human pose datasets. D&D outperforms state-of-the-art kinematics-based and dynamics-based methods. Besides, it is entirely neural-based and runs without offline optimization or physics simulators. We hope D&D can serve as a solid baseline and provide a new perspective for dynamics modeling in 3D human motion capture.
+
+Acknowledgments. This work was supported by the National Key R&D Program of China (No. 2021ZD0110700), Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102), Shanghai Qi Zhi Institute, SHEITC (2018-RGZN-02046) and Tencent GY-Lab.
+
+# References
+
+1. Agrawal, A., Amos, B., Barratt, S., Boyd, S., Diamond, S., Kolter, J.Z.: Differentiable convex optimization layers. NeurIPS (2019) 9
+2. Akhter, I., Black, M.J.: Pose-conditioned joint angle limits for 3d human pose reconstruction. In: CVPR (2015) 3
+3. Andrews, S., Huerta, I., Komura, T., Sigal, L., Mitchell, K.: Real-time physics-based motion capture with sparse sensors. In: CVMP (2016) 6
+4. Arnab, A., Doersch, C., Zisserman, A.: Exploiting temporal context for 3d human pose estimation in the wild. In: CVPR (2019) 3
+5. Bogo, F., Kanazawa, A., Lassner, C., Gehler, P., Romero, J., Black, M.J.: Keep it smpl: Automatic estimation of 3d human pose and shape from a single image. In: ECCV (2016) 3
+6. Choi, H., Moon, G., Chang, J.Y., Lee, K.M.: Beyond static features for temporally consistent 3d human pose and shape from a video. In: CVPR (2021) 2, 3, 11
+7. Dabral, R., Shimada, S., Jain, A., Theobalt, C., Golyanik, V.: Gravity-aware monocular 3d human-object reconstruction. In: ICCV (2021) 2, 3, 4
+8. Fang, H., Xu, Y., Wang, W., Liu, X., Zhu, S.C.: Learning pose grammar to encode human body configuration for 3d pose estimation. AAAI (2017) 3
+9. Ionescu, C., Papava, D., Olaru, V., Sminchisescu, C.: Human3. 6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. TPAMI (2013) 3, 11
+0. Jang, E., Gu, S., Poole, B.: Categorical reparameterization with gumbel-softmax. In: ICLR (2017) 7
+1. Joo, H., Neverova, N., Vedaldi, A.: Exemplar fine-tuning for 3d human model fitting towards in-the-wild 3d human pose estimation. In: 3DV (2021) 3
+2. Kanazawa, A., Black, M.J., Jacobs, D.W., Malik, J.: End-to-end recovery of human shape and pose. In: CVPR (2018) 2, 3, 11
+3. Kanazawa, A., Zhang, J.Y., Felsen, P., Malik, J.: Learning 3d human dynamics from video. In: CVPR (2019) 2, 3
+4. Kocabas, M., Athanasiou, N., Black, M.J.: Vibe: Video inference for human body pose and shape estimation. In: CVPR (2020) 2, 3, 11, 12
+5. Kolotouros, N., Pavlakos, G., Black, M.J., Daniilidis, K.: Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In: ICCV (2019) 2, 3, 11
+6. Lassner, C., Romero, J., Kiefel, M., Bogo, F., Black, M.J., Gehler, P.V.: Unite the people: Closing the loop between 3d and 2d human representations. In: CVPR (2017) 3
+7. Levine, S., Popovic, J.: Physically plausible simulation for character animation. In: SIGGRAPH (2012) 6
+8. Li, J., Chen, T., Shi, R., Lou, Y., Li, Y.L., Lu, C.: Localization with sampling-argmax. Advances in Neural Information Processing Systems 34, 27236-27248 (2021) 3
+9. Li, J., Xu, C., Chen, Z., Bian, S., Yang, L., Lu, C.: Hybrid analytical-neural inverse kinematics solution for 3d human pose and shape estimation. In: CVPR (2021) 2, 3, 11, 12
+20. Li, Y.L., Liu, X., Lu, H., Wang, S., Liu, J., Li, J., Lu, C.: Detailed 2d-3d joint representation for human-object interaction. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10166–10175 (2020), 1
+
+21. Li, Y.L., Xu, L., Liu, X., Huang, X., Xu, Y., Wang, S., Fang, H.S., Ma, Z., Chen, M., Lu, C.: Pastanet: Toward human activity knowledge engine. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 382-391 (2020) 1
+22. Loper, M., Mahmood, N., Romero, J., Pons-Moll, G., Black, M.J.: Smpl: A skinned multi-person linear model. TOG (2015) 3, 8
+23. Luo, Z., Golestaneh, S.A., Kitani, K.M.: 3d human motion estimation via motion compression and refinement. In: ACCV (2020) 2
+24. Luo, Z., Hachiuma, R., Yuan, Y., Kitani, K.: Dynamics-regulated kinematic policy for egocentric pose estimation. In: NeurIPS (2021) 4
+25. Mahmood, N., Ghorbani, N., Troje, N.F., Pons-Moll, G., Black, M.J.: Amass: Archive of motion capture as surface shapes. In: ICCV (2019) 3, 11
+26. von Marcard, T., Henschel, R., Black, M.J., Rosenhahn, B., Pons-Moll, G.: Recovering accurate 3d human pose in the wild using imus and a moving camera. In: ECCV (2018) 2, 3, 5, 11
+27. Martinez, J., Hossain, R., Romero, J., Little, J.J.: A simple yet effective baseline for 3d human pose estimation. In: ICCV (2017) 3
+28. Mehta, D., Rhodin, H., Casas, D., Fua, P., Sotnychenko, O., Xu, W., Theobalt, C.: Monocular 3d human pose estimation in the wild using improved cnn supervision. In: 3DV (2017) 3
+29. Mehta, D., Sotnychenko, O., Mueller, F., Xu, W., Elgharib, M., Fua, P., Seidel, H.P., Rhodin, H., Pons-Moll, G., Theobalt, C.: Xnect: Real-time multi-person 3d motion capture with a single rgb camera. TOG (2020) 3
+30. Mehta, D., Sotnychenko, O., Mueller, F., Xu, W., Sridhar, S., Pons-Moll, G., Theobalt, C.: Single-shot multi-person 3d pose estimation from monocular rgb. In: 3DV (2018) 3
+31. Mehta, D., Sridhar, S., Sotnychenko, O., Rhodin, H., Shafiei, M., Seidel, H.P., Xu, W., Casas, D., Theobalt, C.: Vnect: Real-time 3d human pose estimation with a single rgb camera. TOG (2017) 3
+32. Moon, G., Chang, J.Y., Lee, K.M.: Camera distance-aware top-down approach for 3d multi-person pose estimation from a single rgb image. In: ICCV (2019) 3, 11
+33. Moon, G., Lee, K.M.: I2l-meshnet: Image-to-lixel prediction network for accurate 3d human pose and mesh estimation from a single rgb image. In: ECCV (2020) 2, 3
+34. Moreno-Noguer, F.: 3d human pose estimation from a single image via distance matrix regression. In: CVPR (2017) 3
+35. Park, S., Hwang, J., Kwak, N.: 3d human pose estimation using convolutional neural networks with 2d pose information. In: ECCV (2016) 3
+36. Pavlakos, G., Choutas, V., Ghorbani, N., Bolkart, T., Osman, A.A., Tzionas, D., Black, M.J.: Expressive body capture: 3d hands, face, and body from a single image. In: CVPR (2019) 3
+37. Pavlakos, G., Zhou, X., Derpanis, K.G., Daniilidis, K.: Coarse-to-fine volumetric prediction for single-image 3d human pose. In: CVPR (2017) 3
+38. Peng, X.B., Chang, M., Zhang, G., Abbeel, P., Levine, S.: MCP: Learning composable hierarchical control with multiplicative compositional policies. arXiv preprint arXiv:1905.09808 (2019) 4
+39. Rempe, D., Birdal, T., Hertzmann, A., Yang, J., Sridhar, S., Guibas, L.J.: Humor: 3d human motion model for robust pose estimation. In: ICCV (2021) 3
+40. Rempe, D., Guibas, L.J., Hertzmann, A., Russell, B., Villegas, R., Yang, J.: Contact and human dynamics from monocular video. In: ECCV (2020) 2, 3
+
+41. Rogez, G., Weinzaepfel, P., Schmid, C.: Lcr-net: Localization-classification-regression for human pose. In: CVPR (2017) 3
+42. Shahabpoor, E., Pavic, A.: Measurement of walking ground reactions in real-life environments: a systematic review of techniques and technologies. Sensors (2017) 14
+43. Shimada, S., Golyanik, V., Xu, W., Pérez, P., Theobalt, C.: Neural monocular 3d human motion capture with physical awareness. TOG (2021) 2, 3, 4, 5, 6, 7, 8, 12, 14
+44. Shimada, S., Golyanik, V., Xu, W., Theobalt, C.: Physcap: Physically plausible monocular 3d motion capture in real time. TOG (2020) 2, 3, 5, 6, 7, 8, 12
+45. Song, J., Chen, X., Hilliges, O.: Human body model fitting by learned gradient descent. In: ECCV (2020) 12
+46. Sun, X., Shang, J., Liang, S., Wei, Y.: Compositional human pose regression. In: ICCV (2017) 3
+47. Sun, X., Xiao, B., Wei, F., Liang, S., Wei, Y.: Integral human pose regression. In: ECCV (2018) 3
+48. Sun, Y., Ye, Y., Liu, W., Gao, W., Fu, Y., Mei, T.: Human mesh recovery from monocular images via a skeleton-disentangled representation. In: ICCV (2019) 3
+49. Varol, G., Ceylan, D., Russell, B., Yang, J., Yumer, E., Laptev, I., Schmid, C.: Bodynet: Volumetric inference of 3d human body shapes. In: ECCV (2018) 3
+50. Wan, Z., Li, Z., Tian, M., Liu, J., Yi, S., Li, H.: Encoder-decoder with multi-level attention for 3d human shape and pose estimation. In: ICCV (2021) 2, 3, 11, 12
+51. Wang, C., Li, J., Liu, W., Qian, C., Lu, C.: Hmor: Hierarchical multi-person ordinal relations for monocular multi-person 3d pose estimation. In: European Conference on Computer Vision. pp. 242-259. Springer (2020) 3
+52. Xu, H., Bazavan, E.G., Zanfir, A., Freeman, W.T., Sukthankar, R., Sminchisescu, C.: Ghum & ghuml: Generative 3d human shape and articulated pose models. In: CVPR (2020) 3
+53. Yang, C., Huang, Q., Jiang, H., Peter, O.O., Han, J.: Pd control with gravity compensation for hydraulic 6-dof parallel manipulator. Mechanism and Machine theory (2010) 8
+54. Yasin, H., Iqbal, U., Kruger, B., Weber, A., Gall, J.: A dual-source approach for 3d pose estimation from a single image. In: CVPR (2016) 3
+55. Yu, R., Park, H., Lee, J.: Human dynamics from monocular video with dynamic camera movements. TOG (2021) 4
+56. Yuan, Y., Iqbal, U., Molchanov, P., Kitani, K., Kautz, J.: Glamr: Global occlusion-aware human mesh recovery with dynamic cameras. In: CVPR (2022) 2, 12
+57. Yuan, Y., Kitani, K.: Ego-pose estimation and forecasting as real-time pd control. In: ICCV (2019) 3, 4, 12
+58. Yuan, Y., Kitani, K.: Residual force control for agile human behavior imitation and extended motion synthesis. NeurIPS (2020) 5, 6, 7
+59. Yuan, Y., Wei, S.E., Simon, T., Kitani, K., Saragih, J.: Simpoe: Simulated character control for 3d human pose estimation. In: CVPR (2021) 2, 3, 4, 8, 11, 12, 14
+60. Zell, P., Rosenhahn, B., Wandt, B.: Weakly-supervised learning of human dynamics. In: ECCV (2020) 4
+61. Zeng, A., Sun, X., Huang, F., Liu, M., Xu, Q., Lin, S.: Srnet: Improving generalization in 3d human pose estimation with a split-and-recombine approach. In: ECCV (2020) 3
+
+62. Zeng, A., Yang, L., Ju, X., Li, J., Wang, J., Xu, Q.: Smoothnet: A plug-and-play network for refining human poses in videos. arXiv preprint arXiv:2112.13715 (2021) 2
+63. Zhou, X., Huang, Q., Sun, X., Xue, X., Wei, Y.: Towards 3d human pose estimation in the wild: a weakly-supervised approach. In: ICCV (2017) 3
\ No newline at end of file
diff --git a/ddlearninghumandynamicsfromdynamiccamera/images.zip b/ddlearninghumandynamicsfromdynamiccamera/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..68b68595418822b8b791afa7fbdaa5b5393bd993
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb75572b705e5236d9c51c29dead57d79e9fe987a85b3f23b1fe27b973bdaf2c
+size 357563
diff --git a/ddlearninghumandynamicsfromdynamiccamera/layout.json b/ddlearninghumandynamicsfromdynamiccamera/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2dc44f0ac8166d413e4f0a1dad5941cd94387d05
--- /dev/null
+++ b/ddlearninghumandynamicsfromdynamiccamera/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:023842138893bb5bd92aa2bcdaa2df3f44825687309dd744047ebaacc0da929a
+size 462553